Skip to content
Browse files

Fix a php notice for undefined index id when adding a product without…

… attributes to the cart
  • Loading branch information...
1 parent 33f5c20 commit d40e07c337458aca8a5cd00db246cb006d31a790 @markkevans markkevans committed with haraldpdl Oct 24, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 catalog/includes/application_top.php
View
3 catalog/includes/application_top.php
@@ -333,7 +333,8 @@
break;
// customer adds a product from the products page
case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
- $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
+ $attributes = isset($HTTP_POST_VARS['id']) ? $HTTP_POST_VARS['id'] : '';
+ $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;

0 comments on commit d40e07c

Please sign in to comment.
Something went wrong with that request. Please try again.