- 상태
- 미해결
- 보고된 제품
- WPML Multilingual & Multicurrency for WooCommerce 5.4.5
- 관련 플러그인/테마
- Product Filters for WooCommerce
- 주제 태그
- Compatibility, WCML
문제 개요
Product Filters for WooCommerce의 “Filter products by attribute” 위젯을 사용하고 표시 옵션을 “Dropdown”으로 설정하면 프런트엔드에서 속성 레이블이 번역되지 않습니다(예: “Select Color”).
임시 해결 방법
진행하기 전에 사이트의 전체 사이트 백업을 완료했는지 확인하세요.
- 테마의 functions.php 파일에 다음 코드를 추가하세요.
/** * Force the translation of product attribute labels on the frontend. */ add_action( 'after_setup_theme', function() { if ( ! is_admin() && ! wpml_is_ajax() && function_exists( 'WPMLContainermake' ) ) { $wcStrings = WPMLContainermake( WCML_WC_Strings::class ); if ( $wcStrings ) { add_filter( 'woocommerce_attribute_taxonomies', [ $wcStrings, 'translate_attribute_taxonomies_labels' ] ); } } } );