Condition
Magento\SalesRule\Model\Data\Condition
What it does
This class represents a single condition or rule criteria in Magento 2's sales rule/promotion system.
Developers use it to programmatically define conditions for cart price rules, such as checking product attributes, cart totals, or customer segments.
It supports nested conditions through the conditions array and can be configured with operators, aggregators (AND/OR), and specific attribute values.
Public Methods
- getConditionType()
- setConditionType()
- getConditions()
- setConditions()
- getAggregatorType()
- setAggregatorType()
- getOperator()
- setOperator()
- getAttributeName()
- setAttributeName()
- getValue()
- setValue()
- getExtensionAttributes()
- setExtensionAttributes()