Skip Navigation

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

Problem:
The client was experiencing an issue where after translating a layout page to 100% using WPML, the gear icon remained, indicating that the translation was not marked as completed.
Solution:
Initially, we suggested making a minor edit in the default language and updating it, followed by clearing the WPML cache and synchronizing jobs and translators via WPML->Support->Troubleshooting. When this did not resolve the issue, we requested temporary access to further investigate. Upon reviewing the ATE error logs, we identified a conflict with the Woodmart theme specifically related to translating product layouts. We directed the client to contact Woodmart support with the specific error for resolution. Meanwhile, the Woodmart support team suggested adding the following code to the

functions.php

file in the client's child theme:

add_action( 'woocommerce_before_template_part', function () {<br />    global $product;<br />    if ( wp_is_json_request() && ! $product ) {<br />        $random_product = new WP_Query(<br />            array(<br />                'posts_per_page' => '1',<br />                'post_type'      => 'product',<br />            )<br />        );<br /><br />        while ( $random_product->have_posts() ) {<br />            $random_product->the_post();<br />            $product_id = get_the_ID();<br />        }<br /><br />        wp_reset_postdata();<br /><br />        $product = wc_get_product( $product_id);<br />    }<br />});

After implementing this code and clearing the cache, the issue was resolved.

Please note that this solution might be outdated or not applicable to your specific case. If the problem persists, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If needed, do not hesitate to open a new support ticket at WPML support forum.

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 Bobby 1 month, 1 week ago.

Assisted by: Bobby.

Author Posts
October 9, 2024 at 6:25 pm #16272003

davoodB

Background of the issue:
I am encountering an issue with WPML on my website. I am trying to complete the translation of a layout page to 100%.

Symptoms:
After completing the translation of a layout page to 100%, the gear icon remains, instead of marking the translation as completed.

Questions:
Could you please help me resolve the issue with the translation status not updating?

October 10, 2024 at 7:30 am #16273157

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi there,

Please edit the layout in the default language, make a small edit, and update.

Once finished try the translation and let me know your results.

if the issue persists, go to WPML->Support->Troubleshooting and click on the following:

- clear the cache in WPML
- Synchronize local job IDs with ATE jobs
- Synchronize translators and translation managers with ATE

Let me know your results, please.

NOTE: Always have a recent and working backup before making any changes recommended by our team or a 3rd party

October 10, 2024 at 8:27 am #16273377

davoodB

Hi Bobby,

Thank you for your suggestions. I followed the steps you provided, but unfortunately, the issue persists. The translation status is still stuck in progress with the gear icon showing.

Could you please advise on further steps to resolve this?

Best regards,
Dave

October 11, 2024 at 7:03 am #16277712

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

October 14, 2024 at 8:19 pm #16287804

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for the access details! I will update you as soon as I have some results!

October 15, 2024 at 7:49 pm #16292534

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

In the ATE error logs I was able to locate this error

Call to a member function get_gallery_image_ids() on null /home/u160632271/domains/gisoojewels.ch/public_html/wp-content/themes/woodmart/woocommerce/single-product/product-image.php:27

This points to a known issue with Woodmart and Product layouts, see here:
https://wpml.org/errata/woodmart-fatal-error-when-translating-product-layouts/

Please contact Woodmart support, provide the above error, and let them know that you are not able to translate the Single product Layout, their team should know how to resolve this from their side as the issue resides in their code.

We had another client that resolved this through Woodmart's team.

Let me know your results, please.

October 21, 2024 at 9:25 am #16311202

davoodB

Hi Bobby,

I reached out to the Woodmart team, and their initial suggestion was to navigate to Theme Settings → Single Product and assign the relevant product as shown here: hidden link. I cleared the cache and rechecked the issue, but unfortunately, it didn’t resolve the problem.

I’m now waiting for their further action. I'll update you soon.

Best regards,
Dave

October 21, 2024 at 6:51 pm #16314127

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for the updated Dave, let us know their feedback and if there is anything we can do from our side if needed.

October 23, 2024 at 9:50 am #16321136

davoodB

Hi Bobby,

Just a quick update:
The Woodmart support team provided a solution, which involved adding the following code to the functions.php file in my child theme:

add_action( 'woocommerce_before_template_part', function () {
global $product;
if ( wp_is_json_request() && ! $product ) {
$random_product = new WP_Query(
array(
'posts_per_page' => '1',
'post_type' => 'product',
)
);

while ( $random_product->have_posts() ) {
$random_product->the_post();
$product_id = get_the_ID();
}

wp_reset_postdata();

$product = wc_get_product( $product_id) ;
}
} );

After clearing the cache, the issue was resolved. Everything is working fine now!

Best regards,
Davood