Skip to main content
All CollectionsCurrency BearGeneral info
Currency returns to original format when changing variants on some themes
Currency returns to original format when changing variants on some themes
Mollie Herbert avatar
Written by Mollie Herbert
Updated over 7 months ago

The Auto Multi Currency Converter app should respond automatically to any changes in your product page such as variant changes. On some themes it might be that when buyers change a product variant or trigger another action that makes the price change on page the app fails to catch that and the wrong currency is shown.

For these unique cases we've created a simple API method that allows you to easily let the app know about any changes on the page. Once called, all prices on page should be converted to the selected currency immediately.

Option A

Add the following code inside the "custom JS" inside the "Advanced" tab:

document.addEventListener("click",()=>{conversionBearAutoCurrencyConverter.convertPricesOnPage();setTimeout(()=>{conversionBearAutoCurrencyConverter.convertPricesOnPage();},1000);})$(document).on("change",()=>{conversionBearAutoCurrencyConverter.convertPricesOnPage(); setTimeout(()=>{conversionBearAutoCurrencyConverter.convertPricesOnPage();},1000);})document.addEventListener("mousedown",()=>{conversionBearAutoCurrencyConverter.convertPricesOnPage();setTimeout(()=>{conversionBearAutoCurrencyConverter.convertPricesOnPage();},1000);})

That would make changing prices bulletproof - it will call the conversion function on the most common interactions in your store.

Option B

Let's say that we want to trigger the method each time a buyer selects a different variant. This means we'll need to grab all the elements that are responsible for changing the variant e.g. the select drop-downs and tell them to call the Auto Multi Currency Converter method. Here's an example:

$(".single-option-selector").each(function () { // Grabbing all the select elements in the product formvar element = $(this);element.change(function(){conversionBearAutoCurrencyConverter.convertPricesOnPage(); // Assigning the API method})});

To adapt this JS code to your theme you should replace the grabbed class ''.single-option-selector" in the example above with your unique class.

Now is the time to place your code in the custom JS section under the advanced tab in the app and hit 'Save'.

Go visit your website and see that the price converts as it should.

Did this answer your question?