Skip to content

Instantly share code, notes, and snippets.

@dturton
Last active November 8, 2016 14:55
Show Gist options
  • Save dturton/800ac5c08770d07430346c158557830f to your computer and use it in GitHub Desktop.
Save dturton/800ac5c08770d07430346c158557830f to your computer and use it in GitHub Desktop.
<iframe src="https://t.pepperjamnetwork.com/track?PROGRAM_ID=####&INT=DYNAMIC{% assign sub_total = 0 %}{% for line_item in line_items %} {% assign sub_total = line_item.line_price | plus: sub_total %}{% endfor %}{% assign sub_total = sub_total | append: '.00' %}{% assign discount = 0 &}{% assign discount_percentage = 1 %}{% if order.discounts_amount > 0 %}{% for eachdiscount in order.discounts %}{% if eachdiscount.type != "ShippingDiscount" %}{% assign discount = discount | plus: eachdiscount.total_amount %}{% endif %}{% endfor %}{% endif %}{% assign disBYsub = discount | divided_by: sub_total %}{% assign discount_percentage = 1 | minus: disBYsub %}{% for line_item in line_items %}{% assign sub_total = line_item.line_price | plus: sub_total %}{% endfor %}{% assign sub_total = sub_total | append: '.00' %}{% for line_item in line_items %}&ITEM_ID{{ forloop.index }}={% if variant.available %}{{ line_item.variant.id }}{% else %}{{ line_item.sku }}{% endif %}&ITEM_PRICE{{forloop.index}}={% assign afterDiscountPrice = line_item.price | times: discount_percentage %}{{ afterDiscountPrice | money_without_currency | remove: ',' }}&QUANTITY{{ forloop.index }}={{ line_item.quantity }}&CATEGORY{{ forloop.index }}={{ line_item.product.type }}{% endfor %}&ORDER_ID={{ order_number }}&COUPON={% for discount in order.discounts %}{{ discount.code }}{% endfor %}{% if customer.orders_count < 2 %}&NEW_TO_FILE=1{% else %}&NEW_TO_FILE=0{% endif %}" width="1" height="1" frameborder="0"></iframe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment