- availability:
-
WooCommerce Multilingual Version: 3.5
- description:
-
Run your custom functions right after the client currency for the front end is switched via AJAX requests.
- type:
- action
- category:
- Multi-currency Feature
- parameters:
-
add_action( 'wcml_switch_currency', 'the_callback_function', 10, 1 );
There is one parameter being passed to this action: new_currency.
- $new_currency
- (string) The new currency code is switched to, e.g. “USD”, “EUR”, etc.
- hook example usage:
-
Example
1234add_action(
'wcml_switch_currency'
,
'my_custom_action'
, 10, 1 );
function
my_custom_action(
$new_currency
) {
// my custom action
}