PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Dirk Herling  >  sCart  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: An example use of the sCart class
Class: sCart
Shopping basket class
Author: By
Last change:
Date: 20 years ago
Size: 844 bytes


Class file image Download
$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
$values = $cart->show_next_item())

// show sum of all products from the cart
if($values = $cart->sum())

// update an product of the cart
$cart->update_item(123, 10);

// remove an product of the cart

// clear complete cart

For more information send a message to info at phpclasses dot org.