private void InitializeShoppingCart()
        {
            _cart = new InterpriseShoppingCart(base.EntityHelpers, ThisCustomer.SkinID, ThisCustomer, CartTypeEnum.ShoppingCart, string.Empty, false, true);
            string couponCode = ThisCustomer.CouponCode;

            _cart.BuildSalesOrderDetails(false, true, couponCode);
            _cartHasCouponAndIncludesFreeShipping = _cart.CouponIncludesFreeShipping(couponCode);
        }
示例#2
0
        private void CheckWhetherToRequireShipping()
        {
            if (AppLogic.AppConfigBool("SkipShippingOnCheckout") ||
                !_cart.HasShippableComponents() ||
                _cart.CouponIncludesFreeShipping(litCouponEntered.Text))
            {
                _cart.MakeShippingNotRequired();

                if (!_isFromPayPal)
                {
                    Response.Redirect("checkoutpayment.aspx");
                }
                else
                {
                    InterpriseHelper.UpdateCustomerPaymentTerm(ThisCustomer, PAYMENT_METHOD_CREDITCARD);
                    Response.Redirect("checkoutreview.aspx?PayPal=True&token=" + Request.QueryString["token"]);
                }
            }
        }
示例#3
0
        private void InitializeShoppingCart()
        {
            _cart = new InterpriseShoppingCart(base.EntityHelpers, ThisCustomer.SkinID, ThisCustomer, CartTypeEnum.ShoppingCart, string.Empty, false, true);
            if (_cart.CartItems.Count > 0)
            {
                _cart.BuildSalesOrderDetails();
                _cartHasCouponAndIncludesFreeShipping = _cart.CouponIncludesFreeShipping();
            }
            else
            {
                Response.Redirect("shoppingcart.aspx");
            }

            if (_cart.InventoryTrimmed)
            {
                Response.Redirect("shoppingcart.aspx?resetlinkback=1&errormsg=" + Server.UrlEncode(AppLogic.GetString("shoppingcart.aspx.1", SkinID, ThisCustomer.LocaleSetting, true)));
            }

            string couponCode = string.Empty;
            string error      = string.Empty;

            bool hasCoupon = _cart.HasCoupon(ref couponCode);

            if (hasCoupon && _cart.IsCouponValid(ThisCustomer, couponCode, ref error))
            {
                panelCoupon.Visible   = true;
                litCouponEntered.Text = couponCode;
            }
            else
            {
                panelCoupon.Visible = false;
                if (!error.IsNullOrEmptyTrimmed())
                {
                    Response.Redirect("shoppingcart.aspx?resetlinkback=1&discountvalid=false");
                }
            }
        }
示例#4
0
        private void InitializeShoppingCart()
        {
            _cart = new InterpriseShoppingCart(base.EntityHelpers, ThisCustomer.SkinID, ThisCustomer, CartTypeEnum.ShoppingCart, string.Empty, false, true);

            string couponCode = string.Empty;
            bool   hasCoupon  = _cart.HasCoupon(ref couponCode);

            if (hasCoupon)
            {
                panelCoupon.Visible   = true;
                litCouponEntered.Text = couponCode;
            }
            else
            {
                panelCoupon.Visible = false;
            }

            try
            {
                // Always compute the vat since we need to display the vat even if the the vat enabled = true
                _cart.BuildSalesOrderDetails(false, true, couponCode);
                _cartHasCouponAndIncludesFreeShipping = _cart.CouponIncludesFreeShipping(couponCode);
            }
            catch (InvalidOperationException ex)
            {
                if (ex.Message == AppLogic.GetString("shoppingcart.cs.35", 1, ThisCustomer.LocaleSetting, true))
                {
                    Response.Redirect("shoppingcart.aspx?resetlinkback=1&discountvalid=false");
                }
                else
                {
                    throw ex;
                }
            }
            catch (Exception ex) { throw ex; }
        }