Skip to content Skip to sidebar

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

Problem:
The client is using the Astra theme with WooCommerce and WPML for a multilingual site with English and German languages on separate domains. The 'Slide In Cart' feature works in English but not in German; instead of sliding in, the page reloads.
Solution:
We recommend the following steps to address the issue:
1. Navigate to the folder

.../wp-content/plugins/woocommerce-views/library/toolset/woocommerce-views/

2. Replace the file

Class_WooCommerce_Views.php

with the updated version available.
3. After replacing the file, check the functionality of the problematic products on the front end.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend opening a new support ticket. Additionally, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. For further assistance, you can also visit our support forum 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.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Osama Mersal 1 year, 1 month ago.

Assisted by: Osama Mersal.

Author Posts
May 23, 2024 at 8:51 am #15661504

Umberto Zanesi

Hi, I'm working with Astra theme, WooCommerce and WPML. I've 2 languages, EN and DE, they uses 2 different domains:

hidden link

hidden link

Astra theme Add to Cart button setting is set to "Slide In Cart" (this shows a sliding cart when the user click the Add to Cart button on product page).

It works fine in the primary language EN, but it doesn't work for the secondary language DE, it reloads the page.

I've recently spoken with Astra support, this their answer:

These headers need to be added to the response of the 'hidden link' endpoint.

If you're using Apache, you can add these headers to your `.htaccess` file:

<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "hidden link"
Header set Access-Control-Allow-Methods "POST, GET"
Header set Access-Control-Allow-Headers "Content-Type"
</IfModule>

However the CORS policy error won't affect the Add to cart functionality on secondary language, I suspect it's the issue how your secondary language is configured within WPML plugin. Have you tried to report the issue to WPML Support?

Can you help me?

May 23, 2024 at 12:44 pm #15663020

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

Please log in to this sandbox site and install the Astra theme. (hidden link)

After that, please try to replicate the issue. If it is replicable, please let me know how to reproduce it, so I can consult our compatibility team.

Best regards,
OSama

May 23, 2024 at 6:01 pm #15664810

Umberto Zanesi

Hi, thank you. I've installed Astra and Toolset. I've configured the sliding cart and I've created 3 products.

I've also created 2 Toolset content templates for a single product where I placed the Toolset a heading block for the title and the Toolset "Add to cart button" block. The template are identical the only difference is:

Template 1 - this template has a german translation

Template 2 - this template hasn't a german translation

I assigned Template 1 to Prod 1 – template 1

I assigned Template 2 to Prod 2 – template 2

I haven't assigned any template to Prod 3 Astra, it uses the default Astra template

What I noticed is that the sliding cart works fine for all the products in the EN version.

Then I found that it works fine for Prod 2 and Prod 3 Astra in the DE version, but it doesn't work for Prod 1 in the DE version.

You can see all the 3 products here:
hidden link

There is a bug related to the Toolset Template translated version.

cheers

May 24, 2024 at 10:33 am #15667191

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for replicating the issue. I'll consult our second-tier support team about this issue and update you as soon as they reply.

Please note that it might take some time due to the weekend.

Thanks for your cooperation and understanding

Best regards,
Osama

May 29, 2024 at 2:09 pm #15684433

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for your patience. Our compatibility team has found a workaround for the case. Please check the following steps:

1- Open the (Open .../wp-content/plugins/woocommerce-views/library/toolset/wocommerce-views/) folder
2- Replace the (Class_WooCommerce_Views.php) file with this one (hidden link)
3- Check the problematic products on the front end

I've applied the above steps to the sandbox site. Please check if the product works correctly. (hidden link)

Best regards,
Osama

May 29, 2024 at 3:28 pm #15684721

Umberto Zanesi

It works great!! thank you!!!

Will you include the fix in the next release?

cheers

May 29, 2024 at 3:33 pm #15684788

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

The Toolset team is aware of the issue and will work on a permanent fix, but I'm unsure if it will be added to the next release.

You are more than welcome. 🙂 Please don't hesitate to open a new ticket if you face any other issues. We are always happy to help you.

Have a great day!

Best regards,
Osama