Substitution starts before the shopper sees anything. A recipe only matches products that are in stock in the shopper's branch, so a pack that ran out this morning is never on the card. If a smaller or larger pack of the same product is in stock, the pack rule picks that one and adjusts the number of packs.
When no product in stock fits a line, the card marks it as not in the store and the assistant tells the shopper in its reply, as it did for sumac and kabsa spice above. The shopper can then ask for an alternative, and the assistant searches again.
Out-of-stock products cannot be added to the basket on any channel. If a shopper asks for one by name, the assistant says it is out of stock and offers something similar that is in stock.
For what goes missing later, between the order and the packing, the retailer can let shoppers choose. When it is turned on, the assistant asks once, after adding to the basket, what the store should do if an item is unavailable at packing time: a similar replacement, leave it out, or a specific product the shopper picks. The answer is recorded with the basket, and the store can set its own default.
On WhatsApp, a shopper who moves to another branch keeps the basket: items the new branch does not sell are removed and the assistant offers substitutes from that branch.