Skip to content

Instantly share code, notes, and snippets.

@10foldsolutions
Created April 20, 2018 21:38
Show Gist options
  • Save 10foldsolutions/b331a278786c717bc0a27d40e02757a7 to your computer and use it in GitHub Desktop.
Save 10foldsolutions/b331a278786c717bc0a27d40e02757a7 to your computer and use it in GitHub Desktop.
{% if context == 'cart' or context == 'checkout' %}
<script type="text/javascript">
/* include cart total amount */
_cartstack.push(['setCartTotal', '{{ total_order }}']);
/* cart items loop, to be included in the email template */
{% for item in items %}
_cartstack.push(['setCartItem', {
'quantity':'{{ item.quantity }}',
'productID':'{{ item.code }}',
'productName': encodeURI('{{ item.name }}'),
'productDescription':'{{ item.category }}',
'productURL':'{{ item.url }}',
'productImageURL':'{{ item.image }}',
'productPrice':'{{ item.price_each }}';
}]);
{% endfor %}
</script>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment