0
<input type="number"
                       name="qty"
                       id="qty"
                       maxlength="12"
                       placeholder="1"
                       value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>"
                       title="<?php /* @escapeNotVerified */ echo __('Qty') ?>" class="input-text qty form-control"
                       data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"
                       />

I have changed quantity from admin panel 0 to 1 it's working on the product page but it's not working on the category page please check my above code which I have used on the listing page.

This is one solution I have found but it's not working on category page

1 Answer 1

0
     <input type="number"
                   name="qty"
                   id="qty"
                   maxlength="12"
                   placeholder="1"
                   value="<?php echo ($this->getMinimalQty($_product)?$this->getMinimalQty($_product):1) ?>"
                   title="<?php /* @escapeNotVerified */ echo __('Qty') ?>" class="input-text qty form-control"
                   data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"
                   />

now its working i have changed value code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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