示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadResourceFileSettings();
            CartController cartController = new CartController(StoreContext);

            UserCart = cartController.GetCart(false);

            pnlEmptyCart.Visible = (UserCart.ItemCount <= 0);
            pnlCart.Visible      = !pnlEmptyCart.Visible;
        }
示例#2
0
        private void RemoveCartItemFromCart(int cartItemId)
        {
            cartController.RemoveCartItemFromCart(cartItemId);

            DataModel.Cart cart = cartController.GetCart(false);
            if (cart.CartItemCollectionByCartId.Count == 0)
            {
                // remove all coupons if we have an empty cart
                checkoutOrderInfo.RemoveAllCoupons();
            }
        }