- 상태
- 해결됨
- 보고된 제품
- WPML Multilingual & Multicurrency for WooCommerce 5.2.0
- 해결된 버전
- WCML 5.3.0
- 주제 태그
- Compatibility
문제 개요
모든 아카이브 페이지에 표시할 Divi 템플릿을 생성하고 테마에 taxonomy-product_cat.php 파일도 있는 경우 충돌이 발생합니다. 구체적으로, Divi 템플릿은 기본 언어로만 표시됩니다. 언어를 전환할 때마다 Divi 템플릿 대신 taxonomy-product_cat.php 파일의 템플릿이 표시됩니다.
임시 해결 방법
계속 진행하기 전에 사이트의 전체 백업을 완료하세요.
- 테마의 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);