FROM CACHE - en_header

Expose IntentoryLevel Location and Availability in Theme Extension (Liquid)

hugo4711
Shopify Partner
17 1 1

Hi!

We are trying to expose the product availability at a certain location for our storage management. We want to be able to show the specific available quantities in our different storage locations.

Therefore we have started to create an app + theme extension but got into a deadend here because we don't want to use metafields or anything.

We only need the information from the backend. And as the Storefront REST-API does not expose the location / inventorylevels we need to do this via app.

Our GraphQL looks like this:

 

product(id: $productId) {
      id
      title
      featuredImage {
        id
        originalSrc
      }
      variants(first: 6) {
        edges {
          node {
            inventoryItem {
              id
              inventoryLevels(first: 6) {
                edges {
                  node {
                    id
                    available
                    location {
                      id
                      name
                    }
                  }
                }
              }
            }
          }
        }
      }

 

How would we go on to be able to access this info in an app block in liquid?

We have studied the reference app https://github.com/Shopify/product-reviews-sample-app

Any help would be greatly appreciated.

Cheers,

Christian

 

Reply 1 (1)
hugo4711
Shopify Partner
17 1 1

Not possible as we found out:

 

I ended up writing my own app: Custom App for our client.

 

We are using an app registering webhooks for product updates

 

We store those inventory updates in our own database 

 

We expose a REST API so that the shopify front end can access the data (because inventory levels are not exposed in shopify’s api) using jquery