All things Shopify and commerce
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
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 %}
<p class="pion-qty">{{ totalProductsQuantity }} In Stock</p>
{% 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.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org