0

How can i increase quantity 12 by 12 instead of 1 by 1 for specific categories? Magento 1 had an option in product page but i couldnt find anything about it on Magento 2.

I can set minimum qty allowed in shopping cart, and also qty increments can be set in backend. But when the customer clicks on the increase button it makes 12 to 13. I want it to become 24 in one click.

0

1 Answer 1

0

Let me share the process i got so far;

In, app/design/frontend/MyTheme/Magento_Catalog/templates/product/view -> addtocart.phtml i found something like:

<div class="qty-ctl">
                    <button title="<?= __('Decrease') ?>" type="button" data-role="change_cart_qty" class="decrease" data-qty="-1" class="decrease"></button>
                </div>
                <input type="number" class="qty" name="qty" id="qty" maxlength="12" value="<?= $block->getProductDefaultQty() * 1 ?>" title="<?php echo __('Qty') ?>" class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>" />
                <div class="qty-ctl">
                    <button title="<?= __('Increase') ?>" type="button" data-role="change_cart_qty" data-qty="1" class="increase"></button>
                </div>

Then changed both "data-qty" to "-12" & "12" now it is working. Only one thing left. I want to specialize it according to category. Lets say i have a Bulk Category (ID:22) and i want these increment to apply only in this category.

Your Answer

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

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