Shopify's Multi-Currency Selector with Retina Theme

Solved
Grayson_James
New Member
2 0 0

Hi folks!

I'm trying to get our store's Retina theme working with Shopify's new multiple currency options. As far as I understand, Retina's built in currency-converter won't work for this function, so I'm trying to install one of Shopify's currency selector.

 

I've been following this guide: https://help.shopify.com/en/themes/customization/currencies, using the code below to set up the form & get the JavaScript working. 

 

The form itself seems to be working totally fine, but for some reason, I cannot get the on(function) part of this working. When I try to select a new currency from the switcher, nothing changes. However, when I include Shopify's currency form with an 'update' button, it works totally fine.

 

For reference, I've put the JavaScript at the top of the "global" section of Retina's app.js.liquid - maybe that's the wrong file?

 

Any guidance would be greatly appreciated - and I hope helpful for others! Out Of The Sandbox has said they're aiming for a proper integration with the new multi-currency next year, but I'm sure I'm not alone in wanting to have that up and running sooner.

 

Thank you!

 

P.S - The current selector on our website is the one that comes with Retina - if need be I can setup a preview link with the integration I'm trying to do.

 

{% form 'currency' %}
  {{ form | currency_selector }}
{% endform %}

and

$('.shopify-currency-form select').on('change', function() {
  $(this)
    .parents('form')
    .submit();
});
0 Likes
Jivan_Suhagiya
Shopify Partner
498 68 107

This is an accepted solution.

Hi,
Can you please share site url? I think there will be issue of JS. Please try to add js code in

 $(document).ready(function() { 
//js here
});

 

If helpful then please Like and Accept Solution.
Email: suhagiyajivan1992@gmail.com
Skype: jivan.suhagiya
First kind of Checkout Reminder APP: https://apps.shopify.com/checkout-reminder
0 Likes
Grayson_James
New Member
2 0 0

Hi Jivan,

That seems to have done the trick! Thank you for the help.

0 Likes
CatifyCatShop
Tourist
5 0 1

"submit" function doesn't seem to work. When a new currency is selected nothing happens. Had to get an update button. Once this is clicked then page reloads and new currency is show but it requires manual input and is cumbersome. How do I make it automatically submit?

0 Likes
lanterncozies
New Member
2 0 0

The solution above worked for me on the debut theme. To be more explicit...

I put 

<script>
$(document).ready(function() {
$('.shopify-currency-form select').on('change', function() {
$(this)
.parents('form')
.submit();
});
});
</script>

 

just above the {% schema %}

0 Likes
bryanleee
New Member
1 0 0

Can't seem to get the javascript to work either (am using debut theme too!). I've tried the js code at the very bottom of theme.js of debut theme, but to no avail. Where exactly did you insert those codes if I may ask?  

0 Likes