$response =
$this->
renderStorefront('@Storefront/storefront/layout/header/actions/cart-widget.html.twig',
['page' =>
$page]);
$response->headers->
set('x-robots-tag', 'noindex'
);
return $response;
} #[Route(path: '/checkout/offcanvas', name: 'frontend.cart.offcanvas', options: ['seo' => false], defaults: ['XmlHttpRequest' => true], methods: ['GET'])]
public function offcanvas(Request
$request, SalesChannelContext
$context): Response
{ $page =
$this->offcanvasCartPageLoader->
load($request,
$context);
$this->
hook(new CheckoutOffcanvasWidgetLoadedHook($page,
$context));
$cart =
$page->
getCart();
$this->
addCartErrors($cart);
$cartErrors =
$cart->
getErrors();
if (!
$request->query->
getBoolean(self::REDIRECTED_FROM_SAME_ROUTE
) &&
$this->
routeNeedsReload($cartErrors)) { $cartErrors->
clear();
// To prevent redirect loops add the identifier that the request already got redirected from the same origin
return $this->
redirectToRoute( 'frontend.cart.offcanvas',
[