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 204204 return empty === 0 ;
205205 }
206206
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+
207222 /**
208223 * Collection of validation rules including rules from additional-methods.js
209224 * @type {Object }
16141629 isMaxAllowedValid = typeof params . maxAllowed === 'undefined' ||
16151630 qty <= $ . mage . parseNumber ( params . maxAllowed ) ,
16161631 isQtyIncrementsValid = typeof params . qtyIncrements === 'undefined' ||
1617- qty % $ . mage . parseNumber ( params . qtyIncrements ) === 0 ;
1632+ resolveModulo ( qty , $ . mage . parseNumber ( params . qtyIncrements ) ) === 0. 0;
16181633
16191634 result = qty > 0 ;
16201635
You can’t perform that action at this time.
0 commit comments