skip to Main Content

I am building an app for Shopify. My store has EUR as the base currency and supports different currencies such as USD, NZD,.. (I refer it as active currency).

I can get active currency with the javascript window.Shopify.currency.active and also the rate window.Shopify.currency.rate. How can I get the base currency symbol?

4

Answers


  1. Try theme.moneyFormat, it works for me:

    var currentCurrent = theme.moneyFormat;
    

    Whenever anyone changes currency, it will give current currency with symbol.

    Login or Signup to reply.
  2. You can use

    {{ currency.symbol }}

    Shopify Reference

    Login or Signup to reply.
  3. Shopify provides the Currency object depending on the theme page.

    You can use {{ cart.currency.symbol }} and {{ checkout.currency.symbol }} in Cart page and Checkout page respectively.

    For any other page, you can use the Shop object to get the currency by using {{ shop.currency }}.

    Login or Signup to reply.
  4. <script type="text/javascript">
        $(document).ready(function() {
            var currency;
            window.currency = '{{ cart.currency.symbol }}';
        });
    </script>
    

    Now your "currency" is a global variant. You can use it anywhere.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search