public BasketSummaryView GetBasketSummaryView()
        {
            string basketTotal   = "";
            int    numberOfItems = 0;

            if (!string.IsNullOrEmpty(_cookieStorageService.Retrieve(
                                          CookieDataKeys.BasketTotal.ToString())))
            {
                basketTotal = _cookieStorageService.Retrieve(
                    CookieDataKeys.BasketTotal.ToString());
            }

            if (!string.IsNullOrEmpty(_cookieStorageService.Retrieve(
                                          CookieDataKeys.BasketItems.ToString())))
            {
                numberOfItems = int.Parse(_cookieStorageService.Retrieve(
                                              CookieDataKeys.BasketItems.ToString()));
            }

            return(new BasketSummaryView
            {
                BasketTotal = basketTotal,
                NumberOfItems = numberOfItems
            });
        }
        private Guid GetCartId()
        {
            var storedCartId = _cookieStorageService.Retrieve(CookieDataKeys.CartId.ToString());

            var cartId = Guid.Empty;

            if (!string.IsNullOrEmpty(storedCartId))
            {
                cartId = new Guid(storedCartId);
            }

            return(cartId);
        }
Beispiel #3
0
        public CartSummaryView GetCartSummaryView()
        {
            string cartTotal     = "";
            int    numberOfItems = 0;

            if (!string.IsNullOrEmpty(_cookieStorageService.Retrieve(CookieDataKeys.CartTotal.ToString())))
            {
                cartTotal = _cookieStorageService.Retrieve(CookieDataKeys.CartTotal.ToString());
            }

            if (!string.IsNullOrEmpty(_cookieStorageService.Retrieve(CookieDataKeys.CartItems.ToString())))
            {
                numberOfItems = int.Parse(_cookieStorageService.Retrieve(CookieDataKeys.CartItems.ToString()));
            }

            return(new CartSummaryView
            {
                CartTotal = cartTotal,
                NumberOfItems = numberOfItems
            });
        }