Skip to content

Commit

Permalink
Minor fix CheckoutController - remove unused services / fix redirect …
Browse files Browse the repository at this point in the history
…to correct route (index action)
  • Loading branch information
KrzysztofPajak committed Nov 4, 2021
1 parent e955ad5 commit 963dd5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Web/Grand.Web/Controllers/CheckoutController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ protected virtual bool IsPostBeingDone

#endregion

public virtual async Task<IActionResult> Index([FromServices] IShoppingCartService shoppingCartService, [FromServices] IProductService productService)
public virtual async Task<IActionResult> Index()
{
var customer = _workContext.CurrentCustomer;

Expand All @@ -222,13 +222,13 @@ public virtual async Task<IActionResult> Index([FromServices] IShoppingCartServi
//validation (each shopping cart item)
foreach (ShoppingCartItem sci in cart)
{
var product = await productService.GetProductById(sci.ProductId);
var product = await _productService.GetProductById(sci.ProductId);
var sciWarnings = await _shoppingCartValidator.GetShoppingCartItemWarnings(customer, sci, product, new ShoppingCartValidatorOptions());
if (sciWarnings.Any())
return RedirectToRoute("ShoppingCart", new { checkoutAttributes = true });
}

return RedirectToRoute("CheckoutOnePage");
return RedirectToRoute("Checkout");
}

public virtual async Task<IActionResult> Completed(string orderId)
Expand Down

0 comments on commit 963dd5b

Please sign in to comment.