File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 204
204
return empty === 0 ;
205
205
}
206
206
207
+ /**
208
+ *
209
+ * @param {float } qty
210
+ * @param {float } qtyIncrements
211
+ * @returns {float }
212
+ */
213
+ function resolveModulo ( qty , qtyIncrements ) {
214
+ while ( qtyIncrements < 1 ) {
215
+ qty *= 10 ;
216
+ qtyIncrements *= 10 ;
217
+ }
218
+
219
+ return qty % qtyIncrements ;
220
+ }
221
+
207
222
/**
208
223
* Collection of validation rules including rules from additional-methods.js
209
224
* @type {Object }
1614
1629
isMaxAllowedValid = typeof params . maxAllowed === 'undefined' ||
1615
1630
qty <= $ . mage . parseNumber ( params . maxAllowed ) ,
1616
1631
isQtyIncrementsValid = typeof params . qtyIncrements === 'undefined' ||
1617
- qty % $ . mage . parseNumber ( params . qtyIncrements ) === 0 ;
1632
+ resolveModulo ( qty , $ . mage . parseNumber ( params . qtyIncrements ) ) === 0. 0;
1618
1633
1619
1634
result = qty > 0 ;
1620
1635
You can’t perform that action at this time.
0 commit comments