How to Get all active Catalog Rules collection Magento 2?

Magento 2 You can retrieve the active catalog rules of the system. Using Active rules, You can identify a number of rules that are active and working for the catalog category pages.

To identify, an active rule you need to filter the catalog collection by is_active field. Value 1 contains the active and 0 used to disable the rule in the system. Continue reading “How to Get all active Catalog Rules collection Magento 2?”

How to Delete Catalog Price Rule by rule id Magento 2?

You can delete catalog rule by rule id in Magento 2 using delete by id method of catalog rule repository interface.

You can see a list of available Catalog Price rules from the admin panel by Marketing -> Promotions -> Catalog Price rule. Continue reading “How to Delete Catalog Price Rule by rule id Magento 2?”

How to Get Catalog Rule data by rule id Magento 2?

Get Catalog Rule information by Catalog rule id using Magento 2 with Catalog Rule Repository Interface.

You need to pass Rule id as an argument to get details of Catalog rule. Original Interface class is,
Magento\CatalogRule\Api\CatalogRuleRepositoryInterface Continue reading “How to Get Catalog Rule data by rule id Magento 2?”