Fix - Rule applied messages shown incorrectly
Correct the display of messages indicating applied discount rules.
// Re-initialize $applied_rules static variable before calculate totals
add_action('woocommerce_before_calculate_totals', function () {
if (class_exists('Wdr\App\Router')) {
$manage_discount = Wdr\App\Router::$manage_discount;
if (is_object($manage_discount)) {
$calc = $manage_discount::$calculator;
$calc::$applied_rules = array();
}
}
});PreviousLoad Product price shortcodeNextInclude individually priced amount compatibility for WooCommerce Product Bundles by WooCommerce
Last updated