ramin Posted January 23, 2013 Share Posted January 23, 2013 Hi, I want to make Cart order list empty after a new product has been added to the cart. In fact only on product every time can be in cart. Tanx Link to comment Share on other sites More sharing options...
ramin Posted January 24, 2013 Author Share Posted January 24, 2013 can some body help? Link to comment Share on other sites More sharing options...
ramin Posted January 24, 2013 Author Share Posted January 24, 2013 (edited) i used this code on method Add in cart.php class : $products = $this->getProducts(); foreach ($products as $product) { $this->deleteProduct($product->id); } but it doesn't work. Edited January 24, 2013 by ramin (see edit history) Link to comment Share on other sites More sharing options...
mebjas Posted January 29, 2013 Share Posted January 29, 2013 i m also looking for this stuff Link to comment Share on other sites More sharing options...
Krystian Podemski Posted January 30, 2013 Share Posted January 30, 2013 Maybe $cart->delete();? Link to comment Share on other sites More sharing options...
mebjas Posted January 30, 2013 Share Posted January 30, 2013 but where to add these Link to comment Share on other sites More sharing options...
Krystian Podemski Posted January 30, 2013 Share Posted January 30, 2013 1. Button like: <a href="cart.php?empty">Empty basket</a> 2. In for example init() function in CartController check is there isset "empty" and if isset do: $cart = new Cart($id_cart_from_cookie); $cart->delete(); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now