Customer tag-based pricing

RebeccaP
Tourist
6 0 1

Hi, I am trying to find a simple way to be able to provide a discount to a certain set of customers. We've basically got our normal retail pricing and we have pricing for medical professionals with established accounts (small % of customer base). I tried a couple of apps (by Bold and by Supple) but they made me nervous because of requiring me to set them up as a user in my system (seriously? is this normal?), directions were not clear and it seems that using discount codes may be incompatible but what the incompatibilty means was not clear, for example, if it just means that the tagged customers with special pricing can't use a discount code that's absolutely fine, but if it will affect the rest of my customers, that doesn't work for me... sure would appreciate any guidance.

(I'm in preparation to migrate to Shopify in January, working on theme, app integrations etc)

Rebecca

0 Likes
RebeccaP
Tourist
6 0 1

ps. sorry if I put this in the wrong place! Just realized I wasn't where I thought I was!

0 Likes
Jay_from_Bold
Shopify Expert
38 0 6

Hey Rebecca

I'm with Bold and actually develop an app that does exactly what you're trying to do. It's Customer Specific Pricing for Shopify. Sounds like you tried it already :-) 

There are a few different methods that app can use to create the special pricing, one of them restricts discounts from being used, and it's only when a "VIP", Wholesale, or special tagged customer makes a purchase. 

Hope that helps? 

 

Co-Founder of Bold Commerce, and eCommerce store owner since 1998!
0 Likes
Fowlertown_Web_
Shopify Partner
18 1 3

@RebeccaP You've probably long since resolved this issue for yourself, but since I came here looking for the same functionality, I thought I'd share my solution for anyone that comes after me.

 

Before I landed here looking for my own solution, I tried Bold Custom Pricing, which @Jay_from_Bold recommended above, but it didn't work for my store because we use subdomains for our shopping experience and their app redirects the user to your store's primary domain when they start the checkout process. The alternative mode ("Variant mode") put us over Shopify's 100-variant limit per product.

 

Currently there is no way to apply a permanent discount for a customer tag from the beginning of their shopping experience, unless you're a Shopify Plus merchant. If you are, then you have two options:

 

  1. Shopify Wholesale Channel, which allows you to set custom price lists and assign them to customer tags.
  2. Shopify's Script Editor app can affect lasting price change at the cart/checkout.

My solution uses Script Editor (see below), which provides a DIY method for discounting your prices based on customer tag. This discount is seen at cart/checkout only, but you can adjust the visual prices on your PDP or collection templates by editing the appropriate Liquid files for those customer-facing spaces.

 

I chose to check customer tags in my header and put up a banner that notifies an eligible user that their discount will be taken at checkout. Here's my header alert:

 

  {% if customer.tags contains "PRO" %}
    <div class="announcement-bar">Your professional discount will be taken at checkout.</div>
  {% endif %}

The way my discount script (below) works is that a customer who is eligible for a discount must have two tags, (1) that identifies the customer as being eligible for a discount ("PRO"), and (2) that defines the discount amount (e.g. "PRO35" or "BETA").

 

TAG = "PRO" #customer tag
DISCOUNTS_BY_TAG = { #array of discounts
  "PRO25" => 25,
  "PRO30" => 30,
  "PRO35" => 35,
  "PRO40" => 40,
  "PRO45" => 45,
  "PRO50" => 50,
  "BETA" => 90,
}
MESSAGE = "Pro discount" #this is the text that appears next to discount credit
customer = Input.cart.customer

if customer #checks to see if user is logged in
  if customer.tags.include?(TAG) #checks to see if user has appropriate discount tag
    DISCOUNTS_BY_TAG.each_pair do |tag, discount| #cycle through the above array of tags
      if customer.tags.include?(tag) #pairs the customer's discount level from the above array of tags
        discount = #{discount}
        Input.cart.line_items.each do |line_item|
          line_item.change_line_price(
            line_item.line_price * (Decimal.new(1) - discount / 100),
            message: MESSAGE,
          )
        end
      end
    end
  end
end

Output.cart = Input.cart

This is a code snippet for a line item script in the Script Editor app. You should setup a customer how you want them to be tagged before trying to implement the script, and use the Script Editor's output UI to thoroughly test your script on an eligible customer before publishing. Ideally, you're a programmer or advanced Shopify user if you're attempting to code your own discount in the Script Editor.

 

In my code snippet, you only need to edit the first 3 variables to suit your needs:

  1. TAG is the customer tag that will make a customer eligible for a discount
  2. DISCOUNTS_BY_TAG contains a handful of customer tags and defines the discount amount (percentage as decimal)
  3. MESSAGE is the text that appears alongside the discount in the cart/checkout.

I hope this helps!

MJaspan
Shopify Partner
16 1 1

Great solution @Fowlertown_Web_, my only question is about a bit more detail about the PDF. What product variable(s) do you recommend me working with if my desire is to show the discounted prices in all places prices are shown?

0 Likes
MJaspan
Shopify Partner
16 1 1

Correction... a bit more detail about the PDP or Product Detail Pages. Thank you.

0 Likes
Fowlertown_Web_
Shopify Partner
18 1 3

You'd have to basically code the same thing that's in the Script Editor, but in Liquid syntax. The general logic would be: (note this isn't valid code, just an outline of the logic)

if (customer.tags contains "PRO") {
{% DISCOUNT_TAGS = [] %} <!-- define your discount tags in an array --> foreach (tag in DISCOUNT_TAGS) { if (customer.tags contains tag) {
{% newPrice = price*(1-tag.value) %} <!-- because the tag value is a % off reg price--> <div class="discount-price">{{ newPrice }}</div> /if /foreach /if

Then you could hide the regular price with some CSS (because you want it to be visible unless a match is found and the discounted price is shown). The rendered HTML might look like this:

<div class="discount-price">$35.00</div>
<div class="price">$69.99</div>

so your CSS could do this:

.discount-price + .price {display:none;}

to hide your regular price, or this:

.discount-price + .price {color:red; text-decoration:line-through;}

to make the reg. price red w/ a line through it.

Since the `.discount-price` element will ONLY be rendered when a match is found (in the above example), this CSS won't do anything to your regular price for non-tagged customers.

0 Likes
MJaspan
Shopify Partner
16 1 1

Yes, we figured out the same. Thank you for taking the time and elaborating on the answer! 

0 Likes
TUU
New Member
3 0 0

Thank you for this.

How can you accomplish this but for different % or fixed price structure for multiple collection types?

For example: Customer tag is VIP to be eligible for VIP pricing

Collection 1: 60% or fixed price (let's say product is $25 MSRP, VIP price will be $15)

Collection 2: 40% off

Collection 3: 20% off

With these custom changes, they are still able to apply a discount code like an additional 10% for flash sales correct?

0 Likes
Risa
Shopify Partner
300 16 38

@TUU 

App Selly can help you to offer multiple automatic discounts based on collection and customers' tag:

https://apps.shopify.com/selly

★ SELLY UNITED - The front solution to increase sales for online store and POS - https://apps.shopify.com/selly
0 Likes