[Waiting for user feedback] Can't sort translated product by price
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.
Our wait time is higher than usual, please make sure you are meeting the minimum requirement - https://wpml.org/home/minimum-requirements before you report issues, and if you can take a look at current Known Issues - https://wpml.org/known-issues/. Thank you.
Background of the issue:
I'm trying to sort translated products by price on my website. The issue can be seen on this page: hidden link. I expect to see translated products ordered by price, similar to this page: hidden link.
Symptoms:
Instead of seeing the products sorted by price, I got unsorted products. I have the same result in the dashboard when sorting french or spanish products (original language, english, works fine).
Questions:
Why are the translated products not sorting by price?
Is there a setting in WPML that affects product sorting?
I apologize for the delay in responding. I will take care of this ticket; the reply time will be shorter now.
Let me summarize my understanding of the problem:
- You translated your products using the "duplicate" feature of WPML
- At this point, all is OK; sorting by price works in original and translated languages (do you use Multicurrency?)
- As soon as you edit an original product, as expected the translation is synched but the order by product does not work anymore as expected in the translations
Is this the issue? Please confirm, and I'll reproduce it from scratch to confirm the bug.
So.. First point is ok but not the second one.
The issue is that all products are sorted correctly on original languages but not on the translated ones. We just duplicated the products without any change from a language to another. We used wpml to do it.
2 informations :
1- We thought, product would sync from original to translated but if we go in wpml > translation management, we can see that products need update. We would like to avoid having to do this.
2- We never changed the prices, so even if those products need update, they should be well sorted by price.
We tried to sort them in the admin dashboard and on the front office, with our theme and with a default wordpress one and without all plugins deactivated. Sorting never works.
We just released a new version of WCML, can you please give it a try?
❌ Please make a full website backup before proceeding ❌
I tested it from scratch and couldn't reproduce the issue with it.
If it's still happening on your site, can you please log in to my testing site and see if you can reproduce it there? I think I followed the steps you described, but I may be wrong.
You can access it by following this link: hidden link
Hello, so I've update staging, production and it hasn't been fixed. I tried yours and I see it's working. Nevertheless, the staging site (you have the access in the first message) should work since all plugins are deactivated and the theme is a default one.
Can we try fixing this on the staging site ? I suspect an issue that happened with a previous version of the plugin and now all the products or something else is buggy. Since it's working on yours, it should be working on the staging site.
You can do whatever test you want on the staging, that's fine for us. Maybe something that could sync again all the products and make sur they're all synced ? But then again, prices haven't been changed, so I don't suspect a syncing issue.
I translated the shop page and noted the wrong order by price. I re-sent to duplicate a few products that weren't in the right place, and that fixed it for those products.
So, re-duplicating seems to fix the issue.
On the other hand, I am wondering why you are duplicating all the products. The "Fallback Untranslated Content to Default Language" is not a suitable option for your use case. If it is, I suggest deleting all the translated products and setting it.
I also set to run the WCML troubleshooting options: WooCommerce > WooCommerce Multilingual & Multicurrency -> Settings (tab) -> Troubleshooting (bottom right of the page). This may solve the issue without the need to duplicate the products again. But it's taking a while.
I'll check if it's done by the end of my working hours, but if not, let's continue on Monday.
To sum up, the options seem to be:
- Duplicate again
- Switch to Fallback Untranslated Content to Default Language
- See if the WCML Troubleshooting actions fix the problem
Hello !
and thank you for your tests. So, to answer your questions :
- Duplicate again
-> I would like to not have to do this. we have a lot of products, it will take a while. And they should be synced. Can we fix this ?
- Switch to Fallback Untranslated Content to Default Language
-> Because of how wpml works, I can't do this. We need tu duplicate the product for them to be available when searching or filtering products. No plugin can work without this. In my opinion, that's too bad because it takes place in the database and other things. It should be working without this but that's the only option wpml gave me a while ago.
- See if the WCML Troubleshooting actions fix the problem
-> I can but still the idea is not to have to do this everytime, especially if that takes that long. Any other solution ?
I understand that the options that take too long are not a good solution. But I expect that they will need to be done only once. The issue does not happen on the test site, so that's the expected behavior.
If it happens again, we will need to check your specific setup to understand what's causing the unexpected behavior.
I already tried WCML Troubleshooting actions on your staging site, so if the issue persists, there's no need to do it again.
About re-duplicating. According to my tests, duplicating a product again places it in the correct order by price. It seems that there is no need to delete the products before. I suggest double-checking with a few products before doing it for all.