| @@ 313-321 (lines=9) @@ | ||
| 310 | */ |
|
| 311 | public function addProduct($ProductClass, $quantity = 1) |
|
| 312 | { |
|
| 313 | if (!$ProductClass instanceof ProductClass) { |
|
| 314 | $ProductClassId = $ProductClass; |
|
| 315 | $ProductClass = $this->entityManager |
|
| 316 | ->getRepository(ProductClass::class) |
|
| 317 | ->find($ProductClassId); |
|
| 318 | if (is_null($ProductClass)) { |
|
| 319 | return false; |
|
| 320 | } |
|
| 321 | } |
|
| 322 | ||
| 323 | $ClassCategory1 = $ProductClass->getClassCategory1(); |
|
| 324 | if ($ClassCategory1 && !$ClassCategory1->isVisible()) { |
|
| @@ 345-353 (lines=9) @@ | ||
| 342 | ||
| 343 | public function removeProduct($ProductClass) |
|
| 344 | { |
|
| 345 | if (!$ProductClass instanceof ProductClass) { |
|
| 346 | $ProductClassId = $ProductClass; |
|
| 347 | $ProductClass = $this->entityManager |
|
| 348 | ->getRepository(ProductClass::class) |
|
| 349 | ->find($ProductClassId); |
|
| 350 | if (is_null($ProductClass)) { |
|
| 351 | return false; |
|
| 352 | } |
|
| 353 | } |
|
| 354 | ||
| 355 | $removeItem = new CartItem(); |
|
| 356 | $removeItem->setPrice($ProductClass->getPrice02IncTax()); |
|