Solved

Adding Inventory to Product Page

jpraninPF
Tourist
12 1 1

We have several physical locations of our stores. We would like to let our customers know how many products are in stock at which location. For example:

Mason Jar

 

123 Main St - 4 in stock

456 Other St - 2 in stock

 

I have created a private app and tested the InventoryItems and Location APIs with Postman and I am able to make requests, but I am not sure how to integrate this with my theme on Shopify.

Accepted Solution (1)

sd_
Shopify Staff (Retired)
51 10 7

This is an accepted solution.

Hi there, 

 

In order to have inventory information available on your online store (i.e. within your theme), this data needs to exist within Liquid (Shopify's language that acts as the data layer for your online store). Since you are not able to get inventory information on a per location basis within liquid, one option to display this data within your theme you could employ metafields to populate the inventory values from your private application, which you can then access from within your theme. 

 

Here is an article that outlines how to use metafields within your theme: 

- https://www.shopify.ca/partners/blog/110057030-using-metafields-in-your-shopify-theme

 

Additionally, here is our official documentation regarding metafields in Liquid and REST API. 

https://shopify.dev/docs/liquid/reference/objects/metafield

https://shopify.dev/docs/admin-api/rest/reference/metafield

 

 

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 2 (2)

sd_
Shopify Staff (Retired)
51 10 7

This is an accepted solution.

Hi there, 

 

In order to have inventory information available on your online store (i.e. within your theme), this data needs to exist within Liquid (Shopify's language that acts as the data layer for your online store). Since you are not able to get inventory information on a per location basis within liquid, one option to display this data within your theme you could employ metafields to populate the inventory values from your private application, which you can then access from within your theme. 

 

Here is an article that outlines how to use metafields within your theme: 

- https://www.shopify.ca/partners/blog/110057030-using-metafields-in-your-shopify-theme

 

Additionally, here is our official documentation regarding metafields in Liquid and REST API. 

https://shopify.dev/docs/liquid/reference/objects/metafield

https://shopify.dev/docs/admin-api/rest/reference/metafield

 

 

To learn more visit the Shopify Help Center or the Community Blog.

Thomas_Lang1
Shopify Partner
234 6 54

If you are looking for a more extensive solution you can also check out my app which lets you display inventory information per location on the product pafge and more 🙂

 

https://apps.shopify.com/product-inventory-information

 

 

Software Developer | Owner of Tom IT - We build shopify apps
Marketplace Order Connector | Amazon bol.com & Walmart DSV
Order Related Documents | Print documents, Email document &Autoprint
Blog Product Spotlight | Add products to your blog articles!