Skip Navigation

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

Problem: the translation of the product is displaying an incorrect matching price in WooCommerce booking.

Solution: Set "block_cost" to "copy" in WPML > settings > Custom field translation and you will avoid this.

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 14 replies, has 2 voices.

Last updated by Alejandro 1 year, 7 months ago.

Assigned support staff: Alejandro.

Author Posts
January 15, 2019 at 7:25 pm #3094534

shaneB-8

What happened:

Products were setup using Woocommerce Bookings plugin, whereby a customer is able to book a specific item. In one case, the translation of the product was displaying an incorrect matching price. (Seen here hidden link vs hidden link).

On the live site, I modified the translation to resync it and evidently after several attempts the translation was lost. I have no clue why. I recreated the translation, and it was resynced.

The actual issue:

For some reason it appears as though the bookings in other languages are not properly sync'd afterwards. In the calendar on the English version (French is the primary language) it normally marks non-available items. In French this was accurate but the _new_ English translation was not correct.

Temporary solution:

I had to go through and re-add all the previously entered bookings, and modify all the orders to resync that. It would appear some glitche whereby WPML is caching the translation in order for this ajax calendar to work? Or there is some other issue?

Link to a page where the issue can be seen:

hidden link

I expected to see:

1) The prices matching properly
2) The calendars to match

Instead, I got:

1) Unmatching prices, and then a lost translation
2) Unmatching calendars until manually modifying everything

Additional:

I already logged this issue with Woocommerce, but they told me that's it is an issue relating to WPML rather themselves and indicated I had to report an issue with you.

January 15, 2019 at 7:26 pm #3094537

shaneB-8

If you think that someone else is more versed with Woocommerce feel free to pass the ticket to someone else. I just figured since you were already working on additional tickets regarding the same site it would make more sense.

January 16, 2019 at 5:05 pm #3098686

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

You mention the booking plugin works with AJAX, Could you check WPML > Settings > Language filtering for AJAX operations > is "Store a language cookie to support language filtering for AJAX" enabled?

WPML does have a cache but it shouldn't affect your plugin, yet you could try emptying it in WPML > Support > Troubleshooting > Clean Up > Clear WPML cache.

By the looks of it it seems that everything's related to this "On the live site, I modified the translation to resync it and evidently after several attempts the translation was lost. I have no clue why. I recreated the translation, and it was resynced."

Could you please elaborate on what and where you did this?

Thanks in advance.

January 16, 2019 at 8:24 pm #3099364

shaneB-8

> You mention the booking plugin works with AJAX, Could you check WPML > Settings > Language filtering for AJAX operations > is "Store a language cookie to support language filtering for AJAX" enabled?

Already set yep

> WPML does have a cache but it shouldn't affect your plugin, yet you could try emptying it in WPML > Support > Troubleshooting > Clean Up > Clear WPML cache.

I tried that and the price is still incorrect

> On the live site

Essentially, the dev site in question is a duplicate so we can easily use this to reproduce what I did. There is still two issues though since the price should be exactly the same. I could upload this site for you if you wish...

What I did in this case was the following:

1) Edit the original product in question
2) Click the edit translate link
3) Save the translation again (thinking this would sync hte prices perhaps)
4) Reloaded the page and the translation had deleted itself
5) Created a new translation
6) The price MATCHES
7) Noticed that all the bookings are no longer matching

January 17, 2019 at 11:50 am #3101686

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Yes we can use the cloudways server, please proceed to upload this site.

I'll use the steps you mentioned above. Before you upload the site, disable the Ajax cookie option in WPML > Settings > Language filtering for AJAX operations. and see if that helps as well.

If it doesn't then let me know and i'll proceed troubleshooting the problem.

Thanks.

January 17, 2019 at 2:06 pm #3102317

shaneB-8

Unfortunately, that didn't make a difference. The price is still incorrect. You'll have to create a new cloudways so that I can upload the site for you to checkout.

January 17, 2019 at 6:08 pm #3103364

shaneB-8

Okay thanks! I have uploaded the site so feel free to modify and test out teh issues that I have been outlining.

The issue in question is this product - hidden link
And the English version which does not have the correct price - hidden link

Let me know if there are any other questions.

January 21, 2019 at 4:47 pm #3113286

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,
I Managed to reproduce the problem and i believe it's fixed now.

On my side when i tried to make a booking of just 1 day, for example i got a 70$ in the French version and only 60 in the English version.

Now, this wasn't really an error, it was more of a configuration issue (it seems), The price was actually 60 but it added a 10$ extra cost that came from the "occupants" person type ("persons" type).

I set this setting (block_cost) to "copy" in WPML > settings > Custom field translation and i can now see the same price in both languages (70 for 1 night).

Is this what you want to achieve?

January 22, 2019 at 6:12 pm #3117814

shaneB-8

Okay I can see that setting is not being copied and yes it does work now. In general, I would say that we could close this although the second issue that came about from the fiddling around I believe is important (mainly from a broader bug perspective). Somehow the translation was deleted (perhaps we could do that manually) and then recreated which caused the entire system to be synchronized improperly. Thoughts?

January 23, 2019 at 8:22 am #3119298

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

You said:
"On the live site, I modified the translation to resync it and evidently after several attempts the translation was lost. I have no clue why. I recreated the translation, and it was resynced."

I guess that what you did here was add a change to the original language page and then update its translation. but in this case, you mean that after several times of doing this (change original + update translations) the ENTIRE translation got lost, right?

Could you give me more details on this process? I'd need to know if this would happen with or without the booking plugin but to do that i'd first need to know what exactly did you do (i'd need to recreate it in order to send it to our compatibility team).

January 23, 2019 at 1:12 pm #3120683

shaneB-8

Yes after several modifications the translation was lost. I quote was written improperly. What happened was that the translation was no longer in sync. We could actually test this out with the test site without much difficulty I suspect. Or alternatively simply delete the translation and create a new one, and see how the actual translation is no longer syncing. I think that is probably a more evident situation.

Although prior to doing that I would need to add some bookings that are pre-made to recreate the same as live.

January 23, 2019 at 1:14 pm #3120690

shaneB-8

What I did:

1) Used the translate button saved it
2) Tested the product and noticed that it was not sync'd properly price wise
3) Repeat step 1 until lost
(Note: It is possible that at some point I edited the actual translated product without the translator to see if the price was matching, and it is possible that at that point I might have modified the price. My guess is that is what happened and then the translation was lost afterwards)

January 23, 2019 at 3:31 pm #3121279

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Would it be possible for you to create a video and show me the issue (with a tool like "Loom"), these sort of issues are very difficult to replicate and a video would definitely go a long way.

Thanks in advance.

January 31, 2019 at 9:02 pm #3149686

shaneB-8

Your request is totally fair. Since I have upgraded all the plugins it seems it's harder to actually edit the actual translated node, which is probably a good thing. I cannot reproduce this behaviour without doing that. Essentially, after modifying the node several times it became decoupled from the original French source.

Then all the bookings that had been associated to the English version were not correct. Anyway, I think I was more pointing it out for you folk to determine how you are obtaining the translation ID for the products. It would seem this is being stored somewhere, which if it weren't I probably wouldn't have discovered this decoupling.

Long story short: I can seem to reproduce it so we can close this issue but I wanted to maybe give you a heads up in case there might be something relevant to pass to the developers.

February 1, 2019 at 7:38 am #3150577

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello, thanks for the heads up. i made a small not and if i see this again, i'll definitely use this ticket as a reference!