Miscellany
public text v1 · immutable<?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);