0

On product bundle product Qty increment buttons not working in magneto2 code mentioned below:enter code here

 <div class="cart_contain">
      <div class="addtocart_container">
    <?php if ($block->shouldRenderQuantity()): ?>
    <span class="span_qty" ><?= /* @escapeNotVerified */ __('QTY') ?>:</span>
                 <div class="product-qty">

                    <input type="number"
                   name="qty"
                   id="qty"
                   value="<?= /* @escapeNotVerified */ $block->getProductDefaultQty() * 1 ?>"
                   title="<?= /* @escapeNotVerified */ __('Qty') ?>"
                   class="input-text qty"
                   data-validate="<?= $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"
                   />
                    <input class="qty-increase" type="button" value=" " onclick="var qty_el = document.getElementById('qty'); var qty = qty_el.value; if( !isNaN( qty )) qty_el.value++;return false;">
                    <input class="qty-decrease" type="button" value=" " onclick="var qty_el = document.getElementById('qty'); var qty = qty_el.value; if( !isNaN( qty ) && qty > 1 ) qty_el.value--;return false;">
                  </div>



                <?php endif; ?>
                <div class="btn">
                    <button type="submit"
                            title="<?= /* @escapeNotVerified */ $buttonTitle ?>"
                            class="action primary tocart btn-cart-prod"
                            id="product-addtocart-button"
                            onclick = "show()">
                        <span class="product-addtocart-button"><?= /* @escapeNotVerified */ $buttonTitle ?></span>
                    </button>
                    <?= $block->getChildHtml('', true) ?>
                </div>
      </div>
    </div>

</div>

  • on simple products its working fine increment button working but only when i open bundle product its not working – Junaid Ashfaq Mar 25 at 10:23

Your Answer

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

Browse other questions tagged or ask your own question.