Last active
March 4, 2016 17:57
-
-
Save nord/5ef306867385e3ec4043 to your computer and use it in GitHub Desktop.
Integration between Sufio and Coin apps to enable multi-currency support. Read more at 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
<!-- Integration between Sufio and Coin apps to enable multi-currency support. --> | |
<div class="invoice-currency-container" style="display:none;"> | |
<input type="hidden" id="invoice-currency" name="attributes[Invoice Currency]" value="" /> | |
<input type="hidden" id="invoice-currency-rate" name="attributes[Invoice Currency Rate]" value="" /> | |
<input type="hidden" id="invoice-usd-rate" name="attributes[Invoice USD Rate]" value="" /> | |
</div> | |
<script type="text/javascript"> | |
$( document ).on( "shoppad:coin:currencychange", function() { | |
$("input#invoice-currency").val(window.Shoppad.apps.coin.getLocalCurrency()); | |
$("input#invoice-currency-rate").val(window.Shoppad.apps.coin.getLocalCurrencyUSDExchangeRate() / window.Shoppad.apps.coin.getBaseCurrencyUSDExchangeRate()); | |
$("input#invoice-usd-rate").val(window.Shoppad.apps.coin.getLocalCurrencyUSDExchangeRate()); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment