Custom code for checkout - automatic discounts for tagged customers

EmbrewTea
Shopify Partner
2 0 0

Hey everyone. I'm trying to implement some custom coding to achieve a custom discount and free shipping for any customers tagged to a VIP program. I'm not interested in an ongoing app to pay for at this point, but will consider it for down the road.

I've looked at several other threads and tried to implement a few ideas without success. I'm a novice Shopify hacker for my own shop that can usually figure stuff out if I Google it, but this has me stumped.


Here's the functionality I'm looking for:

  1. Customers tagged to VIP program will automatically see 10% off and free shipping over $50 in the cart or at checkout (either one works). The typical threshold for the site is free shipping over $100.

  2. I've set up both manual coupon codes already "vip10off" and "vipship", and made them both stackable with other offers to achieve what I'm after if customers manually use coupon codes, but I want this to happen automatically if they are a VIP customer.

  3. I'm on the Basic Shopify subscription, so I'm not sure of any limiting factors there.

  4. I've tried a few code options that I found on Reddit and Shopify forums that look like these options, but neither were working:

A.
(I tried to tackle just the 10% off first, then I was going to try stacking coupon codes, but never got there)
Edit Theme Code on cart-template.liquid
Search for “form” and find the <form action=”/cart” method=”post” novalidate class=”cart cartForm”>
Add below “form action” line: {% if customer.tags contains “vipcustomers”%}
<input type=”hidden” id=”discount” name=”discount” value=”vip10off”>
{%endif%}

B.
(This seemed to add the code automatically for anyone adding something to the cart, not just VIP customers)
Reddit thread link removed.
{% if customer.tags contains 'VIPcustomer' %}

<script> try { fetch( '/discount/vip10off' ) } catch(e) {} </script>

{% endif %}


Anyone have ideas, or think they could help me implement and test? Would love to know how many hours and price to pay someone to figure it out, if it's possible.


Thanks!

Replies 0 (0)