The following example creates and registers a conditional event named plugin.magento.catalog.model.resource_model.product.save_low_stock_event. Its parent is plugin.magento.catalog.model.resource_model.product.save. It defines rules that trigger when all of the conditions are true:
- The value of
qtyis less than20 - The
category_idis either3,4, or5 - The product
namecontainsTV - The
store_idof product category is either1or2 - The application area is
adminhtml - The
quantity_and_stock_status.qtyvalue has changed
These fields are present and declared in the parent event.