| 
| Subject: | Hi, I've edited the construct... | 
|---|
 | Summary: | Package rating comment | 
|---|
 | Messages: | 1 | 
|---|
 | Author: | Christophe | 
|---|
 | Date: | 2009-08-01 00:00:18 | 
|---|
 |  |  |  | 
Christophe rated this package as follows:
| Utility: | Sufficient | 
|---|
| Consistency: | Not sure | 
|---|
| Examples: | Good | 
|---|
|  | 
  Christophe - 2009-08-01 00:00:18Hi,
 I've edited the construct function to :
 function __construct(){
 if( isset($_SESSION['cart']) ){
 $this->mArrItem = unserialize($_SESSION['cart']);
 $this->mTotal = $_SESSION['mTotal'];
 } else {
 $this->mArrItem = array();	// inititalize item to array
 $this->mTotal = 0;				// inititalize total price to 0
 }
 
 }
 
 and I've add a destruct function :
 function __destruct(){
 $_SESSION['cart'] = serialize($this->mArrItem);
 $_SESSION['mTotal'] = $this->mTotal;
 }
 
 Just to save the product !
 
 Thanks
 
 Bye
 |