Example #1
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                AnalyticsUtil.ShoppingCartViewed();

                this.btnEmptyShoppingCart.Text = Translate.Text(Texts.EmptyCart);
                this.btnUpdate.Text            = Translate.Text(Texts.UpdateCart);
                this.btnContinueShopping.Text  = Translate.Text(Texts.ContinueShopping);
            }

            if (this.Cart.ShoppingCartLines.Count == 0)
            {
                this.litStatus.Text                        = Translate.Text(Texts.TheShoppingCartIsEmpty);
                this.UcProductsListView.Visible            = false;
                this.btnUpdateContainer.Visible            = false;
                this.btnProceedToCheckoutContainer.Visible = false;
                this.btnEmptyContainer.Visible             = false;
                this.tocArea.Visible                       = false;
                this.summary.Visible                       = false;
                this.delivery.Visible                      = false;
            }

            this.UcProductsListView.Currency = this.Cart.Currency;
            this.summary.Currency            = this.Cart.Currency;
            this.delivery.Currency           = this.Cart.Currency;

            this.btnProceedToCheckout.Text    = Translate.Text(Texts.ProceedToCheckout);
            this.btnProceedToCheckout.ToolTip = Translate.Text(Texts.PleaseReadAndAcceptTheTermsAndConditionsBeforeContinuing);
            this.btnProceedToCheckout.Attributes["disabled"] = Cart.ShoppingCartLines.Count <= 0 || !this.termsOfConditions.Checked ? "disabled" : string.Empty;
        }