Skip to content

Commit 2f861e5

Browse files
author
Vitaliy Boyko
committed
Avoid to reindex inactive catalog rules
1 parent 211dd25 commit 2f861e5

File tree

1 file changed

+4
-0
lines changed
  • app/code/Magento/CatalogRule/Model

1 file changed

+4
-0
lines changed

app/code/Magento/CatalogRule/Model/Rule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,10 @@ protected function _invalidateCache()
588588
*/
589589
public function afterSave()
590590
{
591+
if ($this->getIsActive()) {
592+
return parent::afterSave();
593+
}
594+
591595
if ($this->isObjectNew() && !$this->_ruleProductProcessor->isIndexerScheduled()) {
592596
$productIds = $this->getMatchingProductIds();
593597
if (!empty($productIds) && is_array($productIds)) {

0 commit comments

Comments
 (0)