20 private $configurable;
25 private $configurableProductsProvider;
35 $this->configurable = $configurable;
36 $this->configurableProductsProvider = $configurableProductsProvider;
47 \
Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject,
51 $configurableProductIds = $this->configurableProductsProvider->getIds([
$id]);
52 $this->reindexSubProducts($configurableProductIds, $subject);
53 if (!$configurableProductIds) {
66 \
Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject,
70 $configurableProductIds = $this->configurableProductsProvider->getIds($ids);
71 $subProducts = $this->reindexSubProducts($configurableProductIds, $subject);
72 $ids = array_diff($ids, $configurableProductIds, $subProducts);
84 private function reindexSubProducts(
86 \
Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject
90 $subProducts = array_values($this->configurable->getChildrenIds(
$configurableIds)[0]);
92 $subject->executeList($subProducts);
aroundExecuteList(\Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject, \Closure $proceed, array $ids)
__construct(Configurable $configurable, ConfigurableProductsProvider $configurableProductsProvider)
aroundExecuteRow(\Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject, \Closure $proceed, $id)