Beispiel #1
0
        public JsonResult ClearQuotedCart()
        {
            _cartServiceB2B.DeleteCart(Cart);
            _cart = _cartServiceB2B.CreateNewCart();

            return(Json("success", JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        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 }));
        }