/** * add a product to the cart * * @param timpanyProductInterface $product * @param int $count */ public function addProduct(timpanyProductInterface $product, $count = 1) { if (false == array_key_exists($product->getIdentifier(), $this->_items)) { $this->_items[$product->getIdentifier()] = new timpanyCartItem(); $this->_items[$product->getIdentifier()]->setCount($count)->setProductData($product->toCartItem()); } else { $this->_items[$product->getIdentifier()]->increaseCount($count); } }