I'm looking to create an automated custom collection template called "Last Few" that will ideally pull in products that have more than 0 inventory and less than or equal to 2 inventory for all variants. Is this possible? I know the liquid syntax that is used to check inventory (variant.inventory_quantity) only checks inventory for each variant of a product instead of the total inventory that a product has.
Also wondering if there is a way to have pagination work correctly for automated custom templated collections? For future reference, I'd like to be able to have more than 48 products in a custom collection.
I put together a quick workflow that does this for you. https://www.apps.bonify.io/arigato-automation-shopify/workflows/maintain-collection-items-are-nearly...
This is currently how I have the collection set up and it's not working the way I want it to. Instead of checking the total inventory, it's checking all the variants of a product and pulling in the products with variants that have 1-2 items left in stock and ignoring the rest. So for example, some products being pulled in have 2 left in stock for size M, and 7 left in size L and it's still being pulled in.
Okay, so as per my understanding, you want only those products that have a total of 0-2 inventory for all the variants. If any product having more than 2 inventory for any of the variants then that product should not be pulled off. Please correct me if I'm wrong.
If this is the case, then that would be code level change and you need to provide me access to your store in order to make this fix.
Looking forward to your response.
For what it's worth, Arigato can handle those types of very specific requirements with a couple of clicks. It's not possible to add/remove/modify collections in liquid templates. You'd need to make API calls to make those changes. As far as I'm aware anyway.
Hello! I think our app Advanced Collections - https://apps.shopify.com/advanced-custom-collections - can help.
For this use case, in the app interface, you can create a collection that includes products with total inventory more than 0 and exclude products with total inventory more than 2. For this option, the app will sum up all the inventory quantities in all the variants in order to do the comparison. It acts just like a normal Shopify collection (so you can apply discount code / add to navigation etc), just that it auto-syncs when you add / update a product in your shop.