| @@ 278-286 (lines=9) @@ | ||
| 275 | */ |
|
| 276 | public function addProduct($ProductClass, $quantity = 1) |
|
| 277 | { |
|
| 278 | if (!$ProductClass instanceof ProductClass) { |
|
| 279 | $ProductClassId = $ProductClass; |
|
| 280 | $ProductClass = $this->entityManager |
|
| 281 | ->getRepository(ProductClass::class) |
|
| 282 | ->find($ProductClassId); |
|
| 283 | if (is_null($ProductClass)) { |
|
| 284 | return false; |
|
| 285 | } |
|
| 286 | } |
|
| 287 | ||
| 288 | $ClassCategory1 = $ProductClass->getClassCategory1(); |
|
| 289 | if ($ClassCategory1 && !$ClassCategory1->isVisible()) { |
|
| @@ 310-318 (lines=9) @@ | ||
| 307 | ||
| 308 | public function removeProduct($ProductClass) |
|
| 309 | { |
|
| 310 | if (!$ProductClass instanceof ProductClass) { |
|
| 311 | $ProductClassId = $ProductClass; |
|
| 312 | $ProductClass = $this->entityManager |
|
| 313 | ->getRepository(ProductClass::class) |
|
| 314 | ->find($ProductClassId); |
|
| 315 | if (is_null($ProductClass)) { |
|
| 316 | return false; |
|
| 317 | } |
|
| 318 | } |
|
| 319 | ||
| 320 | $removeItem = new CartItem(); |
|
| 321 | $removeItem->setPrice($ProductClass->getPrice02IncTax()); |
|