Exemplo n.º 1
0
 /**
  * Verifies if the chart has a kind of determined product
  *
  * @param integer|\Gabrieljmj\Cart\Product\ProductInterface $product
  * @return boolean
  */
 public function has($product)
 {
     return $product instanceof ProductInterface ? isset($this->products[$product->getId()]) : isset($this->products[$product]);
 }
Exemplo n.º 2
0
 /**
  * Returns the price of all products summed
  *
  * @return integer
  */
 public function getPrice()
 {
     return $this->product->getPrice() * $this->amount;
 }