All things Shopify and commerce
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
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024