I'm trying to trouble shoot some code in my new observer class. this is my first time out using the observer class and i've gone thru the 2 tuts in the wiki.
i'm trying to check for the presence of certain products (hazmat) in the cart. and if there, create avar.PHP Code:$_SESSION['hazMatOneInCart'] = TRUE
orig i have a var based on a specific product id -
var $hazMatProdOne = 115;
and then ran like below -
didn't seem to be working, and then, for testing purposes when i switched out the var $hazMatProdOne to an integer, 115 (a product id) and got an error -PHP Code:function update(&$class, $eventID, $paramsArray = array()) {
if($_SESSION['cart']->in_cart($this->hazMatProdOne)) {
//echo 'has HazMat One';
$_SESSION['hazMatOneInCart'] = TRUE;
}
}
PHP Code:function update(&$class, $eventID, $paramsArray = array()) {
if($_SESSION['cart']->in_cart($this->115)) {
$_SESSION['hazMatOneInCart'] = TRUE;
}
}


Reply With Quote

