Customer discount based on Tag using Script Editor

Script Editor
  1. Create a Line Item Script Type Here: https://jgodson.github.io/shopify-script-creator/
  2. Select A Campaign: Conditional Discount
  3. Qualifier behaviour: Discount if all quanlify
  4. Customer Qualifier: Customer Tags *(fill out the tags as needed) example- Match Type: Does Match one of "MEMBERSHIP03"
  5. Cart Qualifier: None *(unless needed)
  6. Discounted Item Selector: Product Tag *(fill out the product tags as needed) example- Match Type: Does Match one of "Discount Eligible"
  7. Discount to Apply: Percent Discount*(fill out as needed)
  8. Maximum Discount: 0 *(unless needed to be higher)
  9. Save, Generate the code, and move to the Script Editor App

  Product Template:
  1. Access the Product template or where ever the price liquid code lives
  2. 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:
  1. 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
  2. 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 -%}

Leave a comment