How can I edit product prices based on customer tags?

Hi,

I am trying to edit the product prices on a store based on a customer tag to allow 20% off for customers tagged “Trade”. I want a coded solution as opposed to an app.

I have tried the code below on the product-template.liquid page but it isn’t working.

Can anyone please tell me where I am going wrong.

  • {% if customer.tags contains ‘Trade’ %}
    {{ variant.price | divided_by: 100 | times:80 }}

    {% else %}

    {% include ‘price’ with variant.price %}

    {% endif %}

  • {% if product.compare_at_price_max > product.price and section.settings.product_show_saved_amount %}

  • {% assign compare_price = variant.compare_at_price %} {% assign product_price = variant.price %} {% include 'price-sale' %}
  • {% endif %} {% if section.settings.product_reviews_enable %}
  • {% endif %}

Your best bet is to go to your customer panel and do a search, then save that search into a new group. You can create discounts that apply only to a specific group of customers. This will save you having to code, also this approach only changes the price on product page, but not on checkout as Shopify will still reference the price from the actual product listing, not from your product page.

Make sense?

1 Like

Thanks Oscar,

But I want the discount to be seen on the product and collection pages once the customer is logged in.

Not sure you’re suggested approach does that and it would still requires a discount code to be added at checkout.

Pit the automatic discount option can’t be applied to a customer group like teh discount codes can.

Gotcha! Have you tried Bold Customer Pricing App? https://apps.shopify.com/customer-pricing?ref=shappify&utm_campaign=community&utm_medium=social&utm_source=shopify_forum

Looks like it does exactly what you are looking to do. Or if you are familiar with Shopify’s API you can create a custom app, but via the theme I’m afraid it’s not possible :confused:

It does yes but the pricing system is a little bit more expensive than i would like and I always like to learn some new coding solutions … if possible!

1 Like

Gotcha! Yeah I’m afraid you won’t be able to affect any price changes by tweaking the theme’s code because that data is not really theme dependent :confused: you might need an app, or custom app :confused:

Thats a pity, thanks for your time anyway

Hey there, it’s possible. I do this all the time. You want to code a custom wholesale channel. Be sure to create a backup and follow this tutorial:

https://www.envision.io/blogs/ecommerce-pulse/80312001-how-to-add-a-wholesale-area-to-your-shopify-store-without-an-app

Of course in your case, it’s ‘trade’, but the concept is the same. You want special prices for customers tagged ‘trade’. It’s very effective, however you’ll likely need tweaking in order to polish it. It helps to understand shopify’s control flow tags for links, banners, etc based on whether a customer is tagged ‘trade’ or not. You can also do more advanced things like show invoices column in customer account page for certain customers. This way, they can log in and print out any invoice they need. Try it out, don’t give up! Here to help anytime.

Hi @cmartinez89 thanks for that. I have used a similar process to that before but was hoping for a more streamlined process this time around.

I did get sorted in the end though thanks to assistance from someone at https://storetasker.com/ . Great service at a very reasonable price. I can see the code he used and it was fairly complex so wouldn’t have gotten it sorted myself, but at least I’ll have it again if needed. I also used some code from an article at this link https://wearetmbr.com/shopify-auto-fill-discount-code-on-checkout-page/

1 Like

Hi Oscar,

I’m looking for an easy solution to automatically giving a certain group of customers (dealers) a certain discount.

I understand the grouping of customers, and I also know how to create a customer discount code (DEALER) that only they can use…

however is there a way to auto-populate the discount field and apply the discount automatically at check out? see the last answer, I followed the link at it doesn’t seem to automatically apply the discount. still need to click APPLY.

secondly, I’m very intrigued by your comment about showing pricing on the product page with discount. do you mean on the actual individual product page or at the check out?

thanks,

Evert

I watched the video
Interesting solution but the only problem is he duplicated the product and both retail version and wholesale version don’t share the same inventory count.
In my case that could be problematic as my wholesale customer could login and purchase all the pieces per a model and it wont show on the retail side that it is out of stock

Any solution?

1 Like

Thanks
Will check it out

Hi @PadraigCahill , do you mind sharing who you used on StoreTasker for this? Thanks! :folded_hands:t3:

Hi @PadraigCahill , plz share who you used on StoreTasker for this? thnx