Skip to content

Commit 94fadc8

Browse files
committed
Ignore item qty validation if zero qty entered in grouped product
1 parent 52bd8e8 commit 94fadc8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

app/code/Magento/GroupedProduct/view/frontend/templates/product/view/type/grouped.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
5757
class="input-text qty"
5858
data-validate="<?= $block->escapeHtmlAttr($viewModel->getQuantityValidators($_item->getId(), $_item->getWebsiteId())) ?>"
59+
data-no-validation-for-zero-qty="true"
5960
data-errors-message-box="#validation-message-box"/>
6061
</div>
6162
<?php else: ?>

lib/web/mage/validation.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,9 @@ define([
16431643
isQtyIncrementsValid = typeof params.qtyIncrements === 'undefined' ||
16441644
resolveModulo(qty, $.mage.parseNumber(params.qtyIncrements)) === 0.0;
16451645

1646+
if ($(element).data('no-validation-for-zero-qty') === true && qty === 0) {
1647+
return true;
1648+
}
16461649
result = qty > 0;
16471650

16481651
if (result === false) {

0 commit comments

Comments
 (0)