WPML
add_filter( 'wcml_is_cache_enabled_for_switching_currency', 'the_callback_function', 10, 1 );
Loại
filter
Phiên bản WooCommerce Multilingual
4.3.3

Miêu tả

Bộ lọc này thêm ?wcmlc={currency_code} vào URL, giúp chỉ định một chuỗi truy vấn chứa mã tiền tệ. Điều này rất hữu ích khi trang web của bạn đã bật cache và không hiển thị chính xác các thay đổi về tiền tệ.

Đối số

Chỉ có một tham số được truyền cho bộ lọc này:

$enabled


(bool) Đặt thành true để bật bộ lọc.

Ví dụ sử dụng

Ví dụ
/**
* 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

Tất cả 24 hook Tính năng đa tiền tệ →