WPML
add_filter( 'wcml_is_cache_enabled_for_switching_currency', 'the_callback_function', 10, 1 );
Тип
filter
Версия WooCommerce Multilingual
4.3.3

Описание

Этот фильтр добавляет ?wcmlc={currency_code} к URL, что задает строку запроса с кодом валюты. Это полезно, когда на Вашем сайте включен кеш и изменения валюты отображаются некорректно.

Аргументы

В этот фильтр передаётся только один параметр:

$enabled


(bool) Установите значение true, чтобы включить фильтр.

Пример использования

Пример
/**
* Enable the query string argument on currency change.
*/
add_filter( 'wcml_is_cache_enabled_for_switching_currency', '__return_true' );

wcml_custom_prices_fields_labels, wcml_geolocation_get_user_country, wcml_user_store_strategy, wcml_rounded_price, wcml_currencies_without_cents, wcml_product_custom_prices, wcml_custom_prices_strings, wcml_switch_currency, wcml_custom_prices_fields, wcml_multi_currency_ajax_actions

Все хуки категории «Функция мультивалютности» (24) →