Jump to content

Cart problems


anevins

Recommended Posts

Hello,

I'm trying to implement a function called 'delete_cart' but I can't seem to get it working.

 

Here's the function code:

function delete_cart(){
	unset($_SESSION['cart']);
}

 

Here's the HTML / php code:

if (!empty($_SESSION['cart'])) {
                echo '<a href="index.php?p=cart?delete_cart=true">delete cart</a>  ';
            }

 

When you click on 'delete cart', the page just refreshes to the home page and I am able to re-visit that same cart with the same items in.

 

I've also noticed when I log out, the shopping cart is deleted.

Link to comment
https://forums.phpfreaks.com/topic/231838-cart-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.