Created
April 5, 2016 10:46
-
-
Save fburatti/d16dc5881f04ce5168dd651c10777391 to your computer and use it in GitHub Desktop.
WooCommerce Multilingual (wpml) integration for woocommerce setefi monetaweb
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 | |
function modify_setefi_plugin_params( $value ) { | |
// consente di impostare la lingua della pagina di pagamento sul server della banca in base alla lingua corrente nello shop | |
/*if( ICL_LANGUAGE_CODE == 'it' ) { | |
$value['language'] = 'ITA'; | |
} else if (ICL_LANGUAGE_CODE == 'en') { | |
$value['language'] = 'USA'; | |
} */ | |
// consente di impostare la valuta di pagamento in base a quella corrente nello shop | |
global $woocommerce_wpml; | |
$client_currency = $woocommerce_wpml->multi_currency_support->get_client_currency(); | |
if($client_currency=='EUR') { | |
$value['currencyCode'] = '978'; | |
} else if ($client_currency=='USD') { | |
$value['currencyCode'] = '840'; | |
} | |
return $value; | |
} | |
add_filter( 'wc_setefi_payment_args', 'modify_setefi_plugin_params' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment