Discount Coupon: no error if Purchase Total is set #2334
Replies: 1 comment
-
Due to the structure of discounts, this isn't technically an error as eventually if you keep adding items it will match. It also has implications if you are doing multiple things in one request e.g. updating a line item quantity and adding a coupon code. We wouldn't want the cart failing and confusing people. We are looking a refactor/update to the discount functionality in the next major release of Commerce, at which point there will be better support for this type of situation. You can get information on the state of these types of coupons by writing some custom twig code or custom code in a plugin/module. For that, it would be a good idea to look at the following code: https://github.com/craftcms/commerce/blob/develop/src/adjusters/Discount.php#L143-L184 Thanks! |
Beta Was this translation helpful? Give feedback.
-
Description
Commerce doesn't return an error when trying to apply a discount code to a cart that has a lower purchase total than the purchase total defined in the coupon
Steps to reproduce
Additional info
Beta Was this translation helpful? Give feedback.
All reactions