#Help with Revalidating listProducts in storefront
10 messages · Page 1 of 1 (latest)
it feels very bad to not to cache this API request because its used everywhere. category page, home page, collection page what not...
@amber agate
Subscribers:
inventory-item-updated.ts
inventory-level-updated.ts
inventory-reservation-item-updated.ts
You can check these one.
https://docs.medusajs.com/resources/references/events
i dont see those events in the docs, are you sure they exist?
@exotic knot hey can u pls confirm this? if it does exist, it will really help
I think how you do this will depend on what you consider out of stock. If it's when all items are reserved from orders placed, you could hook into the order.placed event to check the inventory levels and notify accordingly. If you consider out of stock when all items are actually shipped, you could hook into fulfillment created instead.
sure i cud hook into order.placed but what then?
do i email all carts which contain the out of stock item? feels pointless. people are not going to come back to abandoned cart because their cart item went out of stock.
I don't know the business purpose you have for wanting to know when an item is out of stock. You asked, "Is there an event which fires when stock (inventory_quantity) changes for a variant?" And, yes, there are multiple.