Skip to content

Instantly share code, notes, and snippets.

@nord
nord / email_html.html
Last active April 17, 2016 15:10
Code snippets for adding links to invoices to Order Confirmation emails in Shopify. Used by Sufio for Shopify app (http://sufio.com/shopify).
<a href="{{ shop.url }}/apps/sufio/invoice/?id={{ id }}&number={{ order_number }}">View or download invoice</a>
@nord
nord / shopify-cart-language-langify.html
Last active December 1, 2016 20:48
Invoice language for online stores using Langify app. Used by Sufio for Shopify (http://www.sufio.com/shopify). Read more at http://sufio.com/articles/shopify/create-invoices-from-orders/multiple-languages/
<!-- Invoice language for online stores using Langify app. Used by Sufio for Shopify (http://www.sufio.com/shopify). -->
{% assign language = cart.attributes["language"] %}{% if language == nil %}{% assign language = shop.metafields["languages"]["default"] %}{% endif %}{% assign invoice_language = shop.metafields.languages[language] %}{% if shop.metafields.language_codes[language] %}{% assign invoice_language = shop.metafields.language_codes[language] %}{% endif %}
<div class="invoice-language"><input type="hidden" id="invoice_language" name="attributes[Invoice Language]" value="{{ invoice_language }}"><link itemprop="url" href="http://www.sufio.com/shopify" /></div>
@nord
nord / shopify-cart-vat-validation.html
Last active June 19, 2016 21:08
HTML snippet for Shopify cart.liquid theme file to capture VAT numbers from customers, and validate them using VIES VAT number validation service. Used by Sufio for Shopify app (www.sufio.com/shopify). Read more at http://sufio.com/articles/shopify/create-invoices-from-orders/business-customers/include-customer-vat-registration-numbers/
<!-- Shopify shopping cart -- capture VAT numbers from customers, and validate them using VIES VAT number validation service. Used by Sufio for Shopify app (www.sufio.com/shopify). -->
<div class="vat-reg-number">
<label for="vat_reg_no">VAT Registration Number</label>
<input type="text" id="vat_reg_no" name="attributes[VAT Registration Number]" value="{{ cart.attributes['VAT Registration Number'] }}">
<input type="hidden" class="hidden" id="vat_no_valid" name="attributes[VAT Number Valid]" value="{{ cart.attributes['VAT Number Valid'] }}">
</div>
<script type="text/javascript">
$('input#vat_reg_no').change(function() {
var url = "/apps/sufio/vat-check/";
@nord
nord / shopify-cart-vat.html
Last active March 4, 2016 18:02
HTML snippet for Shopify cart.liquid theme file to capture VAT numbers from customers. Used by Sufio for Shopify app (www.sufio.com/shopify). Read more at http://sufio.com/articles/shopify/create-invoices-from-orders/business-customers/include-customer-vat-registration-numbers/
<!-- Shopify shopping cart -- capture VAT numbers from customers. Used by Sufio for Shopify app (www.sufio.com/shopify). -->
<div class="vat-reg-number">
<label for="vat_reg_no">VAT Registration Number</label>
<input type="text" id="vat_reg_no" name="attributes[VAT Registration Number]" value="{{ cart.attributes['VAT Registration Number'] }}">
</div>