/** * Deletes a product from the shopping cart * * @param SxCms_Product $product * @return SxCms_Cart */ public function deleteProduct(SxCms_Product $product) { $product->loadState(); if (isset($this->products[$product->getId()])) { $total = $this->products[$product->getId()]['qty'] * $product->getPrice(); $this->total -= $total; unset($this->products[$product->getId()]); } return $this; }