Created
May 25, 2017 11:20
-
-
Save rintoug/d8ae3577ca88c5ed0565c03229ead585 to your computer and use it in GitHub Desktop.
Simple PHP Shopping Cart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Empty All | |
if($action=='emptyall') { | |
$_SESSION['products'] =array(); | |
header("Location:shopping-cart.php"); | |
} | |
//Empty one by one | |
if($action=='empty') { | |
$sku = $_GET['sku']; | |
$products = $_SESSION['products']; | |
unset($products[$sku]); | |
$_SESSION['products']= $products; | |
header("Location:shopping-cart.php"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment