Skip Navigation

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

Problem:
The client was experiencing issues with product variations not displaying correctly on the Danish version of their WooCommerce site. The variations would either not show up or become inconsistent upon page refresh. The problem seemed to be related to a plugin conflict and the use of special characters in attribute names.

Solution:
1. We recommended deactivating all plugins except for WooCommerce, WooCommerce Multilingual, and WPML-related plugins to identify a plugin conflict. Upon reactivating plugins one by one, we found that the 'Matting Webshop' plugin was causing the issue.

2. We suggested reviewing the code of the 'Matting Webshop' plugin or contacting the plugin developer for further assistance.

3. For products with only one variation showing, we advised deleting the Danish translation of the product (ensuring it's also cleared from the Trash) and then re-translating the original product into Danish.

4. We noticed that the attribute 'Svart' was added twice and recommended setting up variations for both attributes and updating the translation.

5. We enabled 'Language filtering for AJAX operations' in WPML > Languages, set the translation preference for fields starting with 'attribute_' to 'Translate' in WPML > Settings > Custom Field Translation, and updated the translation after adjusting the default product's attributes and variations.

6. We identified that using a slash ('/') in attribute names caused issues and recommended replacing it with a different character, such as a pipe ('|'), before re-translating the product into Danish.

If you're experiencing similar issues, we recommend trying the steps above. However, the solution might be irrelevant due to being outdated or not applicable to your case. If these steps do not resolve your issue, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, please do not hesitate to open a new support ticket.

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 21 replies, has 3 voices.

Last updated by petterH 1 year, 1 month ago.

Assisted by: Prosenjit Barman.

Author Posts
February 16, 2024 at 4:12 am #15309911

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for the update.

After adjusting the changes listed below, the Variations for the Danish product continued to display correctly, even after multiple refreshes:

- Activated the "Language filtering for AJAX operations" by navigating to WPML > Languages.
- Proceeded to "WPML > Settings > Custom Field Translation" and changed the translation preference for the field starting with "attribute_" to "Translate"
- Adjusted the Attribute and variation for the default product, saved the changes, and updated the translation accordingly.

Please check now and let me know if you need further assistance in this matter. I will be happy to help.

Best regards,
Prosenjit

February 16, 2024 at 8:07 am #15310296

petterH

Great, it seems to work so far!
I will let the client check before closing down, back soon!

February 19, 2024 at 8:22 am #15316298

petterH

Hi again,

We still have issues with the variations on Danish... On the Valencia product it did work at first, but now the re-appeared and the pre-selected variation was not properly configured on the Danish version when I checked the details. When I remove the product re-translate it shows fine on the first load, but the next time I re-load the page the variations become messed up again. Pretty much the same problem we had before. Seems to jump back every time the translation has been updated and the page is re-loaded.

The product Choice Imola Plus also has issues where the variants are not correctly created and the product image for the main product is not added. I added it manually, and then the main image shows, but the variants get messed up... When I updated translation the variants re-appeared, but the image for one of the variants disappeared. I added it manually, then variants disappeared. I updated translation and it worked again... So seems ok for now.

It seems something has gone wrong with the Danish that makes these conflict appear here an there. It would be comforting for the client if there was a solution to why all this is happening and if there is anything we could do about it.

February 20, 2024 at 4:29 am #15320489

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for the update.

I examined the "Valencia" product and noticed the issue. During my investigation, I discovered that if I prevent a WooCommerce script(add-to-cart.min.js) from loading on the frontend using the Browser's developer tools, the pre-selected attribute remains after a page refresh, although the images do not update accordingly.

Disabling the script, given that it's a fundamental part of WooCommerce, isn't a viable long-term solution. Therefore, I've made a copy of your site for further examination in my development environment. This approach will also allow me to potentially escalate the matter to our second-tier support team if necessary.

I will keep you updated as soon as I have more information regarding this issue. Thank you for your patience and understanding throughout this process.

Best regards,
Prosenjit

February 20, 2024 at 8:00 am #15320796

petterH

Thanks for investigating further!

Looking forward to hear from your examination 👍

February 21, 2024 at 2:40 pm #15328785

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for being so patient.

I wanted to provide you with an update following our thorough investigation into the issue at hand. The root cause of the problem is linked to the use of the slash ("/") character in the names of certain attributes, specifically instances like the "Bordsfot/Klämfäste" attribute.

When I replaced the slash in the attribute name with a pipe symbol ("|") in the default product setup and retranslated the product into Danish, the issue with the default selected variable no longer happened.

Please check this product: hidden link

It appears that the encoding of special characters, such as slashes, in URLs or scripts may vary in the Danish version of the site. The inclusion of such characters has led to inconsistencies, resulting in the attributes not behaving as expected when the page is refreshed.

If a slash has been used in the name of any attribute on any of your products, please replace the slash with a different character or delete it. After making this adjustment, please re-translate the product into Danish. This change should help prevent the issue from recurring.

Please let me know if that helps or if you need further assistance. I will be happy to help.

Best regards,
Prosenjit

February 21, 2024 at 2:51 pm #15328845

petterH

Great that you found the cause! I will check with the client if this solves all the remaining issues and get back as soon as possible!