In the API reference, you'll notice that the reject is on CartDiscount classes. You'll have to use something like this
cart = Input.cart contition_is_met = #magic if condition_is_met cart.discount_code.reject( message: "You don't have access to this discount" ) end
Yes, I understand. What I'm doing is seeing that the user entered a discount code, and then manually changing line item prices basing on a custom set of rules, and then rejecting the discount code so that the rules of the discount code aren't also applied. We had a problem where our custom rules AND the discount code rules were being applied and that wasn't what we were trying to achieve. My question is mostly if we can have the "message" parameter of the .reject method be a positive message (in orange) rather than a negative message (in red).
We're getting some inconsistent behavior with this.
1. Discount shows and then disappears. The store's owner sees this behavior:
2. Inconsistency between script editor and live store. (screenshot attached) When I test it in the script editor, it works perfectly. But when I test it on the live store, the discount code is not rejected and it applies the normal discount code percentage off.
Is it possible it takes time to propagate to all users? Has anyone else experience these inconsistencies?