function getTotal()
 {
     $total = 0;
     $items = parent::toArray();
     foreach ($items as $id => $quantity) {
         $total += $this->product[$id]['price'] * $quantity;
     }
     return $total;
 }
 /**
  *	This function will return the item's quantity in the cart.
  *
  *  @param $id	Product ID.
  *
  *  @returns	The item's quantity in the cart.
  */
 function getItem($id)
 {
     if ($this->inCart($id)) {
         return YDCart::decrypt($this->item[YDCart::encrypt($id)]);
     }
     return 0;
 }