public function deleteAction(CartProductInterface $cartProduct) : Response
 {
     try {
         $this->manager->deleteCartProduct($cartProduct);
     } catch (DeleteCartItemException $exception) {
         $this->getFlashHelper()->addError($exception->getMessage());
     }
     return $this->redirectToAction('index');
 }
示例#2
0
 /**
  * @param OrderInterface $order
  */
 public function saveOrder(OrderInterface $order)
 {
     $this->createResource($order);
     $cart = $this->getCartContext()->getCurrentCart();
     $this->cartManager->abandonCart($cart);
     $this->getRequestHelper()->setSessionAttribute('orderId', $order->getId());
 }
 public function onKernelController()
 {
     $this->cartManager->initializeCart();
 }
示例#4
0
 public function onKernelController(FilterControllerEvent $event)
 {
     $this->cartManager->initializeCart();
 }