| @@ 302-310 (lines=9) @@ | ||
| 299 | */ |
|
| 300 | public function addProduct($ProductClass, $quantity = 1) |
|
| 301 | { |
|
| 302 | if (!$ProductClass instanceof ProductClass) { |
|
| 303 | $ProductClassId = $ProductClass; |
|
| 304 | $ProductClass = $this->entityManager |
|
| 305 | ->getRepository(ProductClass::class) |
|
| 306 | ->find($ProductClassId); |
|
| 307 | if (is_null($ProductClass)) { |
|
| 308 | return false; |
|
| 309 | } |
|
| 310 | } |
|
| 311 | ||
| 312 | $ClassCategory1 = $ProductClass->getClassCategory1(); |
|
| 313 | if ($ClassCategory1 && !$ClassCategory1->isVisible()) { |
|
| @@ 334-342 (lines=9) @@ | ||
| 331 | ||
| 332 | public function removeProduct($ProductClass) |
|
| 333 | { |
|
| 334 | if (!$ProductClass instanceof ProductClass) { |
|
| 335 | $ProductClassId = $ProductClass; |
|
| 336 | $ProductClass = $this->entityManager |
|
| 337 | ->getRepository(ProductClass::class) |
|
| 338 | ->find($ProductClassId); |
|
| 339 | if (is_null($ProductClass)) { |
|
| 340 | return false; |
|
| 341 | } |
|
| 342 | } |
|
| 343 | ||
| 344 | $removeItem = new CartItem(); |
|
| 345 | $removeItem->setPrice($ProductClass->getPrice02IncTax()); |
|