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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - |
- | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - |
Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)
Tagged: Custom Work
This topic contains 33 replies, has 3 voices.
Last updated by Long Nguyen 1 year, 9 months ago.
Assisted by: Long Nguyen.
Author | Posts |
---|---|
August 7, 2023 at 12:51 pm #14163841 | |
philippH-28 |
Hello, I am not sure what you have done since the staging site is now totally broken and only displays a white page, so I cannot verify it again, but I had switched the theme away from the child theme to the parent theme and the issue was still there. In my mind that rules the child theme out, would you not agree? Thanks |
August 7, 2023 at 1:24 pm #14164079 | |
Subash Chandra Poudel |
Hi Philipp, Yes the site pages seems to show a blank page now. Not sure, how exactly you tested it with another theme but I was no able to load product, cart and checkout pages. If the issue is still there with the default theme like Twenty Twenty three can you please restore the staging site with the current state of live site then activate a default theme on the site and let me know so that I can check the issue further? Regards, |
August 11, 2023 at 5:17 am #14185857 | |
philippH-28 |
Hello, since I will seemingly need to look at this myself for a solution, I again ask the question why wpml is interfering with calculating shipping costs. It should have nothing to do with that. Where is this behaviour documented? Thanks |
August 11, 2023 at 5:35 am #14185871 | |
Subash Chandra Poudel |
Hi Philipp, Very sorry for the issues you are having. WPML should not interfere with the shipping cost calculation except for the shipping class transactions. But as I said previously my troubleshooting points the issue to coming from the custom code you have in the child theme and not exactly from WPML. And, you said the issue is not resolved on your main site when another theme is activated, please try the following and see if it helps: - First activate a default theme or remove the custom code modifying the shipping cost as I referenced in my previous reply linked next. - Edit the product with the issue in the primary language and update it so as to trigger a translation update. - Edit the translation and complete it. I can sure escalate the issue after looking into the issue further for you if the issue does not get resolved on your main site. In that case please restore the test/staging site so that I can take another look into the issue and/or escalate if required. Regards, |
August 13, 2023 at 3:10 pm #14193493 | |
philippH-28 |
Hello, since I am still waiting on actual help with my problem, here is additional info on what is going wrong: It seems the root of the issue is WPML storing/returning the wrong shipping class ID. In my example the product variation has shipping class ID 1243 as can be seen when inspection the form field in the WooCommerce shipping settings. It is stored in wp_options: When I switch to english language, 1375 is reported as the shipping class ID for the english variation WPML created, because the WPML translation of the term has that ID. When the price then gets queried there is nothing there because that is only populated under the original ID. The only reason it does not happen on default theme, is that WooCommerce falls back to 0/default price, again costing the store owner, since items are not properly calculated with the correct shipping classes. WPML should store/return the original shipping class id, not the translation as there is - at least to my knowledge - no way to store/sync prices for the translated terms. Please advise on if there is a sensible way to maybe set the taxonomy to not translatable or similar so the original terms and their ids get used to finally get this working as it should out of the box. Thanks |
August 14, 2023 at 9:47 am #14196303 | |
Subash Chandra Poudel |
Hi Philipp, > since I am still waiting on actual help with my problem Sure, we will help you as much as we can. > The only reason it does not happen on default theme, is that WooCommerce falls back to 0/default price There should not be a relation between the theme and WooCommerce shipping/price calculation. Or if it happens it means there is some code/custom code for the price calculation in the theme. If we can confirm that, we can look further into what code or part exactly is causing this and whether that part can be made compatible with WPML/WooCommerce. > Please advise on if there is a sensible way to maybe set the taxonomy to not translatable or similar..... Sure, you can go to WPML -> Settings page, and scroll to the "Taxonomies Translation" section. Then for the "Product shipping classes (product_shipping_class)" set the option to "Not translatable". Once that is done, edit the product with the issue and make a small change in the title or content, and update so as to trigger a translation update then edit and complete the translation again and see if it helps. Regards, |
August 14, 2023 at 9:56 am #14196379 | |
philippH-28 |
Hello, this is not working. Did you try it? I can take wild guesses and try stuff myself. I am writing here to get actual information and solve the problem in a timely manner. Can you please refer to someone who can help me? Should I start a new ticket? It does not matter if there is custom code. Translating a product and shipping class terms via wpml breaks retrieval of shipping prices in the translated languages. What other software then does with these results is a totally separate thing. Greetings |
August 14, 2023 at 11:26 am #14196943 | |
Subash Chandra Poudel |
Hi Philipp, I would really appreciate it if you could please recreate the test/staging site from the current state of your live site so that I can troubleshoot further there. Regarding the escalation or handling of the issue by someone else sure I ca do that if you want. Please let me know if you want that and I can ask someone else to handle this issue. Regards, |
August 15, 2023 at 5:11 am #14200899 | |
Long Nguyen WPML Supporter since 02/2022
Languages: English (English ) Timezone: Asia/Ho_Chi_Minh (GMT+07:00) |
Hi Philipp, I'm going to take care of this ticket and after reading all replies, I understand the issue with the shipping method/shipping class does not work on your live site. But now I do not see that on your staging site. I'm not able to login to your staging site to review it but from frontend, I can see the difference is, on the live site, the child theme is activated. Can you please re-activate/deactivate the child theme on the staging site and confirm this issue? I also test this issue again on my demo site and do not see that. If you want to test this on a clean installation of WordPress, you can login to a sandbox site with this link hidden link Look forward to your reply. |
August 18, 2023 at 7:39 am #14250289 | |
philippH-28 |
Hello, the staging site has been reset to the previous state to test further. (same credentials as before) For the issue to manifest on a fresh site there needs to be a product using a translated shipping class with a price set in the WooCommerce settings. You can use the filter woocommerce_package_rates and get an items shipping class id, which will be the translated one which does not have any shipping rate. Core question right now is how I can have WPML not translate those and return the prices that have been entered in settings instead of the empty value. Thanks |
August 18, 2023 at 9:05 am #14250939 | |
Long Nguyen WPML Supporter since 02/2022
Languages: English (English ) Timezone: Asia/Ho_Chi_Minh (GMT+07:00) |
Hi, Testing the shipping class on the staging site, I see: 1. The shipping method is not available when activating the child theme, screenshot 2. The shipping method is available when activating the main theme, screenshot Just to be sure, the issue related to the child theme on your site, specifically the custom code in the file functions.php as my colleague mentioned (https://wpml.org/forums/topic/shipping-classes-not-working-in-second-language/#post-14163449). I would like to inform you that helping you with custom code, is out of the scope of WPML. If you don't want to translate the shipping class, please go to WPML > Settings > Taxonomy Translation > Set the taxonomy "product_shipping_class" to "Not translatable". But I'm not sure if it can work with the custom code on your site. If you are not able to accomplish this, I would recommend you contact one of our certified partners that will be more than happy to help you with this. In this link, you will find a list of our certified partners: https://wpml.org/contractors/ Look forward to your reply. |
August 18, 2023 at 11:50 am #14252221 | |
philippH-28 |
This is so frustrating... You keep reiterating the same things. Things that have been shown to not be accurate. You propose solutions that have been proven not to work. I said so a few posts back. The issue is not the custom code, the custom code just showcases the underlying issue. WPML saves the data in a way that removes the path for retrieving shipping prices via the standard WooCommerce functions. Is there any technical support available to look into this? Please help out with this instead of telling me to spend money with your partners. Would also be happy to work with any official documentation should there be a workaround, but there doesn't seem to be any developer reference? Thanks |
August 20, 2023 at 1:40 pm #14258485 | |
Long Nguyen WPML Supporter since 02/2022
Languages: English (English ) Timezone: Asia/Ho_Chi_Minh (GMT+07:00) |
Hi, The issue is not the custom code, the custom code just showcases the underlying issue. Kindly follow the steps below: - Don’t restore your site there. Look forward to your reply. |
August 21, 2023 at 2:51 pm #14265189 | |
philippH-28 |
Hi, do you have anything prepared to quickly setup WooCommerce? Otherwise it's probably an hour to set all this up and I am not in the employ of WPML, but paying for support... Basically set up woocommerce and wpml, create shipping classes with different prices, create products using these classes. Do not translate classes, check calculation. Make a snapshot to refer to later. Translate classes, check calculation in the second language. Thanks |
August 22, 2023 at 4:48 am #14267531 | |
Long Nguyen WPML Supporter since 02/2022
Languages: English (English ) Timezone: Asia/Ho_Chi_Minh (GMT+07:00) |
Hi, Here are steps I try to replicate the issue on the sandbox site: - Set up WooCommerce, WPML (English and French language). 1. Not translate shipping class: * I also create a backup file at this point with the Duplicator plugin. 2. Translate shipping class: In both cases, translate or not translate the shipping class, I do not see any issue on the sandbox site. Can you please check this or try to replicate the issue there? Look forward to your reply. |
The topic ‘[Closed] Shipping classes not working in second language’ is closed to new replies.