Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
Is there a way hide inventory quantities until the customer logs in?
{% if customer %}
Customer is logged in. Show the product inventory quantities
{% endif %}
(Add code to inventory location on product-template.liquid?)
<div id="inventoryLocationInformation">
<strong>Inventory:</strong><br />
<span class="inventoryLocationLoading">Loading..
</span>
</div>
First time on the forum. If I'm not posting in the correct place please let me know.
Thank you,
Max
Solved! Go to the solution
This is an accepted solution.
Hi @Maxfield
Welcome to the forums!
You're on the right track, where is the code that displays this inventory section? You would just need to wrap it around the first customer condition you wrote.
This is an accepted solution.
Hi @Maxfield
Welcome to the forums!
You're on the right track, where is the code that displays this inventory section? You would just need to wrap it around the first customer condition you wrote.
Thanks for the help! Works like a charm!
{% if customer %}
<!-- Customer is logged in. Show the product inventory quantities -->
<div id="inventoryLocationInformation">
<strong>Inventory:</strong><br />
<span class="inventoryLocationLoading">Loading..
</span>
</div>
{% endif %}
Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024Note: Customizing your CSS requires some familiarity with CSS and HTML. Before you cust...
By JasonH Aug 12, 2024