How might we create a dynamic navigation base on inventory Shopify?
Problem: We manage 100 + stores.
IF: New product is added to the company store.
Taxonomy associated with the product is auto-created
Because: Top-level nav pre-programmed for full taxonomy but only shows what exists
Default template: Has a taxonomy for every product and service revealed when loaded
Is it possible to do in Shopify?
So when a collection is at 0 items, it will not show up as a link in Shopify navigation?
Hello @1GMedia
You’d need a process running to put a total inventory count(see notes) on the collection as a metafield the shop object,etc.
Or removing products from the collection until it has inventory again possibly into a similar collection for zero stock items.
Then in a theme ,for the online-storefront channel , add logic checking that data to show menu items or not.
If other channels are involved that create thier own navigation then you will need to just remove that product from the collection.
This could be done with automation apps like usemechanic instead of a full blown app.
Example starting points of getting and working with inventory levels per collection: https://tasks.mechanic.dev/manage-collection-templates-by-product-inventory , https://tasks.mechanic.dev/auto-sort-collections-by-inventory-levels (though keep in mind multi-location logic can take extra work to implement)
Notes:
- Linklists aka menus have no api at this time.
- In liquid {{ collection.all_products_count }} is a pure count of existence not of product.availability or all of it’s containing variant.availability.
- There is no
collection.inventory_count, Collections do not have inventory information and looping over every product in liquid is not a good idea due to pagination limits of 50.
Has a taxonomy for every product and service revealed when loaded
Unless you mean loading only that products set of every information, that sounds like loading everything would be punishing performance hit for viewers costing conversions.