WPML
Status
Resolved by author
Related plugin/theme
Woocommerce Product Tabs
Topic tags
Compatibility, WCML

Overview of the issue

If you are using WooCoommerce Product Tabs, you might encounter an issue where a product tab appears in all languages, rather than displaying only the product tab relevant to the current language.

Workaround

Please, make sure of having a full site backup of your site before proceeding.


  • Open …/wp-content/plugins/woocommerce-product-tabs/src/Product_Tabs.php

  • In line 34 find the function custom_woocommerce_product_tabs($tabs)

  • Change the first part of the function from:
    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',
            ]
        );

  • To:
    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
            ]
        );

All known issues →