View Full Version : Add/Delete Items

11-21-2007, 12:54 PM
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!";
echo "You have items in your shopping cart";

11-21-2007, 04:38 PM
You really don't need to create multiple threads over this issue. I replied to this other thread with a suggestion on how to modify the way your cart is working to make deleting and adding items much easier.