public function agregarItem(productos $producto, $cantidad) { $this->array = unserialize($_SESSION['carro']); $this->cantidad = unserialize($_SESSION['cantidad']); $this->array[$producto->get_id()] = $producto; $this->cantidad[$producto->get_id()] = $cantidad; $_SESSION['cantidad'] = serialize($this->cantidad); $_SESSION['carro'] = serialize($this->array); }