Remove Inventory Levels from Source Code
WHEN TO USE
The client discovered inventory levels were display in the source code. This technique keeps inventory levels from outputting.
This technique was first used on https://store-uk.ilovestvincent.com/products/mass-seduction-lp
The code
product-add-to-cart-form.liquid
open product-add-to-cart-form.liquid and find the <select id="{% include '__advanced-layout-id' with 'product-select' %}" name="id" class="form-control input-lg">
Add the following code before the closing >
{% if product.variants.size == 1 %} style="display:none;" {% endif %}
In the same file find and comment out the following code.
new Shopify.BootstrapifyOptionSelectors("{% include '__advanced-layout-id' with 'product-select' %}", {
product: {{ product | json }},
onVariantSelected: selectCallback,
enableHistoryState: true{% unless settings.show-unavailable-products %},
linkOptions: true {% endunless %}
});