Skip to content

Instantly share code, notes, and snippets.

@nord
Created April 27, 2017 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nord/98876951d9c77218a25e9e919f8afccd to your computer and use it in GitHub Desktop.
Save nord/98876951d9c77218a25e9e919f8afccd to your computer and use it in GitHub Desktop.
Create invoices in EUR. Used by Sufio for Shopify (sufio.com/shopify). http://sufio.com/articles/shopify/create-invoices-from-orders/multiple-currencies/
<!-- Create invoices in EUR. Used by Sufio for Shopify (sufio.com/shopify). -->
<input type="hidden" name="attributes[Invoice Currency]" value="" />
<input type="hidden" name="attributes[Invoice Currency Rate]" value="" />
<script src="//cdn.shopify.com/s/javascripts/currencies.js" type="text/javascript"></script>
<script type="text/javascript">
var currency_code = 'EUR'; // Invoice Currency Code
var currency_rate = 1/Currency.rates[currency_code];
$('input[name="attributes[Invoice Currency]"]').val(currency_code);
$('input[name="attributes[Invoice Currency Rate]"]').val(currency_rate);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment