Personalized checkout and custom promotions with Shopify Scripts
Hi,
I want to add a product discount based on a customer tag.
Therefore I tried out this product discount by customer tag script:
https://help.shopify.com/en/manual/checkout-settings/script-editor/examples/line-item-scripts#produc...
When I select a user with the tag 'VIP'. I get an error on this block:
Anyone else got this error?
How can I fix this?
Hey @Brecht, I ran into this problem too with the code on Shopify's example, not sure what was going wrong but I found this article with a working version: https://www.underwaterpistol.com/blogs/e-commerce-news-and-advice/11-best-shopify-script-examples-wi... - #6 is the one you're looking for. Hope that helps!
Do you get same error if there is an item in the cart?
Also try downcasing all your tags, same as with liquid templates removes at lot of edge cases.
The error indicates either an issue with the campaign method either not being created or deleted.
Without the full code I'd assume there's some other logic elsewhere that also checks for tag and leading to no campaign existing.
Save time & money ,Ask Questions The Smart Way
Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Buy Paul a ☕ Coffee for more answers or donate to eff.org
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023