Coupon code is not valid error when using REST API - Magento CE 2.17, 2.1.8 2.1.9 #11259
Labels
Issue: Cannot Reproduce
Cannot reproduce the issue on the latest `2.4-develop` branch
Issue: Clear Description
Gate 2 Passed. Manual verification of the issue description passed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Progress: needs update
Summary
When applying a coupon code to a qualifying cart (ie cart that has the items in it to which the specific coupon code applies), the coupon code is denied. The system returns a 500 error "Coupon code is not valid".
Preconditions
Steps to reproduce
POST: https://domain.com/V1/guest-carts
POST: https://domain.com/V1/guest-carts/<cart id>/items
PUT: https://domain.com/V1/guest-carts/<cart id>/coupons/<coupon code>
Expected result
Actual result
I've tracked this down to the CouponManagment class When it saves the quote, the coupon code disappears. It has to be something with the cart rules not being properly recognized for the products in the cart.
Here is my cart rule
Websites: Main Website
Customer Groups: All
Coupon: Specific Coupon
Coupon Code:
Uses per Coupon: 500
From: 9/17/17
To: 10/10/17
Conditions: All products
Actions
Apply: Percent of product price discount
Discount Amount: 5.236
Maximum Qty: 10
Discount Qty Step: 0
Apply to Shipping: No
Discard subsequent rules: No
Free Shipping: No
Apply the rule when...
If ALL of these conditions are TRUE:
Category is one of 4, 36, 37, 39, 40, 41, 135
I know this has something to do with the category structure because when I simply remove/add one of the eligible categories to the product, it works just fine. Perhaps the category structure itself is breaking the rule?
| Default Category
| -- Category 1
| -- Parent Category
| --- Child Category 1
| --- Child Category 2
| --- Child Category 3
All items have Child Category 1, 2, or 3 applied. Like I said, when I add (or remove) Parent category, the rule applies just fine.
The text was updated successfully, but these errors were encountered: