Instantly share code, notes, and snippets.

Embed
What would you like to do?
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>
@birdboho

This comment has been minimized.

Show comment
Hide comment
@birdboho

birdboho Apr 27, 2015

hello - I have installed this but it does not look like yours - when I download the Gist and open it looks great but on my website the currency drop down menu is way to wide - its not neat and discrete - it goes the width of the page - how do I change this please?

birdboho commented Apr 27, 2015

hello - I have installed this but it does not look like yours - when I download the Gist and open it looks great but on my website the currency drop down menu is way to wide - its not neat and discrete - it goes the width of the page - how do I change this please?

@carolineschnapp

This comment has been minimized.

Show comment
Hide comment
@carolineschnapp

carolineschnapp May 10, 2015

@birdboho Use a max-width on the select element. See what I added to my snippet:

style="max-width: 100px"
Owner

carolineschnapp commented May 10, 2015

@birdboho Use a max-width on the select element. See what I added to my snippet:

style="max-width: 100px"
@carolineschnapp

This comment has been minimized.

Show comment
Hide comment
@carolineschnapp

carolineschnapp May 10, 2015

Even better, use style="display: inline; width: auto;"

Owner

carolineschnapp commented May 10, 2015

Even better, use style="display: inline; width: auto;"

@sheikhahamad

This comment has been minimized.

Show comment
Hide comment
@sheikhahamad

sheikhahamad Jun 8, 2015

hello how can i remover or round up or down the amounts like from currency to the other i don't want the cents and pennies and all deicmals how can i remove that from all the currencies that are being displaied

sheikhahamad commented Jun 8, 2015

hello how can i remover or round up or down the amounts like from currency to the other i don't want the cents and pennies and all deicmals how can i remove that from all the currencies that are being displaied

@kaboe627

This comment has been minimized.

Show comment
Hide comment
@kaboe627

kaboe627 Jun 18, 2015

hello, I installed your script and it works great, is there any way that I can place it at the top of my shops site, next to the cart icon? thanks for your help.

kaboe627 commented Jun 18, 2015

hello, I installed your script and it works great, is there any way that I can place it at the top of my shops site, next to the cart icon? thanks for your help.

@paulmist

This comment has been minimized.

Show comment
Hide comment
@paulmist

paulmist Sep 5, 2015

Great snippet.

Any ideas on including the currency's symbol next to the country code? I'm trying…

paulmist commented Sep 5, 2015

Great snippet.

Any ideas on including the currency's symbol next to the country code? I'm trying…

@Jemmey

This comment has been minimized.

Show comment
Hide comment
@Jemmey

Jemmey Sep 12, 2015

Help!

I followed the step by step guide from Shopify at the link below and while everything else works, the price for the product doesn't change from one currency to another, instead it only displays the default currency.

what could I have done wrong?

I am using Minimal Music Live theme.

I would be pleased to hear from anyone with suggestions on what/where I slipped up.

Thanks, Jem

https://docs.shopify.com/manual/configuration/store-customization/currencies-and-translations/currencies/how-to-toggle-between-several-currencies

Jemmey commented Sep 12, 2015

Help!

I followed the step by step guide from Shopify at the link below and while everything else works, the price for the product doesn't change from one currency to another, instead it only displays the default currency.

what could I have done wrong?

I am using Minimal Music Live theme.

I would be pleased to hear from anyone with suggestions on what/where I slipped up.

Thanks, Jem

https://docs.shopify.com/manual/configuration/store-customization/currencies-and-translations/currencies/how-to-toggle-between-several-currencies

@fheineman

This comment has been minimized.

Show comment
Hide comment
@fheineman

fheineman Sep 13, 2015

Great snippet, for sure!
Now, how do I get it to work with ajaxify-cart-template.liquid in the Timber theme?

Many thanks.

fheineman commented Sep 13, 2015

Great snippet, for sure!
Now, how do I get it to work with ajaxify-cart-template.liquid in the Timber theme?

Many thanks.

@ahmad8888

This comment has been minimized.

Show comment
Hide comment
@ahmad8888

ahmad8888 Jan 25, 2016

Hi i need help!

I cant find where to put the currency picker code on the theme liquid! pls help!!!

ahmad8888 commented Jan 25, 2016

Hi i need help!

I cant find where to put the currency picker code on the theme liquid! pls help!!!

@oussachy

This comment has been minimized.

Show comment
Hide comment
@oussachy

oussachy Oct 19, 2017

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

oussachy commented Oct 19, 2017

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

@shawnma

This comment has been minimized.

Show comment
Hide comment
@shawnma

shawnma Nov 15, 2017

It works for me. Thanks.

shawnma commented Nov 15, 2017

It works for me. Thanks.

@cuocsongso

This comment has been minimized.

Show comment
Hide comment
@cuocsongso

cuocsongso May 9, 2018

Hello,

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

cuocsongso commented May 9, 2018

Hello,

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

@Andyallison27

This comment has been minimized.

Show comment
Hide comment
@Andyallison27

Andyallison27 Jun 4, 2018

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

Andyallison27 commented Jun 4, 2018

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

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