Personalized checkout and custom promotions with Shopify Scripts
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi community! I would like to exclude subscription products from being added in the Tiered Discount by Quantity script.
I am checking if the line item contains a selling plan id based on the Shopify scripts API. " This method is useful when the store sells subscriptions and you want the script to detect when a product variant is sold as a subscription. "
# Exclude subscription products
if line_item.variant.selling_plan_id
return false
end
However, the script still fires on subscription products as seen here. It's giving 10% for subscribing and an additional 5% via the script.
Thank you!
try using a product tag on your subscription item, and excluding that from your discount rule
Thanks Chris! Our problem is that all of our products can be added as subscriptions.
I'd experiment with looping through the cart items and their properties and seeing what you can pick off from there. You can do this with the cart JS API. Good luck!