Skip to content

Commit df1c97a

Browse files
committed
ACP2E-3710: refactored fix as to allow only product to be select from grouped options
1 parent 3bf65d3 commit df1c97a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/web/mage/validation/validation.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,20 @@ define([
1515
function (value, element) {
1616
let inputValue = parseFloat($(element).val()) || 0;
1717

18-
return inputValue > 0;
18+
if (inputValue < 0) {
19+
return false;
20+
}
21+
22+
// eslint-disable-next-line one-var
23+
let $allInputs = $(element)
24+
.closest('.fieldset')
25+
.find('input[data-validate*="validate-grouped-qty"]');
26+
27+
if ($allInputs.first().is(element)) {
28+
return $allInputs.toArray().some(input => parseFloat($(input).val()) > 0);
29+
}
30+
31+
return true;
1932
},
2033
$.mage.__('Please specify the quantity of product(s).')
2134
],

0 commit comments

Comments
 (0)