💸 Get more for your money each Wednesday with big savings on selected extensions. Shop this week's deals

Dynamic Pricing for WooCommerce

Bulk discounts, role-based pricing and much more

Pourcentage discount not working as expected

I am encountering an issue when using “PPOM for WooCommerce” module + “Dynamic pricing” module.

When the woocommerce hook `woocommerce_before_calculate_totals` is called several times, the discount applied using the “Pourcentage discount” mode on products is incorrect.

This issue happened to me when using this module with another module (PPOM for WooCommerce).
The second module is triggering the woocommerce `$cart->calculate_totals()` which is triggering the `woocommerce_before_calculate_totals` hook twice on page load.

You should consider to fix your module by adding a `remove_action( ‘woocommerce_before_calculate_totals’, [$this, ‘on_calculate_totals’], 98 );` after the first call of the hook.

The issue can be reproduced just by installing both modules and setting a dynamic price on a product using the “Pourcentage discount” mode.

Thank you

Author

davidfoures2

Current Status

Open

Last updated: January 31, 2023

0 comments

Log in to comment on this feature request.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.