Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created September 23, 2024 09:32
Show Gist options
  • Save webtoffee-git/83034c5c37e2dfa38167ae009058b196 to your computer and use it in GitHub Desktop.
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)
<?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