How can I get the inventory qty only for one location?

Topic summary

A user is displaying product inventory quantities on their product page but faces an issue with ‘Buy with Prime’ integration. The variant.inventory_quantity variable shows combined inventory from both their warehouse and Amazon FBA, when they only want to display their own warehouse stock.

Current limitation: Liquid template code only provides aggregate inventory totals across all locations—it cannot filter by specific location.

Proposed solution: Use an app to populate metafields with location-specific inventory data. A community member suggests the Mechanic app has a task for syncing inventory levels to variant metafields as a starting point. Shopify Flow may also offer similar functionality.

Status: The question remains unresolved in terms of a native Liquid-only solution; implementation would require third-party tools or custom development.

Summarized with AI on November 7. AI used: claude-sonnet-4-5-20250929.

Hello,

I’m showing an available qty on my product page. We have ‘buy with prime’ items connected to our store. So when I use this variable ‘variant.inventory_quantity’, it shows the total inventory qty of both our warehouse and FBA items. Is there any way that I can only show the inventory level of our location?

F.Y.I. the code I put into my theme’s custom liquid section is,

{% assign totalProductsQuantity = 0 %}

{% for variant in product.variants %}
{% assign totalProductsQuantity = totalProductsQuantity | plus: variant.inventory_quantity %}
{% endfor %}

{% unless product.tags contains ‘bwp’ %}
{% if product.has_only_default_variant %}
{% if totalProductsQuantity > 0 %}

{{ totalProductsQuantity }} In Stock

{% endif %} {% endif %} {% endunless %}

Thank you!

No , currently liquid only gives an aggregate.

You would need an app to populate metafields with that data mechanic has a starting point task

https://tasks.mechanic.dev/sync-inventory-levels-to-variant-metafields , though this may also be possible with shopify flow.

1 Like