Exemplo n.º 1
0
        /// <summary>
        /// This event should occur each time a change is made to the cart.  
        /// All of the Checkout controls should be updated with the new cart information and the 
        /// order updated.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cartControl_EditComplete(object sender, EventArgs e)
        {
            OrderController orderController = new OrderController();

            CartInfo cartInfo = CurrentCart.GetInfo(PortalId);
            if (cartInfo != null & _orderInfo != null)
            {
                _orderInfo = orderController.UpdateOrderDetails(_orderInfo.OrderID, cartInfo.CartID);
            }

            CalculateTaxandShipping(_orderInfo);

            updateCheckoutOrder(_orderInfo);
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            //Response.Write("Page_Load");
            // return;

            if (_storeInfo == null)
            {
                StoreController storeController = new StoreController();
                _storeInfo = storeController.GetStoreInfo(PortalId);

                if (_storeInfo.CurrencySymbol != string.Empty)
                {
                    LocalFormat.CurrencySymbol = _storeInfo.CurrencySymbol;
                }

                if (_storeInfo.PortalTemplates)
                {
                    CssTools.AddCss(this.Page, PortalSettings.HomeDirectory + "Store", PortalId);
                }
                else
                {
                    CssTools.AddCss(this.Page, this.TemplateSourceDirectory, PortalId);
                }
            }

            lblGatewayTitle.Visible = false;

            if (forceSSL())
            {
                SSLHelper.RequestSecurePage();
            }

            //Mail.SendMail(PortalSettings.Email, "*****@*****.**", "", "Canadean Checkout ", " ", "", "", "", "", "", "");
            if (Request.QueryString["WorldPayExit"] != null)
            {
                //Mail.SendMail(PortalSettings.Email, "*****@*****.**", "", "Canadean Payment Checkout - " + Request.QueryString["WorldPayExit"], " ", "", "", "", "", "", "");
                loadPaymentControl();

                return;
            }

            loadCartControl();
            loadAddressControl();
            loadPaymentControl();
            loadTaxCheckoutControl();
            loadShippingCheckoutControl();

            _orderInfo = GetExistingOrder();

            updateCheckoutAddress();

            if (Request.QueryString["PayPalExit"] == null)
            {
                if (!this.Page.IsPostBack)
                {
                    if (_orderInfo == null)
                    {
                        _orderInfo = CreateOrder();
                    }

                    //Update the order details with the most recent cart items.
                    OrderController orderController = new OrderController();

                    CartInfo cartInfo = CurrentCart.GetInfo(PortalId);
                    if (cartInfo != null & _orderInfo != null)
                    {
                        _orderInfo = orderController.UpdateOrderDetails(_orderInfo.OrderID, cartInfo.CartID);
                    }
                }

                CalculateTaxandShipping(_orderInfo);
                updateCheckoutOrder(_orderInfo);
                updateStoreInfo();
            }
        }