Skip to content

Instantly share code, notes, and snippets.

@seedcms
Created February 4, 2017 05:37
Show Gist options
  • Save seedcms/baa2c535d8f3cd774faffd612d6b8c3f to your computer and use it in GitHub Desktop.
Save seedcms/baa2c535d8f3cd774faffd612d6b8c3f to your computer and use it in GitHub Desktop.
Multiple Levels 2
// original
<span id="ProductPrice-{{ section.id }}">{{ current_variant.price | money }}</span>
//script changes
{% if product.id == (example)123456789 %} //check if right product to discount
//linethrough original price if wholesale customer
{% if customer.tags contains 'Industry' or customer.tags contains 'Pro' or customer.tags contains 'Tier2' or customer.tags contains 'Tier3'%}
<del><span id="ProductPrice-{{ section.id }}">{{ product.price | money }}</span></del>
{% endif %}
//discount based on what type of wholesale customer
{% if customer.tags contains 'Industry' %}
<span id="ProductPrice-{{ section.id }}">{{ product.price | times: 0.4 | money }}</span>
{% elsif customer.tags contains 'Pro' %}
<span id="ProductPrice-{{ section.id }}">{ product.price | times: 0.5 | money }}</span>
{% elsif customer.tags contains 'Tier2'%}
<span id="ProductPrice-{{ section.id }}">{{ product.price | times: 0.7 | money }}</span>
{% elsif customer.tags contains 'Tier3'%}
<span id="ProductPrice-{{ section.id }}">{{ product.price | times: 0.5 | money }}</span>
{% endif %}
{% else %}
<span id="ProductPrice-{{ section.id }}">{{ product.price | money }}</span>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment