Skip to content

Commit dcf2504

Browse files
committed
MC-42249: No form validation for negative quantity on bundle products
- Fixed the CR comments.
1 parent 2125d61 commit dcf2504

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/Bundle/view/base/web/js/price-bundle.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,12 @@ define([
388388
var isValid = true,
389389
qtyElem = bundleOption.data('qtyField'),
390390
bundleOptionType = bundleOption.prop('type'),
391-
qtyValidator = typeof qtyElem.data('validate') === 'object' ?
392-
qtyElem.data('validate')['validate-item-quantity'] : '';
391+
qtyValidator = qtyElem.data('validate') &&
392+
typeof qtyElem.data('validate')['validate-item-quantity'] === 'object' ?
393+
qtyElem.data('validate')['validate-item-quantity'] : null;
393394

394395
if (['radio', 'select-one'].includes(bundleOptionType) &&
396+
qtyValidator &&
395397
(qtyElem.val() < qtyValidator.minAllowed || qtyElem.val() > qtyValidator.maxAllowed)
396398
) {
397399
isValid = false;

0 commit comments

Comments
 (0)