jQuery(function($){$("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<span class="plus kt-spin-button kt-icon-angle-up" /></span').prepend('<span class="minus kt-spin-button kt-icon-angle-down" /></span>'),$(document).on("updated_cart_totals",function(){$("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<span class="plus kt-spin-button kt-icon-angle-up" /><span>').prepend('<span class="minus kt-spin-button kt-icon-angle-down" /></span>')}),$(document).on("click",".plus, .minus",function(){var t=$(this).closest(".quantity").find(".qty"),a=parseFloat(t.val()),n=parseFloat(t.attr("max")),s=parseFloat(t.attr("min")),d=t.attr("step");a&&""!==a&&"NaN"!==a||(a=0),""!==n&&"NaN"!==n||(n=""),""!==s&&"NaN"!==s||(s=0),"any"!==d&&""!==d&&void 0!==d&&"NaN"!==parseFloat(d)||(d=1),$(this).is(".plus")?n&&(n==a||a>n)?t.val(n):t.val(a+parseFloat(d)):s&&(s==a||a<s)?t.val(s):a>0&&t.val(a-parseFloat(d)),t.trigger("change")})});