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 thread is resolved. Here is a description of the problem and solution.

Problem: We have products which are regional products with separate SKUs. We used to use GEO IP location software but sorted our HREFLANG setup and now route without Geo IP. (this is important for our Google rankings) BUT - we have an issue.

Our issue is that someone in Canada (or outside their location/region) manages to add an SKU product from another country to their checkout - they then receive an error as they are trying to add a product to a region which is not allowed.

Solution: Go to Dashboard → WooCommerce → WooCommerce Multilingual → Settings tab, and select the Prompt for a confirmation and reset the cart option for Switching languages when there are items in the cart. This way, the users that are switching languages will no longer have the products from the other language in their cart (and won't be able to purchase them either).

Relevant Documentation: https://wpml.org/documentation/related-projects/woocommerce-multilingual/clearing-cart-contents-when-language-or-currency-change/

This topic contains 15 replies, has 2 voices.

Last updated by Radu 1 week, 3 days ago.

Assigned support staff: Radu.

Author Posts
October 8, 2019 at 9:49 am #4713715

matthewC-29

Tell us what you are trying to do?

We already have WPML.

We have products which are regional products with separate SKUs. We used to use GEO IP location software but sorted our HREFLANG setup and now route without Geo IP. (this is important for our Google rankings)
BUT - we have an issue.

Our issue is that someone in Canada (or outside their location/region) manages to add an SKU product from another country to their checkout - they then receive an error as they are trying to add a product to a region which is not allowed.

We DO NOT want to mirror the products in WPML, but simply prevent products from one language to exist in the cart of another. Is there any advice/options you can give???

October 9, 2019 at 9:26 am #4721187

matthewC-29

Hello?? Can anyone help...?
Thanks

October 9, 2019 at 11:54 am #4722361

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Matthew,

Thank you for reaching out the WPML support!

Sorry for this late reply. We have a bigger number of tickets these days but we're doing our best to take care of each one of them as quick as possible.

Can you go to Dashboard → WooCommerce → WooCommerce Multilingual → Settings tab, and select the Prompt for a confirmation and reset the cart option for Switching languages when there are items in the cart, please? This way, the users that are switching languages will no longer have the products from the other language in their cart (and won't be able to purchase them either).

Please give this a try and tell me if this is what you were looking for.

Thanks,
Radu

October 9, 2019 at 12:26 pm #4722735

matthewC-29

Hi Radu - thank you, i understand.

This is very important as we are getting complaints everyday ad losing business; so i do appreciate your attention on this 🙂

I do not have the Dashboard > Woo > WooCommerce Multilingual settings in WP.

I can see that maybe we need all the WPML plugins do this and all we have the following:
- WPML Multilingual CMS
- WPML Translation Management
(images attached)

We do not have 'WPML string translation' or 'WPML Media' - do we need to install these first?
If so, how do we install just those two plugins??

Thanks, Matt

October 9, 2019 at 1:50 pm #4723493

matthewC-29

That will not work because we do not want to mirror the products. Any ideas?

October 9, 2019 at 1:50 pm #4723523

matthewC-29

We have not installed all plugins as we do not want to mirror products.

October 11, 2019 at 8:05 am #4736275

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Matthew,

You need to install all the required plugins mentioned here https://wpml.org/documentation/related-projects/woocommerce-multilingual/#required-plugins even though you don't want to mirror the products. Each plugin has its own functionality and is needed in order to have the shop work in all the languages.

Can you install them, and check if the I mentioned previously (in Dashboard → WooCommerce → WooCommerce Multilingual) is now available, please? If this option is still missing, I'll need access to the dashboard so I can have a closer look at this issue, and see what's going on. But first, please install these required plugins, and let me know how this goes. I'll keep an eye on this ticket.

Thanks,
Radu

October 11, 2019 at 11:33 am #4737477

matthewC-29

Hi Radu,

OK thanks, we do need your help i'm afraid. I must stress how important it is though that you realise this is a live site and we cannot pull the site down or mess up the config preventing orders. I reiterate, we do not want to mirror products.

I can add you to our WP dashboard so you can assist better - but i need your email address to setup the user...?

Please let me know...
Matt

October 11, 2019 at 11:53 am #4737777

matthewC-29

Hi Radu - we have done this. (we worked it out)

(Dashboard → WooCommerce → WooCommerce Multilingual → Settings tab, and select the Prompt for a confirmation and reset the cart option)

It is now very difficult for us to test because we do not have vpn in those countries so we now have to sit and wait and see if we continue to get issues.

October 11, 2019 at 12:23 pm #4738089

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Matthew,

I'm really glad to hear that you found that option. I was looking at your previous reply right now.

You can test this out in the next few days and let me know things work now.

Tanks,
Radu

October 11, 2019 at 12:52 pm #4738363

matthewC-29

Hi Radu - so we can see it is working when visit the Canadian page from the uk - but the pop up which comes up is a white background with white text? Do you know where we change those settings?

October 11, 2019 at 1:42 pm #4739059

matthewC-29

And - the actual text which is shown to the web visitor is really badly written, makes verty littel sense. How do we change that text?

TEXT IN POP UP (as shown in attached)

"Switching language?
You've switched the language and there are items in the cart. If you keep the English (CA) language, the cart will be emptied and you will have to add the items again to the cart."

Please help us ASAP as this is a live site and not working until we fix this...

October 11, 2019 at 1:53 pm #4739217

matthewC-29

Radu??? Are you there??? (this is is urgent).... :-/

October 11, 2019 at 2:19 pm #4739521

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Matthew,

I know that this is urgent but I'm trying to take care of other tickets too. I'm trying to keep an eye on this one to make it work fine as soon as I can.

Now, regarding the white background, please add this CSS to your website:

.otgs-ui-dialog, .otgs-ui-dialog > * {
    background-color: black;
}

and the background should go black.

Regarding the text, this is a part of the plugin so the only way to change it is to do it inside the plugin. However, the change will be reverted when the plugin is gonna receive a new update.

If you want, you can give a try to this plugin https://wordpress.org/plugins/say-what/. As far as I can see, this might be doing exactly what you're looking for. Just simply use this text: You've switched the language and there are items in the cart. If you keep the %s language, the cart will be emptied and you will have to add the items again to the cart. as the original text and woocommerce-multilingual for the text domain.

Thanks,
Radu

October 11, 2019 at 2:24 pm #4739539

matthewC-29

That CSS worked - thank you, at least people can read it now 🙂

We will try and deal with changing the text now... have a great weekend.