Betheme AJAX does not work with MultiCurrency
I’m working on a WooCommerce site using BeTheme with WooPayments Multi-Currency enabled (CAN and USD), and I’ve run into a consistent issue with currency not being respected in your AJAX cart and header cart elements.
Issue:
- Product pages correctly display converted prices (e.g., USD)
- However, the BeTheme side cart (
mfnrefreshcart) and header cart total display values in the store’s base currency (CAD), even when another currency is selected - The values are not just formatted incorrectly, they are actually calculated in the wrong currency
Investigation:
- In
theme-woocommerce.php, I noticed the following block insidemfn_refreshsidecart()is commented out:
/*if ( is_plugin_active( 'woocommerce-payments/woocommerce-payments.php' ) ) {
$mc = \WCPay\MultiCurrency\MultiCurrency::instance();
$mc->init();
}*/
- It appears BeTheme attempted to support WooPayments Multi-Currency, but it is currently not functional
- The AJAX handlers (
mfnrefreshcart, header fragments) do not initialize WooPayments currency context, so WooCommerce defaults to base currency when calculating totals
Result:
- Cart items, subtotals, and header totals are inconsistent with the selected currency
- This creates incorrect pricing display and a broken user experience
Question:
Is there an official or recommended way to make BeTheme’s AJAX cart and header cart fully compatible with WooPayments Multi-Currency?
https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/
If not supported, is there a way to disable BeTheme’s cart fragments and rely on native WooCommerce fragments instead?
Thanks in advance, any guidance would be greatly appreciated.
Comments
Hey,
Please send us the WordPress dashboard and FTP access privately through the contact form, which is on the right side at https://themeforest.net/user/muffingroup#contact and we will check what might be the reason.
Notice!
Please attach a link to this forum discussion.
Sending incorrect or incomplete data will result in a longer response time.
Therefore, please ensure that the data you send are complete and correct.
Thanks
Sent you the details through the contact form.
Sorry, but we have not received any message from you yet.
Please check your email inbox for our response. Look also inside the spam folder.
If you don't have any message from us, please send your login credentials again.
Be sure that you sent all of the required information mentioned in the previous message.
Thanks
Just sent a response with credentials to [email protected]
Unfortunately, without FTP access or at least a theme file editor, we are not able to check the root cause of this.
I have allowed access to the Theme Editor in the back end of the website. Please confirm you are able to access it.
We have access now. However, we encountered another obstacle, as without FTP, we do not have access to debugging tools.
Currently, we are trying to replicate that in our environment.
Best regards
If you need me to set up debugging, or send you any logs. please let me know. I am happy to send them over.
This plugin does not support AJAX actions, and we need to hook into a filter or action to make it work properly.
We are going to write to Woo about that, but we do not know when we will hear back from them.
Best regards
okay, please keep me updated.
I passed the details along to support at WooPayment and this was their response:
The fact that BeTheme uses its own non-native cart implementation is the root of the issue here, as it's not directly related to WooCommerce or WooPayments itself.
WooCommerce's native cart fragments system uses the woocommerce_add_to_cart_fragments filter to handle AJAX-based cart updates. If BeTheme's AJAX cart could find a way to hook into this native WooCommerce flow instead of running its own isolated AJAX request, the Multi-Currency context would be respected correctly. This is something the BeTheme developers would need to implement on their end, as they own and maintain that custom AJAX logic.
The best path forward here is really one of two options:
Here are some developer resources that may be useful as background reading for either BeTheme or your developer:
Please advise.
Here is some additional context the provided about WooCommerce Ajax:
How WooPayments uses WooCommerce's native AJAX system
WooPayments Multi-Currency is built on top of WooCommerce's own cart fragments system, which uses the WordPress admin-ajax API to update the cart without refreshing the page. It does not have its own separate AJAX endpoint. Instead, it hooks into the same flow WooCommerce uses natively.
The key AJAX handle: get_refreshed_fragments
The native AJAX request is registered under the handle get_refreshed_fragments. This is triggered whenever there is a change to the cart on the front end of the store. When this request fires, WooPayments Multi-Currency is already initialised within that context, so it correctly applies the selected currency to all cart totals.
What triggers it on the frontend
On the JavaScript side, the refresh is fired by the wc_fragment_refresh or updated_wc_div jQuery events. Any theme or plugin that wants to trigger a cart update through the native system can do so like this:
How fragments are registered on the PHP side
On the PHP side, cart fragment output is registered using the woocommerce_add_to_cart_fragments filter. WooPayments hooks into this to ensure the correct currency context is available when fragments are built and returned to the browser.
Why BeTheme's cart breaks this
BeTheme's mfn_refreshsidecart() function likely fires its own isolated AJAX request, completely separate from WooCommerce's get_refreshed_fragments flow. Because it bypasses the native system entirely, WooPayments Multi-Currency is never initialised during that request, and WooCommerce falls back to the store's base currency (CAD) when calculating the cart totals returned.
The commented-out code block you found in BeTheme's theme-woocommerce.php was an attempt to manually initialise the Multi-Currency context inside their custom AJAX handler. That approach could work in principle, but it's currently inactive. The cleaner solution would be for BeTheme to replace their custom AJAX cart call with one that triggers wc_fragment_refresh, so the native WooCommerce flow, including Multi-Currency, runs as expected.
Here's the developer reference that covers the cart fragments system in detail: