SHARE
TWEET

woocommerce jquery-quantity-increment.min.js

BackuPs-nl Nov 16th, 2018 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(function(i){function t(){i("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />')}String.prototype.getDecimals||(String.prototype.getDecimals=function(){var t=(""+this).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}),i(document).on("updated_wc_div",function(){t()}),i(document).on("cart_page_refreshed",function(){t()}),i(document).on("click",".plus, .minus",function(){var t=i(this).closest(".quantity").find(".qty"),a=parseFloat(t.val()),e=parseFloat(t.attr("max")),n=parseFloat(t.attr("min")),o=t.attr("step");a&&""!==a&&"NaN"!==a||(a=0),""!==e&&"NaN"!==e||(e=""),""!==n&&"NaN"!==n||(n=0),"any"!==o&&""!==o&&void 0!==o&&"NaN"!==parseFloat(o)||(o=1),i(this).is(".plus")?e&&e<=a?t.val(e):t.val((a+parseFloat(o)).toFixed(o.getDecimals())):n&&a<=n?t.val(n):0<a&&t.val((a-parseFloat(o)).toFixed(o.getDecimals())),t.trigger("change")}),t()});
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top