Here is my script:
//event handler for item quantity in shopping cart function itemQuantityHandler(p, a) { //get current quantity from cart var filter = /(\w+)::(\w+)/.exec(p.id); var cart_item = cart[filter[1]][filter[2]]; var v = cart_item.quantity; //add one if (a.indexOf('add') != -1) { if(v < settings.productBuyLimit) v++; } //substract one if (a.indexOf('subtract') != -1) { if (v > 1) v--; } //update quantity in shopping cart $(p).find('.item-quantity').text(v); //save new quantity to cart cart_item.quantity = v; //update price for item $(p).find('.item-price').text((cart_item.price*v).toFixed(settings.numberPrecision)); //update total counters countCartTotal(); }
I need to increase the "v" (cart_item.quantity) by more than one. Here it uses "v ++" ... but it only increases by 1. How can I change this to increase it by 4 every time I click the plus sign?
I tried
v++ +4
But it does not work.
Thanks!
source share