Skip to content
Advertisement

WooCommerce cart items price suffix for specific product category

I need to add a suffix text to the price of a woocommerce product from a specific category while on WooCommerce cart.

Here is my code:

JavaScript

The problem is it only works on simple products. Doesn’t seem to affect the prices of variable products (I tested on 3 different sites).

Any idea what I’m missing?

Advertisement

Answer

To make it work for product variations items in cart too, use instead the following:

JavaScript

Code goes in functions.php file of the active child theme (or active theme). Tested and works.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement