No-code setup
The simplest approach is to use the built-in Stockful Location Availability theme block:- In the theme editor, navigate to your product template
- Click Add block > Apps > Stockful Location Availability
- Configure the button text, style, and maximum locations to show
Custom implementation
For full control over the UI, use thewindow.stockful JavaScript API.
Basic location list
Modal approach
If you prefer a modal over an inline list, combine the location data with a Shopifyui-modal or your own modal component:
Controlling visibility
Visible locations are controlled in the Stockful app under Settings > Storefront - choose which locations appear to customers (e.g. hide your main warehouse, show only retail stores). This applies to both the built-in theme block and thewindow.stockful API.
Show available quantity is a per-block setting on the theme block. When enabled, customers see “42 available”; when disabled, they see “In stock” / “Out of stock”. For custom implementations using the JS API, you control this in your own code.
Tips
- Retail stores only - most merchants hide warehouses and fulfillment centers, showing only locations where customers can visit
- Quantities vs. status - showing exact quantities can be useful for high-demand items but may seem odd for regular products. Status labels (“In stock” / “Out of stock”) are a safer default
- Live data - location availability is fetched live from Shopify (not from cached metafields), so it’s always up to date. The trade-off is a slightly longer load time compared to metafield-based data
- Cache duration - location data is cached for 60 seconds (vs 30 seconds for variant/product data), so very recent inventory changes may take up to a minute to appear