How to display different stock levels for multiple locations on a product page?

Solved

How to display different stock levels for multiple locations on a product page?

anomyous
Shopify Partner
4 0 2

Hello!
I am currently working on a store with multiple locations and all have different stocks. So like 
location 1 has 3 and location 2 has 5 stocks, I need to determine the stocks for each instead of getting the total variant quantity {{ variant.inventory_quantity }}.

I would like to show the product variant quantity on the product page like this:

Location 1: 3 in stock
Location 2: 5 in stock
Location 3: 63 in stock
Location 4: 5 in stock
and so on...


May I know how to achieve that and is that possible?

Thank you!

Accepted Solutions (2)

PurplePartner
Shopify Partner
195 18 34

This is an accepted solution.

Hi @anomyous,

 

Thanks for being part of the Shopify community! What you're saying is possible, but you need to add a custom code that will display the quantity of the product based on the Inventory Location rather than on the Total Inventory Available. That's something any tech-savvy Shopify Partner can help with, me included, so do not hesitate to reach out if you need this kind of feature. 

 

May I know what you're looking to achieve by doing this though? Maybe I can offer a better option. Thanks!

Did you find my response useful? Mark it as "Accepted solution" so others can see it, or just like it.

View solution in original post

Kalen_Jordan
Shopify Partner
803 39 147

This is an accepted solution.

Actually you don't necessarily need custom code for this. This is a workflow combined with a code snippet you can use to do this:

 

Show Inventory Levels By Location On Your Product Page

 

Looks like this:

 

Screenshot-2024-04-16-at-8.29.25 AM-1920x814.png

View solution in original post

Replies 16 (16)

PurplePartner
Shopify Partner
195 18 34

This is an accepted solution.

Hi @anomyous,

 

Thanks for being part of the Shopify community! What you're saying is possible, but you need to add a custom code that will display the quantity of the product based on the Inventory Location rather than on the Total Inventory Available. That's something any tech-savvy Shopify Partner can help with, me included, so do not hesitate to reach out if you need this kind of feature. 

 

May I know what you're looking to achieve by doing this though? Maybe I can offer a better option. Thanks!

Did you find my response useful? Mark it as "Accepted solution" so others can see it, or just like it.
anomyous
Shopify Partner
4 0 2

I am trying to fetch multiple location inventory quantity not the total inventory .
i want to display below content in my product page 
for example:- library Hamilton : Available 5 books in stock
                         library Toronto : Available 4 books in stock
where library Hamilton and library Toronto are location name which is added in shopify admin with there available inventory quantity

PurplePartner
Shopify Partner
195 18 34

Yep! That would be possible, but a Shopify Partner needs to check your theme and build the custom code needed for the feature. If you'd like help from my side, just DM me. 

Did you find my response useful? Mark it as "Accepted solution" so others can see it, or just like it.
bgooder
Tourist
4 0 1

Hello! I am currently trying to add a custom theme to our site that will show the warehouse and in-store quantity. Can you show me how to do this?

BernardoPaixao
Visitor
2 0 0

It is possible to do like ikea?  Showing in what store do I have stock 

IMG_5827.png

PurplePartner
Shopify Partner
195 18 34

Hi, @BernardoPaixao!

 

Yes, that would be possible as long as you set up multiple warehouses in Shopify. Once you do that, extract the information and use custom code to display pick up availability based on warehouse.

Did you find my response useful? Mark it as "Accepted solution" so others can see it, or just like it.
BernardoPaixao
Visitor
2 0 0
Hello,

Can you pass me a budget to do this?
PurplePartner
Shopify Partner
195 18 34

I would like to have a Google Meet first to make sure we're on the same page regarding the complete functionalities and features you're looking for. You can DM me and set up a call for later.

 

Thanks!

Did you find my response useful? Mark it as "Accepted solution" so others can see it, or just like it.
Theo_IT
Shopify Partner
2 0 0

Hi, how can you say that it can be done? With liquid to boot. We are trying everything, even via API, but with variant.inventory_quantity only the quantity of the location that has the most stock is returned. Try with the dawn theme itself which has the functionality built-in. Furthermore, it is impossible to understand if a location that only offers shipping and not in-store pickup has stocks. This is crazy stuff, how can you offer a service on Shopify that you describe as professional, but then there are these absurd things?

Kalen_Jordan
Shopify Partner
803 39 147

This is an accepted solution.

Actually you don't necessarily need custom code for this. This is a workflow combined with a code snippet you can use to do this:

 

Show Inventory Levels By Location On Your Product Page

 

Looks like this:

 

Screenshot-2024-04-16-at-8.29.25 AM-1920x814.png

vanderschueren
New Member
5 0 0

Did someone find a solution to this because I try to do the same? I only can get the sum of all stock levels on the product page.

PurplePartner
Shopify Partner
195 18 34

Hi @vanderschueren, as explained before, you need to apply a custom code that is different based on your theme. I recommend reaching out to a Shopify Partner for support.

Did you find my response useful? Mark it as "Accepted solution" so others can see it, or just like it.
vanderschueren
New Member
5 0 0

Thanks for the answer! However, I know how to code and have located the code for the product stock level. The only thing I am missing is how I can fetch the seperate stock levels in Liquid or Javascript.

LSDC
Visitor
2 0 0

Did you manage to find a solution? I'm currently trying to do exactly the same thing.

calljj
Shopify Partner
2 0 1

Not sure this is possible without having an external server resource - however i'm happy to be proved wrong.
You can mimic the pickup_availabilty files, which gets the   .store_availabilities array, showing whether a product is available at that location, but doesn't give the inventory of that variant, just that its available, you also need the localpickup to be enabled for each location, so doesn't really work for those showing "warehouse" stock, which appears to be the main reason people wanting to show this.
The only way i can see do this is to go through partners.shopify, create your own app on your own server, then use the unstable version of the admin api to get inventory level at location based on the inventory.id gained from querying against the variant, then return a simple array of inventory:location to display on the store.
Having only worked on shopify for a month i'm staggered at how such basic requirements have to be (for most users) outsourced to paid apps.. this is so simple to create on open source carts..

techspawn
Shopify Partner
21 0 0

Hi @anomyous,

It sounds like you're looking for a way to display product quantities based on inventory locations. A custom solution or snippet from Kalen_jordan could definitely work well for your needs, but it does require some technical knowledge. You can reach out to any partner and they should be able to do it.

If you're a store owner seeking a ready-made solution, you might want to check out my recently built app, Multilocation Stock Info. It shows stock levels directly on your product page and its also display pickup locations.

If this doesn't fulfill your requirements, could you share what you're hoping to accomplish with this? Perhaps I can suggest a more suitable alternative. Thank you!