I have the following code, that displays a message whether a users shopping cart contains items or not.
How do I add/delete items from the shopping cart, upon the appropriate product link being clicked? If a items is already in the cart, how do I display a message notifying the user?
$cart = $_SESSION['cart'];
if (!$cart)
{
echo "You have no items in your shopping cart!";
}
else
{
echo "You have items in your shopping cart";
}