You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
cosmopet.ae/wp-content/themes/woodmart22/js/scripts/wc/woocommerceQuantity.min.js

1 lines
871 B

!function(a){woodmartThemeModule.woocommerceQuantity=function(){String.prototype.getDecimals||(String.prototype.getDecimals=function(){var a=this,b=(""+a).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return b?Math.max(0,(b[1]?b[1].length:0)-(b[2]?+b[2]:0)):0}),woodmartThemeModule.$document.on("click",".plus, .minus",function(){var b=a(this),c=b.closest(".quantity").find(".qty"),d=parseFloat(c.val()),e=parseFloat(c.attr("max")),f=parseFloat(c.attr("min")),g=c.attr("step");d&&""!==d&&"NaN"!==d||(d=0),""!==e&&"NaN"!==e||(e=""),""!==f&&"NaN"!==f||(f=0),"any"!==g&&""!==g&&void 0!==g&&"NaN"!=parseFloat(g)||(g="1"),b.is(".plus")?e&&d>=e?c.val(e):c.val((d+parseFloat(g)).toFixed(g.getDecimals())):f&&d<=f?c.val(f):d>0&&c.val((d-parseFloat(g)).toFixed(g.getDecimals())),c.trigger("change")})},a(document).ready(function(){woodmartThemeModule.woocommerceQuantity()})}(jQuery);