From 104713e6f57c6a15b08cc5c9eb0071b29c9fdd64 Mon Sep 17 00:00:00 2001 From: "ismael.triana" Date: Fri, 16 Dec 2022 10:43:47 -0500 Subject: [PATCH] CheckoutController.cs: - Updated CurrentCart null contition location. --- .../Hotcakes/Core/Controllers/CheckoutController.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Website/DesktopModules/Hotcakes/Core/Controllers/CheckoutController.cs b/Website/DesktopModules/Hotcakes/Core/Controllers/CheckoutController.cs index 9d534d25..0f4d3812 100644 --- a/Website/DesktopModules/Hotcakes/Core/Controllers/CheckoutController.cs +++ b/Website/DesktopModules/Hotcakes/Core/Controllers/CheckoutController.cs @@ -99,6 +99,11 @@ protected bool IsOrderConfirmed [NonCacheableResponseFilter] public ActionResult Index() { + if (CurrentCart == null || CurrentCart.Items == null || CurrentCart.Items.Count == 0) + { + return Redirect(Url.RouteHccUrl(HccRoute.Cart)); + } + var model = LoadCheckoutModel(); HccApp.AnalyticsService.RegisterEvent(HccApp.CurrentCustomerId, ActionTypes.GoToChekout, null); VerifySessionError(model); @@ -569,9 +574,6 @@ public ActionResult ApplyEUVatRules() private CheckoutViewModel LoadCheckoutModel() { - if (CurrentCart == null || CurrentCart.Items == null || CurrentCart.Items.Count == 0) - Redirect(Url.RouteHccUrl(HccRoute.Cart)); - var model = new CheckoutViewModel { CurrentOrder = CurrentCart }; LoadCurrentCustomer(model);