Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function writeShoppingCart() {
- $cart = $_SESSION['cart'];
- if (!$cart) {
- return '<p>You have no items in your shopping cart</p>';
- } else {
- // Parse the cart session variable
- $items = explode(',',$cart);
- $s = (count($items) > 1) ? 's':'';
- return '<p>You have <a href="cart.php">'.count($items).' item'.$s.' in your shopping cart</a></p>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement