public ActionResult RequestQuote() { bool succesRequest; var currentCustomer = _customerService.GetCurrentContact(); if (currentCustomer.Role != B2BUserRoles.Purchaser) { return(Json(new { result = false })); } if (Cart == null) { _cart = _cartService.LoadOrCreateCart(_cartService.DefaultCartName); succesRequest = _cartServiceB2B.PlaceCartForQuote(_cart); } else { succesRequest = _cartServiceB2B.PlaceCartForQuote(Cart); } _cartServiceB2B.DeleteCart(_cart); _cart = _cartServiceB2B.CreateNewCart(); return(Json(new { result = succesRequest })); }
public ActionResult RequestWishListQuote() { var currentCustomer = _customerService.GetCurrentContact(); if (currentCustomer.Role != B2BUserRoles.Purchaser) { return(Json(new { result = false })); } var startPage = _contentLoader.Get <StartPage>(ContentReference.StartPage); var wishListCart = _cartService.LoadWishListCardByCustomerId(currentCustomer.ContactId); if (wishListCart != null) { // Set price on line item. foreach (var lineItem in wishListCart.GetAllLineItems()) { lineItem.PlacedPrice = _cartService.GetDiscountedPrice(wishListCart, lineItem).Value.Amount; } _cartServiceB2B.PlaceCartForQuote(wishListCart); _cartServiceB2B.DeleteCart(wishListCart); _cartService.LoadOrCreateCart(_cartService.DefaultWishListName); return(RedirectToAction("Index", new { Node = startPage.WishListPage })); } return(RedirectToAction("Index", new { Node = startPage.OrderHistoryPage })); }