Skip to content

Instantly share code, notes, and snippets.

@carolineschnapp
Last active August 21, 2019 13:17
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save carolineschnapp/773649 to your computer and use it in GitHub Desktop.
Save carolineschnapp/773649 to your computer and use it in GitHub Desktop.
currency-picker.liquid
<label class="currency-picker__wrapper">
<span class="currency-picker__label">Pick a currency</span>
<select class="currency-picker" name="currencies" style="display: inline; width: auto; vertical-align: inherit;">
{% assign codes = 'USD,EUR,GBP,CAD,ARS,AUD,BBD,BDT,BSD,BHD,BRL,BOB,BND,BGN,ILS,MMK,KYD,CLP,CNY,COP,CRC,HRK,CZK,DKK,DOP,XCD,EGP,XPF,FJD,GHS,GTQ,GYD,GEL,HKD,HUF,ISK,INR,IDR,NIS,JMD,JPY,JOD,KZT,KES,KWD,LVL,LTL,MXN,MYR,MUR,MDL,MAD,MNT,MZN,ANG,NZD,NGN,NOK,OMR,PKR,PYG,PEN,PHP,PLN,QAR,RON,RUB,SAR,RSD,SCR,SGD,SYP,ZAR,KRW,LKR,SEK,CHF,TWD,THB,TZS,TTD,TRY,UAH,AED,UYU,VEB,VND,ZMK' | split: ',' %}
{% assign supported_codes = settings.supported_currencies | split: ' ' %}
<option value="{{ shop.currency }}" selected="selected">{{ shop.currency }}</option>
{% for code in supported_codes %}
{% if code != shop.currency and codes contains code %}
<option value="{{ code }}">{{ code }}</option>
{% endif %}
{% endfor %}
</select>
</label>
@oussachy
Copy link

Great snippet!
Can any one help? I want to ad flags to this??

@shawnma
Copy link

shawnma commented Nov 15, 2017

It works for me. Thanks.

@cuocsongso
Copy link

Hello,

Can you help me with the problem "Uncaught TypeError: jQuery.cookie is not a function at Object.write (jquery.currencies.min.js" ?

@Andyallison27
Copy link

Great snippet but I have exactly the same issue as Jemmey above. Did anyone come up with a solution for her?
I'm using Debut.
Thanks

@willbroderick
Copy link

This list is missing some currencies from https://raw.githubusercontent.com/carolineschnapp/currencies/master/jquery.currencies.min.js
TND, for example. I'd create a PR if this weren't a Gist :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment