Hiding sold-out products keeps the shop tidy, but each one needs to become visible again when stock returns. A restocked product that stays hidden is difficult for shoppers to find.
When a selected product comes back in stock, is published and is hidden from the catalog, this routine changes its visibility to Shop and search results. It doesn’t restore the product’s earlier visibility setting. You can undo the change from History, provided its visibility hasn’t changed since.
This routine applies to simple products only, because individual variations can change stock status while catalog visibility belongs to the parent product. It also cannot determine why a product was hidden, so use it for products whose visibility you manage according to stock availability.
Before you turn it on
Choose the same simple products used in your Hide selected products when they sell out routine.
Only include products that should automatically become visible again when restocked. Exclude products you intentionally keep hidden for other reasons, because this routine makes qualifying products visible in both the shop and search results.
This routine does not restore earlier visibility settings automatically. Use History to undo a visibility change when needed.