/** * Check an item exist or not. * @param $id * * @return boolean */ public function has($id) { $this->collection->setItems($this->session->get($this->getCart(), [])); return $this->collection->findItem($id) ? true : false; }