WPML
סטטוס
נפתר על ידי המפתח
תוסף/ערכת עיצוב קשורים
Woocommerce Product Tabs
תגיות נושא
Compatibility, WCML

סקירה כללית של התקלה

אם אתה משתמש ב־WooCoommerce Product Tabs, ייתכן שתיתקל בבעיה שבה לשונית מוצר מופיעה בכל השפות, במקום להציג רק את לשונית המוצר הרלוונטית לשפה הנוכחית.

פתרון עוקף

ודא שיש לך גיבוי מלא של האתר לפני שתמשיך.


  • פתח את …/wp-content/plugins/woocommerce-product-tabs/src/Product_Tabs.php

  • בשורה 34, חפש את הפונקציה custom_woocommerce_product_tabs($tabs)

  • שנה את החלק הראשון של הפונקציה מהקוד הבא:
    public function custom_woocommerce_product_tabs( $tabs ) {
        global $product;
    
        $this->product_tabs_list = get_posts(
            [
                'post_type'      => 'woo_product_tab',
                'posts_per_page' => -1,
                'orderby'        => 'menu_order',
                'order'          => 'asc',
            ]
        );

  • לקוד הבא:
    public function custom_woocommerce_product_tabs( $tabs ) {
        global $product;
    
        $this->product_tabs_list = get_posts(
            [
                'post_type'      => 'woo_product_tab',
                'posts_per_page' => -1,
                'orderby'        => 'menu_order',
                'order'          => 'asc',
                'suppress_filters' => 0, // WPML workaround compsupp-7688
            ]
        );

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