Personalized checkout and custom promotions with Shopify Scripts
Hey everyone, I was just wondering if you could apply discounts to customers who aren't registered with the site? We would like to apply free shipping for customers who shop with us through Ipsy. I figure we could do this through:
if Input.cart.customer Input.shipping_rates.each do |shipping_rate| next unless shipping_rate.source == "shopify" if Input.cart.customer.email.include? 'ipsy.com' shipping_rate.apply_discount(shipping_rate.price * 1.0, message: "Free shipping for Ipsy") end end end Output.shipping_rates = Input.shipping_rates
Now this works if I enter a customer that has ipsy.com in their email, but I can't tell if this would work for anyone who just buys through the site and doesnt register. Does anyone know if this can be done? Thanks for your time.
According to the last reply in this topic https://community.shopify.com/c/Script-Editor/Script-recognizes-customer-when-not-logged-in/td-p/434... there is no way to differentiate between registered and non registered customers.
You can check the customer tags in a script so maybe you could tag your registered customers in advance and then in the script instead of checking the email, check if the customer tags contain the registered one, if it does not then apply the discount.
User | RANK |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022