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 |
---|---|---|---|---|---|---|
10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | - | - |
16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | - | - |
Supporter timezone: Asia/Jerusalem (GMT+03:00)
Related documentation:
This topic contains 29 replies, has 0 voices.
Last updated by Itamar 3 days, 23 hours ago.
Assisted by: Itamar.
Author | Posts |
---|---|
July 2, 2025 at 3:44 pm #17194109 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, I have a reply from our second-tier supporter. Our second-tier supporter thinks it could be related to another ticket you can see here, as the wcml_client_country cookie appears to be the issue, based on the feedback you provided. 1. He doesn't think that the custom plugin is necessary here since WP Rocket has already registered our cookies, see hidden link">mandatory cookies and hidden link">dynamic cookies. But if the custom plugin is necessary, you will have to edit this part to add the correct values for wcml_client_country and wcml_client_currency: $cookies = [ 'currency' => [ 'usd', 'eur', ], /* 'lang' => [ 'en', 'es', ],*/ ]; 2. Could you try the solution provided by us in the other ticket? Edit the file classes/multi-currency/geolocation/GeolocationBackendHooks.php (in WCML), and replace: class GeolocationBackendHooks implements \IWPML_Backend_Action, IStandAloneAction { With: class GeolocationBackendHooks implements \IWPML_Frontend_Action, \IWPML_Backend_Action, IStandAloneAction {
Regards, |
July 3, 2025 at 8:51 am #17195892 | |
jiriP-10 |
Hi Itamar, thank you for the reply. Point #1 Point #2 Here I would go back to the one question from the begining - is it possible somehow use the price which is set in WPML currency as the end price? It means - the price which I set there would be used for all customers with that currency - no matters of tax rates - so the same price would be used for customers with 10 % vat rate and also with 20 % vat rate etc. This solution would allow me to preload the cache for all countries without need any other changes (because the problem is that with 21 % vat rate for CZ I am not able to preload content with 23 % vat rate for SK). Thank you and have a nice day! Best regards |
July 3, 2025 at 10:11 am #17196555 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, To have the same price in different currencies, you need to select the I hope this solution is helpful for you. Regards, |
July 3, 2025 at 12:00 pm #17197098 | |
jiriP-10 |
Hi Itamar, thank you for the reply. I already use this function, the problem is, that that's not the end price. For example: What I need to achieve is, that if I set 30 €, than this price will be applicated to all countries no matters of tax rate. Basically - the end price for customer will be the same and what changes is price without the tax. There are already plugins which works like that, but I need to use WPML, so it's shame that there is no sttings for this inside the plugin, but I hope that you will be able to provide me some code, which makes it possible. This is the part, which causing me problems with preloading. I hope that I explained it well. Thank you in advance and have a nice day! Best regards |
July 3, 2025 at 1:41 pm #17197617 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Jiří. I'm consulting our second-tier supporter about your point. As far as I know, the settings for displaying prices, including or excluding tax, are WooCommerce settings and not WooCommerce Multilingual & Multicurrency settings. Please see the attached screenshot. But let's wait for our second-tier supporter to comment on this. I'll keep you updated here. Regards, |
July 3, 2025 at 2:50 pm #17198002 | |
jiriP-10 |
Hi Itamar, thank you for the reply. I don't see any attachment, but it never mind I guess. Yes, tax settings is from WooCommerce, I know. The problem is, that doesn't matter if I use setting price with or without tax, I am not able to achieve the result when the prices for two countries (with the different VAT rate) will be the same. I understand why it happens - WooCommerce counts from the price without the tax. But if you sell physical products to end customers, in some countries (CZ, SK etc.) you have to show end price including tax. So if I want to sell product for SK customers for 30 €, I have to enter 29,512195 in your plugin (in same cases there have to be up to 6 decimals). And then there is this problem, when I am not able to preload the cache because from some reason, even if the right cookies are used for preloading. For example this plugin - hidden link - allows me to enter prices for countries, so if I enter some price, this price will be used and I don't have to enter price with 6 decimals when I know for how much I want to sell it. I understand, that for some businnesses doesn't matter how the end price looks like, because they usually show the price without VAT, but for some businesses like me it's important (also because of cash on delivery in some countries has specific rules - you can't pay for example price with 1 cent, because they don't use cents smaller than 5 etc.) So I think that would be great to have a possibility to choose how I want to use these prices. I hope that you understand what I mean and I'll be waiting for more info from tier 2. Thank you! Best regards |
July 3, 2025 at 9:54 pm #17199417 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi Jiri. I've sent your comment to our second-tier supporter. Please note that my weekend is Friday-Saturday, and I'll be able to continue to check this issue and help you on Sunday. Regards, |
July 6, 2025 at 6:21 pm #17205359 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Our second-tier supporter has reviewed this case, and here is his thorough explanation. Point #1: WP Rocket cookies and preload cache. WP Rocket documentation already includes support for WPML cookies, and these are properly taken into account when creating the "normal" page cache (triggered when a user visits a page). The additional plugin you are using is meant to help with the **preload cache** (caching pages automatically without requiring a first visit). In this preload context, you can set cookie values ahead of time. A few important notes here: The integration with WPML in WP Rocket was implemented by our developers and is implemented on the WP Rocket side. However, at the time, the preload cache feature was not yet available, so it may not be fully compatible yet. If the preload feature causes issues, we recommend disabling it for now and relying on the normal (visit-triggered) cache. Please see the attached screenshot. Regarding your current implementation, there seems to be a configuration issue. Your example currently defines combinations of cookies like this: $cookies = [ [ 'wcml_client_currency' => 'CZK', 'wcml_client_currency_language' => 'cs', 'wcml_client_country' => 'CZ', ], [ 'wcml_client_currency' => 'EUR', 'wcml_client_currency_language' => 'cs', 'wcml_client_country' => 'SK', ], ]; However, the recommended approach is to define possible values per cookie, like this: $cookies = [ 'wcml_client_currency' => ['CZK', 'EUR'], 'wcml_client_currency_language' => ['cs'], 'wcml_client_country' => ['CZ', 'SK'], ]; We suggest trying to adjust the implementation accordingly. Point #2: Preload cache compatibility As mentioned above, the preload option might not yet be fully compatible with WPML. However, the normal cache (based on user visits) will continue to work as expected. Point #3: Using the final price including tax Yes, you can set your product prices as the final price (including taxes) in WooCommerce. To do this, go to WooCommerce > Settings > Tax and set: Point #4: Site settings observations After reviewing your site configuration, we noticed: - In WPML > WooCommerce Multilingual > Multi-currency, both currencies (CZK and EUR) are currently enabled for all countries. From your description, it appears that you intend to use CZK only for the Czech Republic (CZ) and EUR only for Slovakia (SK). - The WP Rocket core plugin is currently deactivated on your site. I hope this information will be helpful to you. Regards, |
July 7, 2025 at 8:47 am #17207152 | |
jiriP-10 |
Hi, Point #1 Settings of the helper plugin. Point #3 Point #4 The problem with preloading function is, that your plugin doesn't allow WP Rocket preload pages properly. Bellow is explanation from WP Rocket support tier 2. ------------ The issue is happening because is not enough just to set the cookies with our preload plugin, WCML also triggers functionality to change currencly, language, location, etc with a different logic. It is happening earlier. So in this case, the easiest way how to solve this problem would be to use final prices for all countries (no matter which VAT rate they use). Is it possible to achieve that somehow? Thank you. Best regard |
July 7, 2025 at 8:13 pm #17211175 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Thanks for the detailed response. I conveyed it to our second-tier supporter. I'll update you here once I have his reply. I appreciate your patience. |
July 8, 2025 at 1:56 pm #17214394 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Our second-tier supporter instructed me to ask if you agree to taking a copy of your site for further escalation of this issue to our developers. For this, I must install a plugin like Duplicator or All In One Migration. Please let me know if you agree. I want to set expectations and let you know that our second-tier supporter has informed me that the issue will likely not receive high priority. This may change if we get more reports about this issue. Regards, |
July 9, 2025 at 11:28 pm #17221281 | |
jiriP-10 |
Hi Itamar, this problem (problem with different prices) I've already solved - this behaviour is caused by WooCommerce - the way how it counts prices, but I was able to add filter to disable non base location prices. Still I have some problems with the preloading, but for now I am not sure if it's caused by WPML or WP Rocket, so I have to investigate it. You can make the copy of the staging site, if it helps you. The main problem, that WP Rocket hasn't access to the cookies for preloading is still there (that's why the preloading doesn't work correctly for different locations - countries), so it would be great if it could be fixed from your side - by developers from WPML and WP Rocket together. I am trying to solve this problem in different ways, because changing WPML/WP Rocket isn't solution for me. When I will have more information about the preloading I'll update this ticket or should I create a new one? Thank you and have a nice day! Best regards |
July 10, 2025 at 11:46 am #17223576 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Jiří. Thanks for providing this information. If I understand it correctly, then you are unsure if WPML has caused this issue. If you find further information related to preloading and WPML, please reply to this ticket. Regards, |
July 11, 2025 at 7:29 am #17226435 | |
jiriP-10 |
Hi Itamar, thank you for the reply. Well, the original problem (the problem, that the WP Rocket can't use cookies from WPML for preloading - different currency - if it's not allowed for the main country, different vat rates etc. is caused by WPML - at least according to what WP Rocket tier 2 support said). So this problem should be fixed from your side with cooperation with WP Rocket - I am not 100 % sure what is the problem there - I am not so familiar with these things). And now I am trying to solve this problem in different ways - like allowing currency for all countries (even if I didn't want to), disabling non base location prices etc. And here I found new problems with preloading - sometimes WP Rocket preloads it well, sometimes not - and here I have to investigate if the problem is cause by WP Rocket or WPML. When I will have more information, I'll update the ticket. Thank you and have a nice day! Best regards |
July 13, 2025 at 8:52 am #17230817 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Jiří. Our second-tier supporter attempted to take a copy of your site using the All In One Migration plugin but was unsuccessful. He will try it with another migration plugin. Regarding the following, you wrote:
Our second-tier supporter mentioned this:
I'll keep you updated when I have news about this case. I appreciate your patience. |