Created
March 6, 2016 18:43
-
-
Save KresimirKoncicNeuralab/836f3a9dee4ea1c13864 to your computer and use it in GitHub Desktop.
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
add_filter('woocommerce_paypal_args', 'convert_hrk_to_eur'); | |
function convert_hrk_to_eur($paypal_args) | |
{ | |
if ( $paypal_args['currency_code'] == 'HRK') | |
{ | |
$convert_rate = 7.5; //set the converting rate or pull form the DB transients | |
$paypal_args['currency_code'] = 'EUR'; //change HRK to EUR | |
$i = 1; | |
while (isset($paypal_args['amount_' . $i])) | |
{ | |
$paypal_args['amount_' . $i] = round( $paypal_args['amount_' . $i] / $convert_rate, 2); | |
++$i; | |
} | |
} | |
return $paypal_args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment