mac007 Posted December 3, 2009 Share Posted December 3, 2009 Hi, all: I need to have a form, where people can select different quantities of different products, and then submit all at once to cart. I was reading that one can use the "multiple_products_cart_quantity" form structure, so I set this code up, that has 2 product id's, but it's not working right, only added the last item. What am I doing wrong?? appreciate the help! Thanks! <form name="multiple_products_cart_quantity" action='http://www.mysite.com/shopping-carts/zen-cart/index.php?main_page=product_info&action=add_product' method='post' enctype='multipart/form-data'> <input type="text" name="cart_quantity" value="1" maxlength="6" size="4" /><br /><br /><input type="hidden" name="products_id" value="1" /> <input type="text" name="cart_quantity" value="1" maxlength="6" size="4" /><br /><br /><input type="hidden" name="products_id" value="2" /> <input type="image" src="includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" title=" Add to Cart " /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/183909-with-zencart-how-can-i-add-multiple-items-in-one-form-one-click/ Share on other sites More sharing options...
premiso Posted December 3, 2009 Share Posted December 3, 2009 Not sure how that is suppose to work (IE what the script expects) but you are naming the input boxes exactly the same, this is problematic as you have noticed. It simply sends you the last item. Look in the documentation and see what the page is expecting, either an array which would be setup like this: <input type="text" name="cart_quantity[1]" value="1" maxlength="6" size="4" /><br /><br /><input type="hidden" name="products_id[]" value="1" /> <input type="text" name="cart_quantity[2]" value="1" maxlength="6" size="4" /><br /><br /><input type="hidden" name="products_id[]" value="2" /> But really I am not sure, I would look at the FAQ or documentation for the multiple product insert and see what you need to do, as it all depends on how the zend cart handles it. Quote Link to comment https://forums.phpfreaks.com/topic/183909-with-zencart-how-can-i-add-multiple-items-in-one-form-one-click/#findComment-970870 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.