array(
'testname' => $name,
'price' => $price,
'code' => $code,
'quantity' => 1,
'image' => $packimage
)
);
if (empty($_SESSION["shopping_cart"])) {
$_SESSION["shopping_cart"] = $cartArray;
$status = "
Product is added to your cart!
";
} else {
$array_keys = array_keys($_SESSION["shopping_cart"]);
if (in_array($code, $array_keys)) {
$status = "
Product is already added to your cart!
";
} else {
$_SESSION["shopping_cart"] = array_merge($_SESSION["shopping_cart"], $cartArray);
$status = "
Product is added to your cart!
";
}
}
}
?>