Skip to content

Commit a239900

Browse files
committed
ENGCOM-2111: Fix empty minicart bug.
1 parent fc81559 commit a239900

File tree

1 file changed

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

1 file changed

+6
-1
lines changed

app/code/Magento/ConfigurableProduct/Plugin/SalesRule/Model/Rule/Condition/Product.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ public function beforeValidate(
2626
) {
2727
$product = $this->getProductToValidate($subject, $model);
2828
if ($model->getProduct() !== $product) {
29-
$model->setProduct($product);
29+
// We need to replace product only for validation and keep original product for all other cases.
30+
$clone = clone $model;
31+
$clone->setProduct($product);
32+
$model = $clone;
3033
}
34+
35+
return [$model];
3136
}
3237

3338
/**

0 commit comments

Comments
 (0)