- الحالة
- محلولة
- أُبلغ عنها لـ
- WPML Multilingual & Multicurrency for WooCommerce 5.2.0
- تم حلها في
- WCML 5.3.0
- وسوم الموضوع
- Compatibility
نظرة عامة على المشكلة
في الحالات التي تنشئ فيها نموذج Divi لعرضه في جميع صفحات الأرشيف، ويوجد أيضاً ملف taxonomy-product_cat.php في قالبك، سيظهر تعارض. على وجه التحديد، سيُعرض نموذج Divi الخاص بك في اللغة الافتراضية فقط. وعند تبديل اللغات، سيعرض النموذج من ملف taxonomy-product_cat.php بدلاً من نموذج Divi.
حل بديل مؤقت
يُرجى التأكد من أخذ نسخة احتياطية كاملة لموقعك قبل المتابعة.
- افتح ملف functions.php الخاص بقالبك.
- أضف الكود التالي:
add_filter('template_include', function ($template){ if (function_exists('wc_locate_template') && strpos($template, 'Divi/includes/builder') !== false && !file_exists(wc_locate_template(basename($template)))) { global $woocommerce_wpml; remove_filter( 'template_include', [ $woocommerce_wpml->store, 'template_loader' ], 100 ); } return $template; }, 99);
ملاحظة
قد تظهر هذه المشكلة أيضاً مع قوالب Elementor. في هذه الحالة، ستحتاج إلى استخدام هذا المقتطف البرمجي بدلاً من ذلك:
add_filter('template_include', function ($template){
if (function_exists('wc_locate_template') && strpos($template, 'elementor') !== false && !file_exists(wc_locate_template(basename($template)))) {
global $woocommerce_wpml;
remove_filter( 'template_include', [ $woocommerce_wpml->store, 'template_loader' ], 100 );
}
return $template;
}, 12);