Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Theme - Ella version 5.1.0
Hi!
I'm not an expert, I made a website by Googling
I found an error while modifying our website.
The product's inventory quantity is 0 and add to cart button is automatically changed to SOLD OUT but I can still click the SOLD OUT button and the product goes into the cart. But I cannot purchase it.
https://tirtir.us/collections/shop/products/centella-foam-cleansing
<input type="submit" name="add" class="btn" id="product-add-to-cart" value="Sold Out">
It should be
<input type="submit" name="add" class="btn" id="product-add-to-cart" disabled value="Sold Out">
My product-template-default.liquid is below.
<div class="groups-btn"> <div class="groups-btn-tree {% if section.settings.display_product_detail_share or settings.enable_wishlist %}margin-button{% endif %}"> {% if current_variant.available %} {% if current_variant.inventory_management %} {% assign first_inventory = current_variant.inventory_quantity %} {% if first_inventory > 0 %} <input data-btn-addToCart type="submit" name="add" class="btn" {% if settings.enable_multilang %}data-translate="products.product.add_to_cart"{%endif%} id="product-add-to-cart" value="{{ 'products.product.add_to_cart' | t }}" data-form-id="#add-to-cart-form"> {% else %} <input data-btn-addToCart type="submit" name="add" class="btn" {% if settings.enable_multilang %}data-translate="products.product.pre_order"{%endif%} id="product-add-to-cart" value="{{ 'products.product.pre_order' | t }}" data-form-id="#add-to-cart-form"> {% endif %} {% else %} <input data-btn-addToCart type="submit" name="add" class="btn" {% if settings.enable_multilang %}data-translate="products.product.add_to_cart"{%endif%} id="product-add-to-cart" value="{{ 'products.product.add_to_cart' | t }}" data-form-id="#add-to-cart-form"> {% endif %} {% else %} <input type="submit" name="add" class="btn" {% if settings.enable_multilang %}data-translate="products.product.unavailable"{%endif%} id="product-add-to-cart" disabled value="{{ 'products.product.unavailable' | t }}" > {% endif %} {% if section.settings.display_product_detail_share %} <a class="icon-share" href="javascript:void(0)" aria-label="{{ 'products.product.share' | t }}" {% if settings.enable_multilang %}data-translate="products.product.share" {%endif%}>{% render 'icon-share' %}</a> {% endif %} </div> </div>
Can someone help me to fix it?
Thank you in advance.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025