|
|
@@ -62,8 +62,10 @@ class CartController extends BaseController |
|
|
|
return new JsonResponse($return) ; |
|
|
|
} |
|
|
|
|
|
|
|
public function deleteReductionCart($id) |
|
|
|
public function deleteReductionCart(Request $request) |
|
|
|
{ |
|
|
|
$id = $request->get('id') ; |
|
|
|
|
|
|
|
$orderReductionCartRepository = $this->em->getRepository($this->em->getClassMetadata(OrderReductionCartInterface::class)->getName()) ; |
|
|
|
$orderReductionCart = $orderReductionCartRepository->findOneById((int) $id) ; |
|
|
|
|
|
|
@@ -79,7 +81,14 @@ class CartController extends BaseController |
|
|
|
$this->addFlash('error', 'Une erreur est survenue lors de la suppression de la réduction. ') ; |
|
|
|
} |
|
|
|
|
|
|
|
return $this->redirectToRoute('frontend_order_cart') ; |
|
|
|
$referer = $request->headers->get('referer'); |
|
|
|
|
|
|
|
if($referer) { |
|
|
|
return $this->redirect($referer); |
|
|
|
} |
|
|
|
else { |
|
|
|
return $this->redirectToRoute('frontend_order_cart'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |