Hi
I’m trying to set up the multi-currency toggle, but can’t seem to get it to work… Here’s what I have.
In my header I’ve got this select
<select id="currency">
<option value="gbp">GBP</option>
<option value="usd">USD</option>
<option value="eur">EUR</option>
</select>
I’ve found the demo website and lifted this code, I’ve added this to the footer
.
<script>
Snipcart.subscribe('cart.ready', function() {
$('#currency').val(Snipcart.api.getCurrentCurrency());
});
Snipcart.subscribe('currency.changed', function (currency) {
$('#currency').val(currency);
});
$(function() {
$('#currency').change(function () {
Snipcart.api.setCurrency($(this).val());
});
});
</script>
I’ve made sure I’ve added the extra currencies to the Snipcart dashboard, saved changes.
My HTML for the snipcart-total-price
span is blank
<button class="snipcart-checkout">
<span class="btn-flex">
<span class="icon left">{{ partial:_global/icons/shop-cart }}</span>
<span class="btn-txt snipcart-total-price"></span>
<span class="icon right"><span class="snipcart-items-count">0</span></span>
</span>
</button>
The cart works, but the I can’t get the currency to update?
What am I doing wrong?