0

I want to add Qty field on product list page for configurable product and simple product. I am using Magento 2.3.1 can you guide me how can I do?

enter image description here

0

You just need to add input in your form.

You can put it on above Add to cart.

You can add in below file:

app/design/frontend/{Package}/{theme}/Magento_Catalog/templates/product/list.phtml

<input type="number" name="qty" id="qty" maxlength="12" value="<?php /* @escapeNotVerified */ echo '1' ?>" title="<?php /* @escapeNotVerified */ echo __('Qty') ?>" class="input-text qty" />

Hope above will help!

Reference

  • I use this code but it works only for simple product but I want to display configurable product as well. – kiran May 16 at 19:05
  • I checked it is working for configurable as well! – Pawan May 16 at 19:09
  • List.phtml is applicable for both – Pawan May 16 at 19:09
  • Hi Pawan, I want text box for each size.please see attached screenshot: imghostr.com/F2QnsQgR – kiran May 16 at 19:53
  • 1
    I need to add multiple products with multiple sizes on the Category page at once? – kiran May 17 at 13:15

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.