We have a couple products that we do not discount but it's hard to exclude those items from email generated coupon codes. I found a script to that someone used during the holidays to reject all coupons and I thought I would modify but I keep getting an "Empty Cart" error. Any help with fixing this to work?
Input.cart.line_items.each do |line_item|
product = line_item.variant.product
if Input.cart.discount_code && product.id == 384805376
message: "Maximum discount already applied! Discount codes can not be used during this promotion."
Output.cart = Input.cart