Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is using the Blocksy Theme with WooCommerce and is unable to translate additional product tabs created by a pro feature of the theme. These custom tabs do not appear in the Arabic version of the product page, while standard WooCommerce product tabs do.

Solution:
1. Navigate to the

app/public/wp-content/plugins/blocksy-companion-pro/framework/premium/extensions/woocommerce-extra/features/custom-tabs/feature.php

file.
2. Replace the code snippet around line 139 with:

$all_products_tabs = get_posts([
    'numberposts' => -1,
    'post_type' => $this->post_type,
    // WPML Workaround for compsupp-7255 - PART 1
    'suppress_filters' => false
]);

3. Navigate to the

app/public/wp-content/plugins/blocksy-companion-pro/framework/features/conditions/rules-resolver.php

file.
4. Inside

ConditionsRulesResolver::resolve_single_condition()

, replace the code snippet around line 364 with:

// WPML Workaround for compsupp-7255 - Part 2
if ( class_exists('Sitepress') ) {
    $rule['payload']['post_id'] = apply_filters( 'wpml_object_id', $rule['payload']['post_id'], get_post_type($rule['payload']['post_id']) , TRUE  );
}

if (
    isset($rule['payload'])
    &&
    isset($rule['payload']['post_id'])
    &&
    $post_id
    &&
    intval($post_id) === intval($rule['payload']['post_id'])
) {
    return true;
}

We tested this solution on a clean installation and it worked. We recommend you try it on your installation and let us know the results.

Errata: https://wpml.org/errata/blocksy-theme-translated-product-tabs-displayed-in-original-language/

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If necessary, please open a new support ticket with us.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 7 replies, has 2 voices.

Last updated by tareqA-6 8 months ago.

Assisted by: Christopher Amirian.

Author Posts
March 9, 2024 at 2:48 pm

tareqA-6

I am using Blocksy Theme and WooCommerce for my online store. This theme has a pro feature for creating additional product tabs by creating a separate post for each tab.
I have not been able to use WPML to translate those extra Product Tabs. They just don't show on my Arabic version of the page. The standard WooCommerce Product tabs do show and translated

March 9, 2024 at 3:40 pm
March 9, 2024 at 4:32 pm #15391712

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

Thank you for following the steps mentioned in the chat.This seems to be a compatibility issue between the Blocksy theme and WPML.

To be able to report the compatibility issues we need to replicate the issue on a clean installation.
I created a clean installation of WordPress, WPML, and all necessary WPML add-ons.

I also installed Woocommerce and setup Woocommerce Multilingual and set it up. I also added a few sample products.

You can access the WordPress dashboard using the link below:

hidden link

Kindly follow the steps below:

- Install Blocksy theme.
- Install the necessary plugins for Blocksy theme.
- Try to replicate the issue.

This will help us to report the probable issue to the compatibility team and solve the possible problem faster.

Thank you.

March 9, 2024 at 5:23 pm #15391751

tareqA-6

Hello Christopher. I can follow the required steps except for enabling the Product Tab feature because it is a PRO/PAID feature on Blocksy theme. I have already used my license with Blocksy on my own site to enable Product Tabs. I don't know how to reproduce the issue of Product Tabs on the site you sent me!!!

March 9, 2024 at 5:29 pm #15391758

tareqA-6

While researching the problem, I came across this article:

https://wpml.org/documentation/woocommerce-extensions-compatibility/translating-woocommerce-tab-manager-woocommerce-multilingual/

If using Yith WooCommerce Tab Manager is fully compatible with WPML, I can use it instead of the Pro feature of Blocksy Theme since Yith WooCommerce Tab Manager is a free plugin.

I am saying that if and only if we cannot reproduce the Product Tab issue on the site you sent me for the reasons mentioned previously.

March 9, 2024 at 6:59 pm #15391858

tareqA-6

Hello Christopher. I managed to reproduce the issue on the website you sent me. When you click on the Shop Menu, you will find two products, Bone Renewal and Rapid Resuce. I translated the contents of the two products and then created two 3 Custom Tabs. The first custom tab was labeled WARNING! with instructions for all products and was assigned to the two products. The second custom tab was labeled SUGGESTED USE with instructions for Bone Renewal and was assigned to the product Bone Renewal. The third custom tab was labeled SUGGESTED USE with instructions for Rapid Rescue and was assigned to the product Rapid Rescue.

As you can see, we got the same problem on the Arabic page. The custom tab with the label WARNING! was not translated and the custom tab with the label SUGGESTED USE did now show up at all.

Bone Renewal Custom Tab-English.png
Bone Renewal Custom Tab-Arabic.png
March 10, 2024 at 1:08 pm #15392561

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

Thank you very much. I reported this to the compatibility team already.

I will get back to you as soon as I have an answer.

Thanks.

March 16, 2024 at 6:40 am #15416335

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

I have an answer from the second tier support:

- Open the app/public/wp-content/plugins/blocksy-companion-pro/framework/premium/extensions/woocommerce-extra/features/custom-tabs/feature.php file
- Replace the following snippet around line 139:

$all_products_tabs = get_posts([
	'numberposts' => -1,
	'post_type' => $this->post_type,
]);

- With:

$all_products_tabs = get_posts([
	'numberposts' => -1,
	'post_type' => $this->post_type,
	// WPML Workaround for compsupp-7255 - PART 1
	'suppress_filters' => false
]);

- Open the app/public/wp-content/plugins/blocksy-companion-pro/framework/features/conditions/rules-resolver.php file
- Inside ConditionsRulesResolver::resolve_single_condition(), replace the following snippet, around line 364:

if (
	isset($rule['payload'])
	&&
	isset($rule['payload']['post_id'])
	&&
	$post_id
	&&
	intval($post_id) === intval($rule['payload']['post_id'])
) {
	return true;
}

- With:

// WPML Workaround for compsupp-7255 - Part 2
if ( class_exists('Sitepress') ) {
	$rule['payload']['post_id'] = apply_filters( 'wpml_object_id', $rule['payload']['post_id'], get_post_type($rule['payload']['post_id']) , TRUE  );
}

if (
	isset($rule['payload'])
	&&
	isset($rule['payload']['post_id'])
	&&
	$post_id
	&&
	intval($post_id) === intval($rule['payload']['post_id'])
) {
	return true;
}

I tested the solution on the clean installation and it worked:

hidden link

I'd appreciate it if you can test it on your installation and get back to us with the result.

Thank you.

March 19, 2024 at 9:38 am #15425012

tareqA-6

Hello Christopher,

Yes, this code resolved my issue fully and satisfactorily. My Blocksy Premium Custom Tabs are working smoothly and translating them has become as easy as translating anything using WPML/WCML.

Many thanks to you and to your team for your help and high professionalism in attending to my request and solving my problem.

Have a nice day 🙂

Tareq Alamoodi