- สถานะ
- แก้ไขแล้ว
- แก้ไขใน
- WCML 3.7.12
ภาพรวมของปัญหา
ปลั๊กอิน Genesis Connect for WooCommerce ช่วยให้สามารถเขียนทับเทมเพลตเริ่มต้นของ WooCommerce ได้โดยการฟิลเตอร์ ‘template_include’ WPML Multilingual & Multicurrency for WooCommerce ทำการฟิลเตอร์ ‘template_include’ เช่นกันแต่มีลำดับความสำคัญสูงกว่า ดังนั้นการเปลี่ยนแปลงที่ใช้จาก Genesis Connect จึงไม่มีผล
วิธีแก้ปัญหาชั่วคราว
จำเป็นต้องจัดคิวการฟิลเตอร์ ‘template_include’ ไว้ในลำดับความสำคัญที่สูงกว่า เพื่อไม่ให้ถูกเขียนทับโดย WooCommerce Multilingual คุณต้องเพิ่มการดำเนินการต่อไปนี้ลงในไฟล์ functions.php:
add_action( 'after_setup_theme', 'wpml_comp_1646', 100 );
function wpml_comp_1646(){
if ( has_filter( 'template_include', 'gencwooc_template_loader' ) ) {
remove_filter( 'template_include', 'gencwooc_template_loader', 20 );
add_filter( 'template_include', 'gencwooc_template_loader', 200 );
}
}