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

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

|improve this answer|||||

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.