Customer discount based on Tag using Script Editor
Script Editor
Product Template:
Cart Template:
- Create a Line Item Script Type Here: https://jgodson.github.io/shopify-script-creator/
- Select A Campaign: Conditional Discount
- Qualifier behaviour: Discount if all quanlify
- Customer Qualifier: Customer Tags *(fill out the tags as needed) example- Match Type: Does Match one of "MEMBERSHIP03"
- Cart Qualifier: None *(unless needed)
- Discounted Item Selector: Product Tag *(fill out the product tags as needed) example- Match Type: Does Match one of "Discount Eligible"
- Discount to Apply: Percent Discount*(fill out as needed)
- Maximum Discount: 0 *(unless needed to be higher)
- Save, Generate the code, and move to the Script Editor App
Product Template:
- Access the Product template or where ever the price liquid code lives
- Add/Replace code with code below
{% if customer.tags contains '<CUSTOMER TAG USED ABOVE>' and product.tags contains '<PRODUCT TAG USED ABOVE>' %} <span id="ProductPrice-new" class="product-single__price" itemprop="price" content="{{ product.price | divided_by: 100.00 }}"> {{ product.price | money }} </span> <small style="color: #c92e2e; font-size: 18px; margin-left: 10px;" class="member_original-price text-muted"> <del>${{ product.price_max | money_without_currency }}</del> BEFORE MEMBER DISCOUNT </small> {% else %} <PRICE CODE WITHOUT DISCOUNT MESSAGES> {% endif %}
Cart Template:
- Cart will depend on the theme, but - use item.product.price_max for the original price - use item.product.price for the price with the sale
- Should look somewhat like the code below:
{%- if item.original_price != item.final_price -%} <del>{{ item.product.price_max | money }}</del> <span class="order-discount">{{ item.product.price | money }}</span> {%- else -%} {{ item.product.price | money }} {%- endif -%}