You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create a discount based on a category, if a product related to this category is added to the cart at the same time as multiple other products, the discount gets applied to all items in the cart. Have just checked this on a fresh install.
Expected behaviour
When adding multiple products to cart at once, discounts only get applied to products related to discount category.
Steps to reproduce
In CP go to Settings > Categories and create a new category group called Discount categories.
Create a category in this group called Online discount.
In Settings > Fields create a field called Discount categories.
In Commerce > System Settings > Product Types > Clothing click on Product Fields tab and add the Discount categories field created in step 3.
In Commerce > Products click on the A New Toga product and choose the Online discount category from the Discount categories field.
Go to Commerce > Promotions > Discounts and create a new discount called Online discount. In the Conditions tab choose the Online discount category from the Categories field (this should mean this discount only gets applied to products related to this category). In the Amounts tab choose 10% off the original item price as the discount amount. Save discount.
Go to front end of website and click the Add all products to cart button. The cart page shows that the 10% discount has been added to all line items. This can be confirmed by checking the active cart in the CP.
Additional info
This only seems to happen when multiple products are added to the cart at once (like using the Add all products to cart button). When added one at a time it seems to be fine. Additionally, when any other action is performed that updates the cart (like moving to next step in checkout phase, or removing line from cart) then the issue is corrected.
Craft version: Craft Solo 3.1.19 (also tested with Craft Pro)
PHP version: 7.1.27 (also tested on 7.0)
Database driver & version: MySQL 5.7.18
Plugins & versions: Craft Commerce 2.1.2
The text was updated successfully, but these errors were encountered:
Description
If I create a discount based on a category, if a product related to this category is added to the cart at the same time as multiple other products, the discount gets applied to all items in the cart. Have just checked this on a fresh install.
Expected behaviour
When adding multiple products to cart at once, discounts only get applied to products related to discount category.
Steps to reproduce
Additional info
This only seems to happen when multiple products are added to the cart at once (like using the Add all products to cart button). When added one at a time it seems to be fine. Additionally, when any other action is performed that updates the cart (like moving to next step in checkout phase, or removing line from cart) then the issue is corrected.
The text was updated successfully, but these errors were encountered: