Created
September 19, 2016 12:47
-
-
Save nord/a3716e50ca51e135bdacd8715525f0cb to your computer and use it in GitHub Desktop.
Create invoices in different currency and fetch the latest exchange rates. Used by Sufio for Shopify (sufio.com/shopify). http://sufio.com/articles/shopify/create-invoices-from-orders/multiple-currencies/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Created 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="" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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