Disable quantity selector on cart page

Solved
DM_Cam
Tourist
6 0 0

I am building a store for a client, and I am looking for a way to remove the ability to change the quantity of an item from within the shopping cart. I figured out how to remove the selector entirely but am looking to keep it visible if possible. This is using the minimal theme, the CSS for the selector is as follows:

<div class="grid__item one-quarter one-half medium-down--one-third text-center">
<label for="updates_{{ item.key }}" class="cart__mini-labels">{{ 'cart.label.quantity' | t }}</label>
<input type="number" class="cart__quantity-selector" name="updates[]" id="updates_{{ item.key }}" value="{{ item.quantity }}" min="0" aria-label="{{ 'cart.label.quantity' | t }}">
</div>

0 Likes
JHKCreate
Shopify Partner
2499 412 595

This is an accepted solution.

Add readonly just before the closing tag of the <input>. 

Updated code below:

<div class="grid__item one-quarter one-half medium-down--one-third text-center">
<label for="updates_{{ item.key }}" class="cart__mini-labels">{{ 'cart.label.quantity' | t }}</label>
<input type="number" class="cart__quantity-selector" name="updates[]" id="updates_{{ item.key }}" value="{{ item.quantity }}" min="0" aria-label="{{ 'cart.label.quantity' | t }}" readonly>
</div>


Let me know if that works! 

- Did we solve your issue? Like & Mark As Solution to help the community
- Should you need any direct help: contact@jhkcreate.com
DM_Cam
Tourist
6 0 0

That worked perfectly, thank you so much!

0 Likes
petiteviemasks
Tourist
4 0 1

Hi I have the same issue. I have a Debut theme, can you please walk me step by step where I can put this code? 

 

Thank you!

0 Likes