Skip to content

Commit ee268ad

Browse files
committed
MAGETWO-96410: [2.3.x] The cart rule cannot effect the cart
- Add parent qty
1 parent 069d5cd commit ee268ad

File tree

1 file changed

+6
-1
lines changed
  • app/code/Magento/SalesRule/Model/Rule/Condition/Product

1 file changed

+6
-1
lines changed

app/code/Magento/SalesRule/Model/Rule/Condition/Product/Subselect.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\SalesRule\Model\Rule\Condition\Product;
77

8+
/**
9+
* Subselect conditions for product.
10+
*/
811
class Subselect extends \Magento\SalesRule\Model\Rule\Condition\Product\Combine
912
{
1013
/**
@@ -161,7 +164,9 @@ public function validate(\Magento\Framework\Model\AbstractModel $model)
161164
}
162165
}
163166
if ($hasValidChild || parent::validate($item)) {
164-
$total += (($hasValidChild && $useChildrenTotal) ? $childrenAttrTotal : $item->getData($attr));
167+
$total += ($hasValidChild && $useChildrenTotal)
168+
? $childrenAttrTotal * $item->getQty()
169+
: $item->getData($attr);
165170
}
166171
}
167172
return $this->validateAttribute($total);

0 commit comments

Comments
 (0)