Configure product availability to be published on product amount changes

Edit on GitHub

By default, AvailabilityStorage is configured to trigger a P&S event when product status changes from available to not available and the other way around.

To configure the events to be triggered when product amount, follow the steps:

  1. In src/Pyz/Zed/Availability/Persistence/Propel/Schema/spy_availability.schema.xml, remove value="0" and operator="===" from the line <parameter name="spy_availability_abstract_quantity" column="quantity" value="0" operator="==="/>:
<table name="spy_availability_abstract">
        <behavior name="event>
            <parameter name="spy_availability_abstract_quantity" column="quantity"/>
       </behavior>
</table>
  1. Run the commands:
console propel:schema:copy
console propel:model:build