Support » Plugin: Dynamic Pricing and Discounts for WooCommerce » A way to get discount % for a particular product

  • Resolved MisterR

    (@mister_r)


    Hello XAdapter,

    We are using your plugin in conjunction with “WooCommerce Subscribe All the Things”. We have set up 10% discounts in both plugins, but when they are applied, we get x*0.9*0.9 instead of x*0.8.

    So we try to manually calculate total discount on “woocommerce_before_calculate_totals” action.

    The question is — how can we find the discount set up in your plugin for a particular product?

    Alternatively, maybe we can manually calculate the total price (with discount)?

    We’ve tried to do smth like this:

    $dynamic_discount_handler = new XA_NewCalculationHandler;
    $price = $dynamic_discount_handler->getDiscountedPriceForProduct('', $_product);

    But unfortunately this code returns empty string (old_price passed as the 1st param).

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘A way to get discount % for a particular product’ is closed to new replies.