WPML

סקירת התקלה

בעת שימוש בוידג’ט ”Filter products by attribute” מתוך Product Filters for WooCommerce והגדרת אפשרות התצוגה ל־“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' ] );
            }
        }
    } );

כל התקלות הידועות

זקוק לעזרה בבעיה זו?

פתח פנייה לתמיכה ואנחנו נבדוק זאת איתך.