return $this->
redirectToRoute('frontend.checkout.register.page'
);
} if ($this->cartService->
getCart($context->
getToken(),
$context)->
getLineItems()->
count() === 0
) { return $this->
redirectToRoute('frontend.checkout.cart.page'
);
} $page =
$this->confirmPageLoader->
load($request,
$context);
$cart =
$page->
getCart();
$cartErrors =
$cart->
getErrors();
$this->
hook(new CheckoutConfirmPageLoadedHook($page,
$context));
$this->
addCartErrors($cart);
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.checkout.confirm.page',
[...
$request->query->
all(), ...
[self::REDIRECTED_FROM_SAME_ROUTE => true
]],
);
}