fix for displaying other language message while switch the language though WPML
Fix for displaying other language message while switch the language though WPML
add_action('woocommerce_before_cart', function (){
if(class_exists('\Wdr\App\Controllers\ManageDiscount') && class_exists('\Wdr\App\Controllers\DiscountCalculator')) {
if (!empty(\Wdr\App\Controllers\ManageDiscount::$calculator)) {
$calc = \Wdr\App\Controllers\ManageDiscount::$calculator;
$calc::$applied_rules = array();
if (!WC()->cart->is_empty()){
WC()->cart->calculate_totals();
}
}
}
});