umbraco / Umbraco.Commerce.Issues

18 stars 2 forks source link

Grouped discounts (Order Line Product Rule) not applying when top level Match is All only Any #574

Open rstockley opened 3 hours ago

rstockley commented 3 hours ago

Describe the bug If we create a top level Match for All and two sub groups with their own criteria the discount reward only applies if the top level Match is Any.

Steps To Reproduce We can create a top level Code based Discount where the top level match is All We add two groups which each contain two distinct Order line product rules and the group match is set to Any for each pair We want a discount where a customer must buy one of each pair and then get the discount

Expected behavior As I understand we should only get the discount if one item of both subgroups is added to the order and discount apply If we change the top level match to Any then the discount is applied but then the customer needs only buy one item in one group to work - although if both groups have an item selected they DO get discounted as expected. The top level ALL selector seems to be the culprit. Possibly I am not understanding how groups work but I am pretty sure this worked on 13.1.6 - although this is a new site

Additional context No other umbraco commerce packages used

Umbraco Commerce version: Umbraco Commerce version 13.1.8

mattbrailsford commented 1 hour ago

Just so I can be super clear, would you mind sharing a screenshot of the rule builder so I can see the config you have

rstockley commented 1 hour ago

Hi matt

Screenshot image

mattbrailsford commented 1 hour ago

Ok, so what I would expect here is that an order with the code applied would only get the discount if:

The order contains (Vulnerable workers printed book OR Vulnerable workers ebook) AND (Managing Psychological Risk printed book OR Managing Psychological Risk ebook)

Essentially the order must have both books, but each book could be in printed or ebook form, is that correct?