Reputation: 1699
I have a jQuery Shopping Cart script I just bought. It is great, but I need to modify it a little bit.
As you can see, there's custom attributes that are set in the JS code. Right now, "minimum" and "price" are custom attributes, but I would add the "gap" attribute. So what I need is :
1- To be able to set the "quantity gap". By that I mean :
if (custom attribute of the product ul)gap="1"...then when add more of this item, go up by 1 in the shoppping cart
if gap="2"...then go up by 2
if gap="3"...then go up by 3...
and so on. You get the idea.
Here's the JSFiddle : http://jsfiddle.net/dSj5U/
I have copied the whole Javascript part, and a part of the HTML. So don't look at the HTML render...it's just for you to see how it works.
This is very important for us, since we are working on a big project using this shopping cart. We would highly appreciate if someone could help.
Thank you!
Upvotes: 1
Views: 571
Reputation: 1699
I have found it by myself.
I added the "gap" custom attribute, and then added :
if(v < settings.productBuyLimit) v += g;
"g" being "gap: parseFloat(product.attr('gap'+option))
"v" being the cart_item.quantity
Upvotes: 1