Skip to content

Commit fc81559

Browse files
committed
ENGCOM-2111: Performance improved.
1 parent c43adf7 commit fc81559

File tree

1 file changed

+4
-3
lines changed
  • app/code/Magento/ConfigurableProduct/Plugin/SalesRule/Model/Rule/Condition

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ public function beforeValidate(
2424
\Magento\SalesRule\Model\Rule\Condition\Product $subject,
2525
\Magento\Framework\Model\AbstractModel $model
2626
) {
27-
$model->setProduct(
28-
$this->getProductToValidate($subject, $model)
29-
);
27+
$product = $this->getProductToValidate($subject, $model);
28+
if ($model->getProduct() !== $product) {
29+
$model->setProduct($product);
30+
}
3031
}
3132

3233
/**

0 commit comments

Comments
 (0)