/** * @param ProductAction $object * @param ProductAction $result * @return ProductAction * * @SuppressWarnings(PHPMD.UnusedFormatParameter) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterUpdateAttributes(ProductAction $object, ProductAction $result) { $data = $result->getAttributesData(); if (!empty($data['price'])) { $this->productRuleProcessor->reindexList($result->getProductIds()); } return $result; }
/** * @param \Magento\Catalog\Model\Category $subject * @param \Magento\Catalog\Model\Category $result * @return \Magento\Catalog\Model\Category * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterSave(\Magento\Catalog\Model\Category $subject, \Magento\Catalog\Model\Category $result) { /** @var \Magento\Catalog\Model\Category $result */ $productIds = $result->getAffectedProductIds(); if ($productIds) { $this->productRuleProcessor->reindexList($productIds); } return $result; }