Fix - Compatible for Currency Switcher for WooCommerce to check subtotal based condition (By WP Wham
Fix compatibility for Currency Switcher for WooCommerce to check subtotal-based conditions (by WP Wham).
add_filter('advanced_woo_discount_rules_converted_currency_value', function($value){
if (class_exists( 'Alg_WC_Currency_Switcher' ) ) {
if(function_exists('alg_wc_cs_get_currency_exchange_rate') && function_exists('alg_get_current_currency_code')){
$alg_wc_cs = alg_wc_cs_get_currency_exchange_rate(alg_get_current_currency_code());
if($alg_wc_cs != 0){
return $alg_wc_cs * $value;
}
}
}
return $value;
}, 10);