dimi78 Posted March 27, 2008 Posted March 27, 2008 Hi, I'm trying to get and add to cart at the bottom and the top of my product page. example So far I got this to work fine, I had some trouble configuring the correct amount. It always took wat was filled in at the bottom of the page. case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { if ($_POST['quantity1'] > 1) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+(empty($_POST['quantity1']) ? 1 : intval($_POST['quantity1'])), $HTTP_POST_VARS['id']); } else { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+(empty($_POST['quantity']) ? 1 : intval($_POST['quantity'])), $HTTP_POST_VARS['id']); } } I renamed the input field to quantity1 and changed the code in application_top.php I have the same problem with the product attributes, if I choose a strawberry flavour on top an hit the addtocart button then it just takes what was filled in at the bottom. But I can't figure out how to correct this. Is their anyone who can help me on this one.
dimi78 Posted March 27, 2008 Author Posted March 27, 2008 I fixed this in my product page I added a 2nd form and have it the action add_product1 I copied the code place below in the application top with one change case 'add_product1' works fine now. Thx for helping me search. Hi, I'm trying to get and add to cart at the bottom and the top of my product page. example So far I got this to work fine, I had some trouble configuring the correct amount. It always took wat was filled in at the bottom of the page. case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { if ($_POST['quantity1'] > 1) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+(empty($_POST['quantity1']) ? 1 : intval($_POST['quantity1'])), $HTTP_POST_VARS['id']); } else { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+(empty($_POST['quantity']) ? 1 : intval($_POST['quantity'])), $HTTP_POST_VARS['id']); } } I renamed the input field to quantity1 and changed the code in application_top.php I have the same problem with the product attributes, if I choose a strawberry flavour on top an hit the addtocart button then it just takes what was filled in at the bottom. But I can't figure out how to correct this. Is their anyone who can help me on this one.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.