How to hide qunatities from the line item on the checkout.

How to hide qunatities from the line item on the checkout.

fenil
Shopify Partner
2 0 0

Hii,

I wanted to hide the quantities from the cart line item on the checkout page to fulfill my requirement. Is there any way to hide the quantity on the checkout page? It would be helpful if we could achieve this using the extension or any other way.

Screenshot_6.png

 

 

Thanks!

Replies 2 (2)

Sebashish
Shopify Partner
8 0 3

On extension you can not do that. But if you want to show the quantity as 1 or desired quantity as per your requirement, then you can always update the line item quantity using the cart line change graphql mutation.

Dotsquares
Shopify Partner
110 4 11

Hi @fenil ,

 

There are two methods to implement this:


Method 1: Product-Specific Template Overrides

 

Create conditional logic in cart templates to target products by handle, tag, or collection:

Duplicate cart template:

Navigate to Sections/main-cart-items.liquid

 

Identify the <quantity-input> block (typically lines 150–180)2

Implement handle-based exclusion:

{% assign target_handles = "product-handle-1,product-handle-2" | split: "," %}  
<td class="cart-item__quantity">  
  {% unless target_handles contains item.product.handle %}  
    <quantity-input class="quantity">  
      <!-- Default quantity selector code -->  
    </quantity-input>  
  {% endunless %}  
</td>  

This preserves quantity inputs except for specified products.

 

Method 2: CSS Visibility Control

 

Inject theme-specific CSS via theme.scss.liquid:

/* Hide quantity for products tagged 'no-quantity' */
[data-product-tags~="no-quantity"] .quantity__input {
display: none !important;
}

/* Remove +/- buttons */
[data-product-tags~="no-quantity"] .quantity__button {
visibility: hidden;
}

This non-destructive approach maintains cart functionality while hiding UI elements

 

Hope this helps, let me know if you need more help.

 

Regards,

Dotsquares Ltd


Problem Solved? ✔ Accept and Like solution to help future merchants.


Shopify Partner Directory | Trustpilot | Portfolio