Created
September 23, 2024 09:32
-
-
Save webtoffee-git/83034c5c37e2dfa38167ae009058b196 to your computer and use it in GitHub Desktop.
Fix compatibility issue with Curcy Multi Currency plugin on the Gift Card product page - By WebToffee (WebToffee Gift Cards plugin)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Do no copy this line of code | |
add_filter('wt_gc_alter_giftcard_predifined_amounts',function($predefined){ | |
if(class_exists('WOOMULTI_CURRENCY_F')){ | |
$curcy_currency_settings = WOOMULTI_CURRENCY_F_Data::get_ins(); | |
$currency_list = $curcy_currency_settings->get_list_currencies(); | |
$current_currency = $curcy_currency_settings->get_current_currency(); | |
$current_currency_rate = floatval( $currency_list[ $current_currency ]['rate'] ); | |
foreach($predefined as $key => $value){ | |
$predefined[$key] = $value * $current_currency_rate; | |
} | |
} | |
return $predefined; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment