| 
<?php
include("sCart.php");
 $cart = new sCart();
 
 // register cart to session (optional)
 // session_start();
 // session_register("cart");
 
 // add a new product into the cart
 $cart->add_item(123, "Productname", 1, 6.95, 16, array("other descriptions"));
 
 // show all products from the cart
 if($cart->show())
 {
 while($values = $cart->show_next_item())
 {
 print_r($values);
 }
 }
 
 // show sum of all products from the cart
 if($values = $cart->sum())
 {
 print_r($values);
 }
 
 // update an product of the cart
 $cart->update_item(123, 10);
 
 // remove an product of the cart
 $cart->remove_item(123);
 
 // clear complete cart
 $cart->clear();
 ?>
 |