Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The "Total amount" inline condition has options to include, or exclude, different line item types (e.g. Product, Shipping).
This is excellent, but the generated Rule doesn't respect the settings here. If you inspect the rule, it has all line item types selected.
Steps to reproduce:
- Have a Commerce installation with product and shipping line items.
- Create an order discount with a condition that the Total amount for just products should be greater than £100: i.e. Products ticked, Shipping not ticked.
- View the generated rule's "Order amount comparison" condition: there all the line-item types are included in the total.
Comment | File | Size | Author |
---|---|---|---|
#2 | Fix_discount_rules_line_item_types-2716037-2.patch | 1.07 KB | lexbritvin |
|
Comments
Comment #2
lexbritvin CreditAttribution: lexbritvin commentedHello!
The issue is caused by a wrongly saved discount entity.
The discount entity has the following values for line item types condition:
When a rule is created/updated, only keys are checked and not the values and thus the rule contains all line item types.
I think, we need to filter empty values on discount save.
The patch is attached.
Comment #3
lexbritvin CreditAttribution: lexbritvin commented