Use Hello to handle currency conversion on your site.
SKILLS NEEDED : Advanced developer skills
You can provide Zonos Hello with the CSS selectors for the price elements on your site. Zonos Hello will take the text of the elements and use foreign exchange rates to convert them to display the foreign currency. You can pass the CSS selectors into config with the currencySelectors property.
Currency conversion
Use Hello to handle currency conversion on your site.SKILLS NEEDED : Advanced developer skills
You can provide Zonos Hello with the CSS selectors for the price elements on your site. Zonos Hello will take the text of the elements and use foreign exchange rates to convert them to display the foreign currency. You can pass the CSS selectors into config with the
currencySelectors
property.Hello integration script
zonos.config({ currencySelectors: ".money, .price, #subtotal" });
You can re-trigger the currency conversion by calling the following JavaScript:
Hello integration script
zonos.displayCurrency();
Calling
displayCurrency
may be needed if your site is loading product information dynamically after the page has loaded.If further customization is needed, you can provide a custom converter. The converter should be a Javascript function that takes three arguments.
zonos.config({ currencyConverter: (convertAndFormat, convert, format) => { // a price from your page const price = 12.34; // a formatted string (ie "CA$17.60") const displayPrice = convertAndFormat(price); // a number (ie. 17.6) const foreignPrice = convert(price); // a formatted string (ie "CA$17.60") const displayPriceAgain = format(foreignPrice); }, });