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 Riffaz 6 months, 1 week ago.

Assigned support staff: Riffaz.

Author Posts
April 2, 2019 at 1:00 pm #3517311

rikkeL

I have a customer who is using WPML for translations, and she is using the Polo theme (hidden link)

The product carousel in the theme does not display products in the correct language.

hidden link (Se vores produkter) - is sometimes showing the english products in the product slider
hidden link (See all our products) - is sometimes showing the Danish version of the product slider

We have tried contacting the theme developers, but they told us that it is a WPML problem.

April 3, 2019 at 4:30 am #3522571

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for contacting WPML support.

I could not find the polo theme in our compatibility list : https://wpml.org/documentation/theme-compatibility/

Anyhow, if the theme follows the standard procedure of WooCommerce and WordPress and then its should be translated correctly.

Since it's a new for us it might be a bug or need to do something in code level.
To confirm this we have to check / reproduce this in a fresh installation.

please:
1. go to hidden link
2. install your theme
3. configure the WPML as you have it in your site. at the last steps just click next (sitekey)
4. create only two products. one for main language and another one for another language
5. recreate the issue with the carousel.
6. let us know how to check this. please explain with screenshots and URLs for better understanding.

Regards,

April 9, 2019 at 6:08 pm #3569923

rikkeL

Hi,

I am sorry for the late response, it was more difficult to get the theme installed, than we thought it would be.

We have now created two products, translated these to Danish.

Test 1 - English (sorry for the text being in Danish, but it shouldn't matter in order to see the difference): hidden link
Test 2 - English: hidden link

Test 1 - Danish: hidden link
Test 2 - Danish: hidden link

We have added the Polo Product Carousel to the front page, and translated this into Danish:
English: hidden link
Danish: hidden link

Both of these displays the Danish versions of the products.

Best regards,
Rikke

April 10, 2019 at 2:56 pm #3577591

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for this.

I escalated this to our second tier.
Please be patient till we get back to you.

Regards,

April 14, 2019 at 6:39 am #3607065

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

the problem is here:
wp-content/plugins/polo_extension/visual-composer-addons/woocommerce/product-slider.php line 157

            if ( false === ( $the_query = get_transient( 'crum_product_slider_transient' . $transient_id ) ) ) {

                $the_query = new WP_Query( $args );

                set_transient( 'crum_product_slider_transient' . $transient_id, $the_query );
                $this->update_id_option( $transient_id );
            }

the addon plugin gets the products from the slider using transients (which WPML can't translate so far). If the transients are set, it uses them. If not, it queries again.

As a workaround, we can add after that piece of code the following:

            
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
                $the_query = new WP_Query( $args );

                set_transient( 'crum_product_slider_transient' . $transient_id, $the_query );
                $this->update_id_option( $transient_id );
            }

You can check the workaround works fine here:
English: hidden link
Danish: hidden link

If you are not sure about this you can show this reply to your theme support.

Let me know how it goes.

Regards,

April 16, 2019 at 7:15 am #3618787

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Also, you can sow them this:

there is a simpler way of resolving this:

transients are stored in

wp_options

every option has a filter option_xxxxxxxxxx
so in theory you could add this code to, for example, functions.php in the theme:

add_filter( 'option_crum_product_slider_transient', '__return_false' );

this way, the transient is always recalculated because it always returns false.

Regards,

April 16, 2019 at 7:24 am #3618869

rikkeL

Thank you so much for all your help. As a first we are trying to get the theme developers to implement the change, otherwise, we will have to do it ourselves.

I will let you know when we have the issue fixed, and thank you once again for absolutely great and fast support - I wish everybody was as helpful as you guys 🙂

April 16, 2019 at 7:26 am #3618901

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

You are welcome.
I am updating the ticket status.

Regards,