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:
A merchant wants to display inventory quantities for individual locations on product pages (e.g., “Location 1: 3 in stock, Location 2: 5 in stock”) rather than showing only total inventory across all locations. The default Shopify Liquid variable {{ variant.inventory_quantity }} returns aggregated stock, not per-location breakdowns.
Proposed Solutions:
Technical Challenges:
Several users report difficulty accessing per-location inventory data via Liquid or JavaScript. The .store_availabilities array only indicates availability (yes/no), not quantities, and requires local pickup to be enabled. One developer suggests using Shopify’s Admin API (unstable version) via a custom app on an external server to retrieve inventory levels by location.
Status: The discussion remains open with no native Shopify solution identified; users must choose between custom development, third-party apps, or API-based workarounds.
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: