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 ซึ่งระบุ query string ที่มีรหัสสกุลเงิน สิ่งนี้มีประโยชน์เมื่อไซต์ของคุณเปิดใช้งานแคชและแสดงการเปลี่ยนแปลงสกุลเงินไม่ถูกต้อง

อาร์กิวเมนต์

มีพารามิเตอร์เพียงตัวเดียวที่ส่งไปยังฟิลเตอร์นี้:

$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 รายการ →