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: Dupplicated product variations under single product Solution: Client solved it by going to: - WPML - > Support -> Troubleshooting: -- Synchronize post taxonomies for products Relevant Documentation:

This topic contains 11 replies, has 2 voices.

Last updated by rokJ 3 months ago.

Assigned support staff: Bruno Kos.

Author Posts
July 9, 2019 at 4:36 pm

rokJ

Hello,

I'm writing because from time to time we keep seeing duplicated variations under certain products when we edit their stock and save them. The same is visible also on the front end of the website (see attachments). After we see the issue on the front end and we resave the product again the problem goes away, but this is not a good solution since you don't always check the situation on the front end.

We've been using Woocommerce and WooCommerce Variation Swatches - Pro plugins to achieve this desired functionality, however we seem to have some issues when it comes to translations of those attributes as they are being duplicated.

There is no rule when and how it happens so it's a bit hard to explain this issue a little more.

When we built our website English was the default language, after that we added the second language (Slovenian) and now we've made the second language the default one. Even though we've changed the default language to Slovenian, English is still the default language for products when we want to edit them. What is important here is the fact that this same issue is not visible on the English language front end, just on Slovenian.

Please let me know what could be the reason of this as it's causing many problems to our web store and its customers.

Thank you.

July 10, 2019 at 6:00 am #4176241

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML support!

There is no rule when and how it happens so it's a bit hard to explain this issue a little more.

When we don't know the exact trigger of some issue, I'm afraid that we are unable to do much. However, there is an approach we could perhaps try:
- create a Duplicator package when there are no issues
- create another package once this happens
- if possible, note the last action which triggered this (I know this may be difficult, but we don't have any other way)

By having duplicator packages - one with a present issue and another one without it, our 2nd tier could have a look and check if there is something in database that would give us a clue what is behind this. But as I said before, when we don't know what's trigger some action, we cannot fix it easily (or at all) because we cannot trace debug logs of the exact moment when the bug happens.

However, you could perhaps try to "force" the issue by trying to emulate one of the actions you do on the site daily - is it perhaps a new product creation, the original product update, has as order been done or something else? It's

Regards,
Bruno Kos

July 10, 2019 at 11:40 pm #4184711

rokJ

Hi Bruno,

we have a staging site for test purposes which was created with the help of Duplicator. I made a copy of the website when the problem was still present and left it untouched for now so you can check it. The are 3 products right now that have some duplicated variables.

Please let me send you somehow the login credentials and other useful informations on private so you can make a test.

If it helps I can also send you a link with a database version where the problem is present and a version where the problem is solved after you make your tests (until that time I won't touch anything because resaving the problematic products makes the problem go away). Could this help?

Today I've noticed some other products with the same issue on our live site but still don't know what caused it. Clients said that those products weren't even edited in the last 24 hours. I can't think of anything else but our caching plugin which refreshes the cache every 10 hours.

July 11, 2019 at 9:01 am #4187661

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

I have marked your next reply as private, so you can add all this information inside ( WordPress credentials). Can you try the following then:
- Create a duplicator of the staging site ( our 2nd tier always need to have duplicators, because they are using their own tools for debugging that are usually not present on clients' servers)
- Try to see if you can "force" the issue from happening - we need to know the trigger, no matter how hard finding it that could be - try doing various things on the site, such as updating other products, creating new products, etc, because without this we are still helpless, since even if we can compare two databases, we still need to know what caused the change

On a side note, do you have some custom WooCommerce code or filters added to the theme or through any of the plugins?

I can't think of anything else but our caching plugin which refreshes the cache every 10 hours.

I assume that the staging site is not using this caching, correct? How about you observe both sites, assuming that both are clones - if this happens on one and does not happen in the other, maybe that's the culprit. Also, is there some other cron job present on the live site perhaps?

Regards,
Bruno Kos

July 11, 2019 at 4:58 pm
July 12, 2019 at 5:52 am #4195301

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

The issue is quite complex and all these troubleshooting functions also perform a set of various actions, so it would be difficult to determine what is the connection here. However:

and after the process finished all the duplicated numbers were gone (before there were 6 products with this problem)

After you have performed them now, do you think that it would make sense to wait to see if the issue is back again? If this happens, you would reply back to me and I would escalated the case to our 2nd tier for further inspections.

Let me know what you think!

Regards,
Bruno Kos

July 12, 2019 at 9:24 am #4197061

rokJ

Hi,

I agree with your suggestion and I'll reopen this ticket if the problem shows up again.

The only thing that still bothers me is when you enter the product edit screen and want to edit the attributes under the variations tab, the variable numbers are all doubled now and keep being like this even after you save or change anything. Got an idea what could cause this?

This is happening on all the products that are already on the website (IMPORTANT! - we've imported them from Shopify in the middle of the development process with a plugin called WooCommerce Shopify Importer and this maybe messed things up in the database), but on the other hand it doesn't happen when I create a new product, in this case there are no doubled attributes.

Waiting for reply.

Best regards,
Rok

July 12, 2019 at 11:30 am #4198061

Bruno Kos
Supporter

Languages: English (English )

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

Hi Rok,

but on the other hand it doesn't happen when I create a new product, in this case there are no doubled attributes.

This would definitely indicate that something went wrong during the migration, especially since you're not able to reproduce this issue and I have not found a single report in our databases about the issue.

It might be that sometime during the migration, double entries for variations were created in database and they need to be cleared (if I'm not mistaken, every variation is in fact a separate product in WooCommerce database tables, but they are linked somehow).

I am curious about one thing - as you know, you can create variations based on attributes which you can define in the following ways:
- adding them directly on the product pages while creating variations
- adding them here - Products -> Attributes, and then use these to create variations

Do you see duplicated Attributes on Products -> Attributes perhaps?

Maybe you check inside the database if there are multiple attributes assigned to those products also (according to product ID). However, due to complexity of how this data is managed, perhaps if you only have 6 products that are affected, you could consider re-creating them anew (and if the client agrees).

Regards,
Bruno Kos

July 12, 2019 at 12:11 pm #4198375

rokJ

Hi,

no, I have never seen any duplicate on Products -> Attributes, even though all our attributes were created there. The only thing is that attributes in both languages have the same name, in our case numbers. Size is the only attribute we're using.

I could create new products for the problematic ones, but at the moment this is not the solution. Today I've seen on the live site a new product with this problem, however there we have not perform the Synchronize post taxonomies for products and variations yet.

Another interesting thing is that when we performed the Synchronize post taxonomies for products and variations on the staging website, the number of attributes for both languages almost syncronized (first number is for the English website, second for Slovenian). For comparison you can see the live website count which seems much more out of sync.

July 15, 2019 at 7:11 am #4207611

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

I guess that it would make sense to try syncing on the live site? 🙂 Or is there a reason why you didn't yet (or it didn't work?)

Regards,
Bruno Kos

July 15, 2019 at 8:31 am #4208251

rokJ

Hi,

we did it on the live site too and it synced the numbers between languages completely so that's ok.

Now the only visible issue remains the doubled attributes on the product edit screen (on the live website). I've reported this a few days ago for our staging website but now this is not present anymore there so I guess it has to refresh on the server or something like that?

Thank you for your help.

July 15, 2019 at 11:02 am #4210109

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

I've reported this a few days ago for our staging website but now this is not present anymore there so I guess it has to refresh on the server or something like that?

I am not sure where these are coming from, but perhaps:
WooCommerce -> Status -> Tools:
-- clear transients
-- delete orphaned versions
-- term counts

Also:

- WPML - > Support -> Troubleshooting:
-- Clear the cache in WPML
-- Fix terms count

Regards,
Bruno Kos

July 21, 2019 at 10:33 am #4252089

rokJ

Hi,

seems like the syncronizations did the job and the problem didn't show up again until now. I'll mark the issue as resolved.

Thank you for your support.