Developer forum

Forum » Development » Buying products from the product list

Buying products from the product list


Reply

I need to have a quantity box and an add button on every product in the product list.

How do a conect the box and the button to a product so that it takes the right product and the right quantity?


Replies

 
Reply

Anyway, adding a Quantity parameter to the query string when adding to basket will do the trick, so just add a field with that name in the form.

 

You can add multiple products with individual quantity specification to the form. The cart will sort it out when processing the request.

 
Reply
Sorensen wrote:

Anyway, adding a Quantity parameter to the query string when adding to basket will do the trick, so just add a field with that name in the form.

 

You can add multiple products with individual quantity specification to the form. The cart will sort it out when processing the request.


I have tryed but I cant get it to work.

It just adds all the quantitys together and doesn't get the product.

What could I have missed?

Could you add a sample code to better understand how to do it?

 
Reply

I solved the problem.

the form tag was outside the product loop.

Moved it inside the loop and it works fine.

 
Reply
Sorensen wrote:

Anyway, adding a Quantity parameter to the query string when adding to basket will do the trick, so just add a field with that name in the form.

 

You can add multiple products with individual quantity specification to the form. The cart will sort it out when processing the request.


 

Solved this earlier but then I just added one product at a time.

Now I ned to add multiple products and I can't seem to modify my template from just adding one product to adding multiple.

 

Could you give a short example on submiting multiple products with individual quantitys?

 

You must be logged in to post in the forum