If you are using WooCommerce Product Add-Ons (https://woocommerce.com/products/product-add-ons/), you will need the following code snippet to include the product add-on price as well for the discount.

Snippet 1: 

Use the following snippet if you see the prices of add-ons displaying as 0 in the cart page or it does not display at all

if(!function_exists('woo_discount_rules_has_price_override_method')){
    function woo_discount_rules_has_price_override_method($hprice, $product){
        return true;
    }
}
add_filter('woo_discount_rules_has_price_override', 'woo_discount_rules_has_price_override_method', 10, 2);


Snippet 2: 

If you does not want the add-on prices to be considered in the discount rule  AND you want the discount apply only on the main product's price.

Click the button below to see the snippet 

How to Add the Code Snippet

Method 1: Easier

Using the Code Snippet plugin  - Its a free, useful plugin

Method 2:

Adding the code snippet to your theme's functions.php file 

I have more questions

Just leave your question and email by clicking the Live Chat button below.
We are always happy to assist you :)

Did this answer your question?