What I want:
My question:
Business use case:
Thanks for your time and thoughts!
P.S. Script is in Ruby. Also, Setting up a discount code won't work for my use case.
UPDATE
Thank you for your responses. I will be attempting these suggested updates this week and will post my results soon.
UPDATE 2
So the below suggestions and marked answer were all spot on except for one detail. The script editor keeps on running into some type of error even though the described syntax below is correct. Another stackoverflow answer suggested to use '&'.
So I ended up doing something like this:
customer = Input.cart.customer
if customer&.tags&.include?("gift_received")
...
end
This works for me. Thanks again for all your answers!
Any kind of solution could only work if Accounts are required otherwise you can't track the history of orders.
There are two possible solutions
Input.cart.customer.tags.include?('gift_received')
and don't apply the discount.Input.cart.customer.orders_count > 0
and that's it.