@@ -107,6 +107,7 @@ define([
107
107
changes = defaultGetOptionValue ( bundleOption , this . options . optionConfig ) ; //eslint-disable-line
108
108
}
109
109
110
+ // eslint-disable-next-line no-use-before-define
110
111
if ( checkIsValidateQty ( bundleOption ) ) {
111
112
if ( changes ) {
112
113
priceBox . trigger ( 'updatePrice' , changes ) ;
@@ -134,6 +135,7 @@ define([
134
135
. selections [ field . data ( 'optionValueId' ) ] ;
135
136
optionConfig . qty = field . val ( ) ;
136
137
138
+ // eslint-disable-next-line no-use-before-define
137
139
if ( checkIsValidateQty ( optionInstance ) ) {
138
140
optionInstance . trigger ( 'change' ) ;
139
141
}
@@ -380,15 +382,16 @@ define([
380
382
/**
381
383
* Check the quantity field if negative value occurs.
382
384
*
383
- * @param bundleOption
385
+ * @param { Object } bundleOption
384
386
*/
385
- function checkIsValidateQty ( bundleOption )
386
- {
387
+ function checkIsValidateQty ( bundleOption ) {
387
388
var isValid = 0 ,
388
- qtyElem = bundleOption . data ( 'qtyField' ) ;
389
- if ( bundleOption . prop ( 'type' ) === 'radio' || bundleOption . prop ( 'type' ) === 'select-one' ) {
390
- if ( qtyElem . val ( ) >= qtyElem . data ( 'validate' ) [ 'validate-item-quantity' ] . minAllowed
391
- && qtyElem . val ( ) <= qtyElem . data ( 'validate' ) [ 'validate-item-quantity' ] . maxAllowed
389
+ qtyElem = bundleOption . data ( 'qtyField' ) ,
390
+ bundleOptionType = bundleOption . prop ( 'type' ) ;
391
+
392
+ if ( bundleOptionType === 'radio' || bundleOptionType === 'select-one' ) {
393
+ if ( qtyElem . val ( ) >= qtyElem . data ( 'validate' ) [ 'validate-item-quantity' ] . minAllowed &&
394
+ qtyElem . val ( ) <= qtyElem . data ( 'validate' ) [ 'validate-item-quantity' ] . maxAllowed
392
395
) {
393
396
isValid = 1 ;
394
397
}
0 commit comments