skip to Main Content

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 ๐Ÿ‘‡๐Ÿ‘‡

enter image description here

Thank you in advance

2

Answers


  1. The script editor does not allow to stack multiple coupon discounts, so you do not need to add this validation.

    Login or Signup to reply.
  2. Shopify doesnโ€™t allow user to use more than one discount code during checkout, you dont need to worry on this

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search