Created
February 4, 2017 05:37
-
-
Save seedcms/baa2c535d8f3cd774faffd612d6b8c3f to your computer and use it in GitHub Desktop.
Multiple Levels 2
This file contains hidden or 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
// 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