How to hide available stock quantity on checkout quantity field

MeltemSarac
New Member
3 0 0

Hi,

The available stock quantity is not being displayed on my entire website. I want to hide the stock quantity from the end-users. However, when the customer changes the quantity on the checkout and if the indicated quantity is more than the actual stock quantity, then the field decreases the quantity to the available stock quantity.

Therefore, end-user sees the available stock quantity on the checkout page if enters more quantity into the field. (The quantity field shows the available stock quantity.) 

What I would like to do is not the decrease the quantity to the available stock quantity. It would be better if the field displays 1 instead of showing the stock quantity.

Is there anyone who faced with this issue before? 

Thanks,

Meltem

Reply 1 (1)
MeltemSarac
New Member
3 0 0

cart-template.liquid contains the following code: 

 

<td class="cart__quantity-td text-right small--hide">
                <div class="cart__qty">
                  <label for="updates_large_{{ item.key }}" class="cart__qty-label" data-quantity-label-desktop>{{ 'cart.label.quantity' | t }}</label>
                  <input id="updates_large_{{ item.key }}" class="cart__qty-input" type="number"
                    name="updates[]" value="{{ item.quantity }}" min="0" pattern="[0-9]*"
                    data-quantity-input data-quantity-item="{{ forloop.index }}" data-quantity-input-desktop>
                </div>
                <div class="cart__qty-error-message-wrapper cart__qty-error-message-wrapper--desktop hide" role="alert" data-cart-quantity-error-message-wrapper>
                  <span class="visually-hidden">{{ 'general.accessibility.error' | t }} </span>
                  {% include 'icon-error' %}
                  <span class="cart__qty-error-message" data-cart-quantity-error-message></span>
                </div>
              </td>

 

 

Could you please tell me how to change it? I tried to change it a little but did not work it out. 

Thanks.