File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
app/code/Magento/SalesRule
Model/Rule/Condition/Product
Test/Unit/Model/Rule/Condition/Product Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 55 */
66namespace Magento \SalesRule \Model \Rule \Condition \Product ;
77
8+ use Magento \Quote \Api \Data \TotalsItemInterface ;
9+
810/**
911 * Subselect conditions for product.
1012 */
@@ -163,9 +165,12 @@ public function validate(\Magento\Framework\Model\AbstractModel $model)
163165 }
164166 }
165167 }
168+ if ($ attr !== TotalsItemInterface::KEY_BASE_ROW_TOTAL ) {
169+ $ childrenAttrTotal *= $ item ->getQty ();
170+ }
166171 if ($ hasValidChild || parent ::validate ($ item )) {
167172 $ total += ($ hasValidChild && $ useChildrenTotal && $ childrenAttrTotal > 0 )
168- ? $ childrenAttrTotal * $ item -> getQty ()
173+ ? $ childrenAttrTotal
169174 : $ item ->getData ($ attr );
170175 }
171176 }
Original file line number Diff line number Diff line change @@ -249,6 +249,25 @@ public function dataProviderForFixedBundleProduct(): array
249249 ],
250250 false
251251 ],
252+ 'validate true for bundle product data with conditions for attribute base_row_total ' =>
253+ [
254+ [
255+ 'id ' => 'attribute_set_id ' ,
256+ 'name ' => 'base_row_total ' ,
257+ 'attributeScope ' => 'frontend ' ,
258+ 'attributeOperator ' => '== '
259+ ],
260+ [
261+ 'id ' => 1 ,
262+ 'type ' => ProductType::TYPE_BUNDLE ,
263+ 'qty ' => 2 ,
264+ 'price ' => 100 ,
265+ 'hasChildren ' => true ,
266+ 'baseRowTotal ' => 200 ,
267+ 'valueParsed ' => 200
268+ ],
269+ false
270+ ],
252271 'validate true for simple product data with conditions ' =>
253272 [
254273 [
You can’t perform that action at this time.
0 commit comments