Nowości
// Pick your format here: // Can be 'money_format' or 'money_with_currency_format' Currency.format = 'money_format'; var shopCurrency = 'USD'; var cookieCurrency = Currency.cookie.read(); // Fix for customer account pages jQuery('span.money span.money').each(function() { jQuery(this).parent('span.money').removeClass('money'); }); // Add precalculated shop currency to data attribute jQuery('span.money').each(function() { jQuery(this).attr('data-currency-USD', jQuery(this).html()); }); // Select all your currencies buttons. var currencySwitcher = jQuery('#currencies'); // When the page loads. if (cookieCurrency == null || cookieCurrency == shopCurrency) { Currency.currentCurrency = shopCurrency; } else { Currency.currentCurrency = cookieCurrency; currencySwitcher.val(cookieCurrency); Currency.convertAll(shopCurrency, cookieCurrency); } currencySwitcher.selectize(); jQuery('.selectize-input input').attr('disabled','disabled'); // When customer clicks on a currency switcher. currencySwitcher.change(function() { var newCurrency = jQuery(this).val(); Currency.cookie.write(newCurrency); Currency.convertAll(Currency.currentCurrency, newCurrency); //show modal jQuery("#currencies-modal span").text(newCurrency); if (jQuery("#cart-currency").length >0) { jQuery("#cart-currency").text(newCurrency); } jQuery("#currencies-modal").fadeIn(500).delay(3000).fadeOut(500); }); // For product options. var original_selectCallback = window.selectCallback; var selectCallback = function(variant, selector) { original_selectCallback(variant, selector); Currency.convertAll(shopCurrency, jQuery('#currencies').val()); };