My script was working perfectly fine for ages then this error cropped up saying I have an undefined index that won't allow me to add products to my shopping cart.
PHP: Notice 'undefined index: product_name in C:\xampp\htdocs\Autoparts Warehouse2\grilles.php on line 243
if(isset($_SESSION["cart_products"]) && count($_SESSION["cart_products"])>0) {
echo ' ';
echo ' Your Shopping Cart ';
echo ' ';
echo '';
echo '';
$total =0;
$b = 0;
foreach ($_SESSION["cart_products"] as $cart_itm)
print_r($cart_itm); {
$product_name = $cart_itm["product_name"];
$product_qty = $cart_itm["product_qty"];
$product_price = $cart_itm["product_price"];
$product_code = $cart_itm["product_code"];
$product_color = $cart_itm["product_color"];
I have tried using $_POST
and $_GET
also but to neither have worked any help would be greatly appreciated. Thanks.