pickles/common/modules/store/cart/empty.php
Josh Sherman c6af785100 Latest and greatest.
git-svn-id: http://svn.cleancode.org/svn/pickles@85 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-12-31 02:45:40 +00:00

30 lines
502 B
PHP

<?php
/**
* Empties the cart
*
* Removes all the items from the cart completely
*
* @package PICKLES
* @subpackage store
* @author Joshua Sherman <josh@phpwithpickles.org>
* @copyright 2008 Joshua Sherman
*/
class store_cart_empty extends store {
public function __default() {
// Unsets the products array if products are there.
if (isset($_SESSION['cart'])) {
unset($_SESSION['cart']);
}
// Redirect to the cart
header('Location: /store/cart');
exit();
}
}
?>