Using an EACH loop
Make a Script that purchases all the products on the shopping list, ignoring those out of stock. Stock changes, so there might be any combination from all available to everything out of stock. Make sure your Script accounts that.
Make a Script that purchases all the products on the shopping list, ignoring those out of stock. Stock changes, so there might be any combination from all available to everything out of stock. Make sure your Script accounts that.