WPML

문제 개요

Product Filters for WooCommerce의 “Filter products by attribute” 위젯을 사용하고 표시 옵션을 “Dropdown”으로 설정하면 프런트엔드에서 속성 레이블이 번역되지 않습니다(예: “Select Color”).

임시 해결 방법

진행하기 전에 사이트의 전체 사이트 백업을 완료했는지 확인하세요.

  • 테마의 functions.php 파일에 다음 코드를 추가하세요.
    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' ] );
            }
        }
    } );

모든 알려진 문제

이 문제에 대한 도움이 필요하십니까?

지원 문의를 하시면 저희가 함께 살펴보겠습니다.