Background of the issue:
I am experiencing an issue where the wcml_formatted_price function is not working when performing Add to Cart or Get Cart, or create order actions via GraphQL. We are currently using the following plugins: WooCommerce Multilingual & Multicurrency, WPGraphQL, WPML GraphQL. Despite having these plugins installed and activated, the price is not being converted properly within GraphQL mutations.
Symptoms:
The price is not being converted as expected during Add to Cart or Get Cart actions via GraphQL. The price remains unchanged instead of being converted to the selected currency.
Questions:
Could you please look into this issue and provide guidance on how we can ensure that the price conversion works correctly during GraphQL mutations?
Is there any specific documentation or guidance on ensuring price conversion during GraphQL mutations like Add to Cart and Get Cart?
To ensure the quickest and most accurate support, please provide your debug information so I can look at some of your configurations. We have an excellent article on how to locate it here: https://wpml.org/faq/provide-debug-information-faster-support/.
I'll need your help reproducing the problem, so I can take a better look and eventually escalate to a dev.
I've set up a fresh WP install with the required plugins. Can you please try to reproduce the issue there and then provide me with the steps to see it?
You can log in by following this link: hidden link
You don’t need debugger information for this, as it’s not an issue. I just need some clarification.
My site uses a currency converter powered by the WooCommerce Multilingual & Multicurrency plugin.
I am using the GraphQL plugin, where I have created a mutation.
The problem is that when I change the currency from the site, the mutation (which handles the cart) correctly reflects the converted currency in the API response.
📌 Screenshots:
🔗 hidden link
🔗 hidden link
However, if I don’t change the currency from the site, the API mutation does not convert the currency either.
How can I ensure that the currency conversion happens even when it is not changed from the site?
in your custom resolver mutation code it is not working. Am I right? It shows the $raw_price unchanged, no?
Please let me know if I get it right and feel free to add any extra information that may help.
Thanks!
Best Regards,
Otto
The topic ‘[Closed] Issue with wcml_formatted_price Not Working in Add to Cart & Get Cart Mutations’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.