add_action( 'wcml_before_sync_product_data', 'the_callback_function', 10, 3 );
- ประเภท
- action
- หมวดหมู่
- การอัปเดตเนื้อหา
- เวอร์ชันของ WooCommerce Multilingual
- 3.7.0
คำอธิบาย
- เรียกใช้การดำเนินการก่อนที่ WCML จะซิงค์ข้อมูล (รูปภาพ อนุกรมวิธาน รูปแบบสินค้า ฯลฯ) จากสินค้าต้นฉบับไปยังการแปล
- การดำเนินการนี้จะถูกเรียกใช้หลังจาก wcml_before_sync_product
อาร์กิวเมนต์
มีพารามิเตอร์ 3 ตัวที่ถูกส่งไปยังการดำเนินการนี้:- $original_product_id
- (integer) ID ของสินค้าต้นฉบับ
- $translated_product_id
- (integer) ID ของสินค้าที่แปล
- $target_language
- (string) รหัสภาษาของสินค้าที่แปล
ตัวอย่างการใช้งาน
ตัวอย่าง
add_action( 'wcml_before_sync_product_data', 'my_custom_action', 10, 3 );
function my_custom_action( $original_product_id, $translated_product_id, $target_language ) {
// my custom action
}
ฮุกที่เกี่ยวข้อง
wcml_after_duplicate_product_post_meta, wcml_update_extra_fields, wcml_js_lock_fields_ids, wcml_js_lock_fields_input_names, wcml_js_lock_fields_classes, wcml_before_sync_product