|
|
@@ -18,6 +18,7 @@ use Symfony\Component\Routing\Annotation\Route; |
|
|
|
class CartController extends AbstractController |
|
|
|
{ |
|
|
|
protected ProductFamilyInterface $productFamily; |
|
|
|
protected int $quantityOrder = 1; |
|
|
|
protected array $orderProducts = []; |
|
|
|
|
|
|
|
public function addProductFamily(Request $request): JsonResponse |
|
|
@@ -76,17 +77,12 @@ class CartController extends AbstractController |
|
|
|
|
|
|
|
public function addOrderProduct(OrderShopInterface $orderShop, OrderProductInterface $orderProduct): void |
|
|
|
{ |
|
|
|
$this->addOrderProductApply($orderShop, $orderProduct); |
|
|
|
} |
|
|
|
$this->quantityOrder = $orderProduct->getQuantityOrder(); |
|
|
|
$addOrderProduct = $this->getOrderShopContainer()->getBuilder()->addOrderProduct( |
|
|
|
$orderShop, |
|
|
|
$orderProduct |
|
|
|
); |
|
|
|
|
|
|
|
public function addOrderProductApply(OrderShopInterface $orderShop, OrderProductInterface $orderProduct): void |
|
|
|
{ |
|
|
|
if ($orderProduct->getQuantityOrder() > 0) { |
|
|
|
$addOrderProduct = $this->getOrderShopContainer()->getBuilder()->addOrderProduct( |
|
|
|
$orderShop, |
|
|
|
$orderProduct |
|
|
|
); |
|
|
|
} |
|
|
|
if (isset($addOrderProduct) && $addOrderProduct && $orderProduct->getQuantityOrder() > 0) { |
|
|
|
$this->orderProducts[] = $orderProduct; |
|
|
|
} |