Is that possible, via Shopify Script Editor to show a user message when it tries to stack discount codes on the checkout?
I want to allow the user to add any new valid promotion code with regular behavior (attach)
But I want to show a message saying that would not be possible to use 2 discount codes at the same time
My current script is like this:
Output.cart = Input.cart
exit unless Input.cart.discount_code
if Input.cart.discount_code > 1
Input.cart.discount_code.reject({ message: 'Only 1 code can be applied at a time' })
end
Output.cart = Input.cart
Regular Behavior ๐๐
Thank you in advance
2
Answers
The script editor does not allow to stack multiple coupon discounts, so you do not need to add this validation.
Shopify doesnโt allow user to use more than one discount code during checkout, you dont need to worry on this