This thread is resolved. Here is a description of the problem and solution.
Problem: You have set up the multi-currency function in WPML with German as the default language and linked the currency CHF to the German language. However, when visiting a product page, the currency switches back to EUR after 2 seconds. Solution: This issue is related to the
BM_Update_Price::update_price()
method, which is hooked to AJAX. To fix this, you need to add it to our AJAX filters using the wcml_multi_currency_ajax_actions filter. Add the following code to the functions.php of your theme:
// WPML Workaround for compsupp-7663<br />add_filter( 'wcml_multi_currency_ajax_actions', 'wpml_compsupp7663_add_actions_to_multi_currency_ajax', 10, 1 );<br /><br />function wpml_compsupp7663_add_actions_to_multi_currency_ajax( $ajax_actions ) {<br /><br /> $ajax_actions[] = 'update_price'; // Add a AJAX action to the array<br /> return $ajax_actions;<br /><br />}
Please test this solution and provide feedback. If it resolves the issue, we recommend sharing this workaround with the plugin developers.
If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If issues persist, please 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.
Hi,
correct, the currency is changing with the language.
But there is something wrong with the USD currceny. It keeps the amount from EUR so there is now conversion applied.
If I change from EUR to CHF, conversion rate is applied.
I've deactivated the B2B-Market and removed the snippet. The issue does not occur anymore.
However, when the plugin is activated and the snippet is included, the issue does also not occur when I switch to the Twenty Twenty-Four Theme.
Therefore I've contacted the ASTRA development team.
I'll keep you updated if they have any suggestions.
I have looked into the problem with the ASTRA developers. We discovered that the problem also occurs with the Twenty Twenty-One theme.
This means that it is not necessarily related to the ASTRA theme.
The problem currently behaves as follows:
The currency conversion works with the Twenty Twenty-four theme, but not with the Twenty Twenty-one theme and ASTRA theme.
The problem with these two themes is that the currency conversion works between EUR and CHF, but not between EUR and USD.
This means that the amount does not change between EUR and USD.
Thank you for the info. As we were in contact with the B2B Markets dev team they have mentioned that they will release a version that would fix the issue and you will not need to add any code to functions.php
Let's wait for their release as that would be the best solution rather than our temporary workaround.
Please update B2B Markets after the release and test.
I just updated B2B Market and removed the code snippet from the workaround.
And it's working like before - currency is not switching back (which is good) but the USD currency is still displaying the EUR amount. CHF conversion is working.
Sorry for my late reply. I do appreciate your patience with the issue as it seems this is something that needs to be checked with the developers of the plugin again.
I know it will be hard, but I'd appreciate it if you could once more install the B2B Market on the installation below (please use the latest version) and replicate the issue there and get back to us with the steps to see the issue so I can report this to the compatibility team:
Hi,
I have installed Astra theme and the B2B Market plugin. I have also tried to set up everything like it's on my staging site. But unfortunately I can't replicate the issue on your sandbox. I will take another look into the installation on monday.
I deactivated and uninstalled B2B Market on my staging site.
Then I uploaded the plugin again, activated it and imported all settings from the previous installation.