Posted on 20/08/2008 12:11:42
No problem.
Sebastian's example assume that you're using a form for each product displayed on the page, and you're not.
Your add-to-basket button is trying to submit a non-existing form called "79&productid=PROD6&cartcmd=add", which is what actually provokes the JavaScript error.
The trick is simply to apply the quantity parameter to the http request. You could do something like this instead:
<form name="<!--@Ecom:Product.ID-->" method="get">
<input type="hidden" name="ProductID" value="<!--@Ecom:Product.ID-->" />
<input type="hidden" name="cartcmd" value="add" />
<input type="text" name="quantity" value="1" />
</form>
Then your add-to-basket link would be <a href="javascript:void(0);" onclick="document.getElementById('<!--@Ecom:Product.Id-->').submit();">Add to basked</a>
You'll have to make a form for each product, so do this within the product collection loop in the product list template.