Multi-product Add to Cart with Same Product Listed Twice

General ShopSite user discussion

Multi-product Add to Cart with Same Product Listed Twice

Postby drigler » Fri Apr 10, 2009 10:38 am

This is the second of two posts regarding a problem we are having with our single-page order form. I would like to list the same product under more than one category on our form. However, this results in an error when the customer clicks “Add to Cart”. Is this a known limitation of Multi-product Add to Cart forms? Here is a sample test case:
http://www.jewishcard.com/shopping/Sing ... Test2.html
Note that you don’t even have to add either of the products that are listed twice to your cart – you will still get an error.
I am using the standard code:
<form name="OrderForm" action="http://www.jewishcard.com/shopsite/sc/order.cgi" method=post>
<input type=hidden name=storeid value=[our store id]>
<input type=hidden name=dbname value=products>
<input type=hidden name=function value=add>

<input type=image src="media/addtocart.jpg" hspace=3 vspace=3 align="top" name="Add_to_Cart" alt="Add to Cart">

Followed by a series of:

<input type=checkbox name="itemnum" value=39>
<input type=text size=2 name="39:qnty" value=5>

And finally:

</form>

Thanks!
drigler
 
Posts: 14
Joined: Sun Jan 11, 2009 1:47 am

Postby Jim » Fri Apr 10, 2009 1:25 pm

Yes you should only have the product listed once in the form otherwise you have conflicting input values.

You would have for example a
<input type=checkbox name="itemnum" value=39>
with a value of checked
<input type=checkbox name="itemnum" value=39>
with the value of unchecked.

How is the form suppose to know which one to use?


If you want to have the same item on the page more than once you would have to have each one in a separate form so only one will be submitted at a time. This would require having multiple add to cart buttons one in each section of the page where the item is located.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby drigler » Fri Apr 10, 2009 3:17 pm

OK, thanks. I just assumed if the box was checked anywhere, it would be added to the cart. I realize that's not a good assumption to make in all cases, for all stores! Thank you for your response.
drigler
 
Posts: 14
Joined: Sun Jan 11, 2009 1:47 am


Return to User Forum

Who is online

Users browsing this forum: No registered users and 128 guests