Shopify introduced a new feature of adding multiple locations. For example, you have Product A, and have a stock of 3 at Location X and 2 at Location Y.
How can I show this information in the product page?
Shopify introduced a new feature of adding multiple locations. For example, you have Product A, and have a stock of 3 at Location X and 2 at Location Y.
How can I show this information in the product page?
2
Answers
One for sure way would be to install an App in your shop that has API access granted to Inventory Level and Locations. With that, you could make an App Proxy call using Ajax on the front-end the customer is using to ask for the locations and stock level at each. Then you could ask the API for the answer, and show it.
The customer would still not be able to easily ask for product A from location XYZ versus location ZYX but they would know things exist anyway.
Someone else may have a better idea but this one is 100% certain to work for you.
I literally finished the exact app @David Lazar described here (because I needed it, I just found this post afterwards)
Demo: https://shipping-demo.myshopify.com/products/test-product
You can install the app here:
http://inventorylocations.checkmyapp.net
It will install the script that will fetch the data.
For now you need to add this to the product-template.liquid (where you want the numbers to show up):
For now it caches the product information for 1 minute, I might make it 2, or I might make it configurable in the backend soon (1,2,5,10) to keep performance up to par.
In the backend you can set which locations to show on the frontend (if you have some warehouse for instance, you don’t want to show it)
some more information:
https://www.thomaslang.nl/shopify-show-product-inventory-location-frontend/