Example #1
0
 /**
  * @param \Extcode\Cart\Domain\Model\Cart\Product $product
  *
  * @param array $productVariantIds
  *
  * @return bool
  */
 public function removeproduct($product, $productVariantIds = null)
 {
     if (is_array($productVariantIds)) {
         $product->removeBeVariants($productVariantIds);
         if (!$product->getBeVariants()) {
             unset($this->products[$product->getId()]);
         }
         $this->calcAll();
     } else {
         $this->subCount($product->getQuantity());
         $this->subGross($product->getGross());
         $this->subNet($product->getNet());
         $this->subTax($product->getTax(), $product->getTaxClass());
         unset($this->products[$product->getId()]);
     }
     return true;
 }