All pastes #401440 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-03-19 11:22 UTC
rendered paste body
<?php
// wfCart Demo

// You must included wfcart.php BEFORE you start the session. 
include "wfcart.php";
session_start();      // start the session

class TMCart extends wfCart
{
	function addTemplate($id_tm, $i_price)
	{
		echo 1;
		parent::add_item($id_tm, 1, $i_price);
	}
}

$cart =& $_SESSION['wfcart']; // point $cart to session cart.
if(!is_object($cart)) $cart = new TMCart(); // if $cart ( $_SESSION['cart'] ) isn't an object, make a new cart

$cart->addTemplate(1,2);