| @@ 330-338 (lines=9) @@ | ||
| 327 | */ |
|
| 328 | public function addProduct($ProductClass, $quantity = 1) |
|
| 329 | { |
|
| 330 | if (!$ProductClass instanceof ProductClass) { |
|
| 331 | $ProductClassId = $ProductClass; |
|
| 332 | $ProductClass = $this->entityManager |
|
| 333 | ->getRepository(ProductClass::class) |
|
| 334 | ->find($ProductClassId); |
|
| 335 | if (is_null($ProductClass)) { |
|
| 336 | return false; |
|
| 337 | } |
|
| 338 | } |
|
| 339 | ||
| 340 | $ClassCategory1 = $ProductClass->getClassCategory1(); |
|
| 341 | if ($ClassCategory1 && !$ClassCategory1->isVisible()) { |
|
| @@ 362-370 (lines=9) @@ | ||
| 359 | ||
| 360 | public function removeProduct($ProductClass) |
|
| 361 | { |
|
| 362 | if (!$ProductClass instanceof ProductClass) { |
|
| 363 | $ProductClassId = $ProductClass; |
|
| 364 | $ProductClass = $this->entityManager |
|
| 365 | ->getRepository(ProductClass::class) |
|
| 366 | ->find($ProductClassId); |
|
| 367 | if (is_null($ProductClass)) { |
|
| 368 | return false; |
|
| 369 | } |
|
| 370 | } |
|
| 371 | ||
| 372 | $removeItem = new CartItem(); |
|
| 373 | $removeItem->setPrice($ProductClass->getPrice02IncTax()); |
|