How can we initially disable quantity box (read-only) of mini cart and enable it while clicking edit link for each separate product ?

enter image description here


As stated my Mahalakshmi the file of interest is


Make a copy of this file into your custom theme so file is overridden e.g.


You can then make some basic modifications to this file outlined below.

Disable the Quantity Box

Add disabled attribute to the input box like below:

<input data-bind="attr: {
                       id: 'cart-item-'+item_id+'-qty',
                       'data-cart-item': item_id,
                       'data-item-qty': qty,
                       'data-cart-item-id': product_sku
                       }, value: qty"
                       class="item-qty cart-item-qty">

This was around line 74 for me on version 2.2.1.

Add logic to enable quantity box

                <a data-bind="attr: {onclick: 'document.getElementById(\'cart-item-'+item_id+'-qty\').disabled = false;'}" class="action edit">
                    <span data-bind="i18n: 'Edit'"></span>

I replaced the data-bind attribute with a new action here to enable the quantity box in relation to the quantity that needed to be edited. This was at about line 98 for me.

  • It is working like charm.. Thanks Brother.... – Vishal Tanna Jan 4 '18 at 9:24
  • 1
    Glad to be of assistance! – harri Jan 4 '18 at 9:24

you need to refer qty details in this file

  • Here we have to disable and enable text-box while click on EDIT Link. – Vishal Tanna Jan 4 '18 at 8:40
  • 3
    It is not recommended to edit core file directly. – Kishan Patadia Jan 4 '18 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.