I have to display a text field dependent on the applied catalog product rule in the frontend, so I extended Magento\CatalogRule\Model\Rule, Magento\CatalogRule\Api\Data\RuleInterface and Magento\CatalogRule\Model\Indexer\ReindexRuleProduct to contain a custom text field.

The Catalog Product Rule with the text is applied for every product with special_price. After triggering reindexing of Catalog Rule Product index everything works fine and I can get the text from the rule. Now when I edit the Special_Price of another Product and save it, the rule isn't applied for this product and I have to trigger reindexing manually.

How can I trigger reindexing of catalog product rules with my custom field for this product on save automatically?

migrated from stackoverflow.com Jun 11 '18 at 3:38

This question came from our site for professional and enthusiast programmers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.