Esempio n. 1
0
        private void BindCountryList()
        {
            DataTable dataTable = GeoCountry.GetList();

            ddCountryGuid.DataSource = dataTable;
            ddCountryGuid.DataBind();
        }
        private void LoadSettings()
        {
            ScriptConfig.IncludeColorBox = true;
            storeCountry    = new GeoCountry(siteSettings.DefaultCountryGuid);
            currencyCulture = ResourceHelper.GetCurrencyCulture(siteSettings.GetCurrency().Code);
            commerceConfig  = SiteUtils.GetCommerceConfig();

            store = StoreHelper.GetStore();
            if (store == null)
            {
                return;
            }

            cart           = StoreHelper.GetClerkCart(store);
            tblCountryList = GeoCountry.GetList();


            if (WebUser.IsInRoles(siteSettings.RolesThatCanLookupUsers))
            {
                SetupSelectUserScript();
                //lnkUserLookup.Visible = true;
                lnkUserSearch.Visible = true;
            }

            AddClassToBody("webstore admincheckout");
        }
Esempio n. 3
0
        private void BindCountryList()
        {
            if (tblCountryList == null)
            {
                tblCountryList = GeoCountry.GetList();
            }

            if (tblCountryList != null)
            {
                ddCountry.DataSource = tblCountryList;
                ddCountry.DataBind();
            }

            ListItem item;

            if (setCountry.Length > 0)
            {
                item = ddCountry.Items.FindByValue(setCountry);
            }
            else
            {
                item = ddCountry.Items.FindByValue(defaultCountry);
            }

            if (item != null)
            {
                ddCountry.ClearSelection();
                item.Selected = true;
            }
        }
Esempio n. 4
0
        protected DataTable CountryList()
        {
            if (countryList == null)
            {
                countryList = GeoCountry.GetList();
            }

            return(countryList);
        }
Esempio n. 5
0
        private void BindCountryList()
        {
            DataTable dataTable = GeoCountry.GetList();

            ddCountry.DataSource = dataTable;
            ddCountry.DataBind();

            if ((!Page.IsPostBack) &&
                (countryGuid != Guid.Empty)
                )
            {
                ListItem listItem = ddCountry.Items.FindByValue(countryGuid.ToString());
                if (listItem != null)
                {
                    ddCountry.ClearSelection();
                    listItem.Selected = true;
                }
            }
        }
Esempio n. 6
0
        private void LoadSettings()
        {
            store = StoreHelper.GetStore();
            if (store == null)
            {
                return;
            }

            commerceConfig  = SiteUtils.GetCommerceConfig();
            currencyCulture = ResourceHelper.GetCurrencyCulture(siteSettings.GetCurrency().Code);
            storeCountry    = new GeoCountry(siteSettings.DefaultCountryGuid);

            if (Request.IsAuthenticated)
            {
                siteUser = SiteUtils.GetCurrentSiteUser();
            }

            if (StoreHelper.UserHasCartCookie(store.Guid))
            {
                cart = StoreHelper.GetCart();

                if (cart != null)
                {
                    if ((cart.LastModified < DateTime.UtcNow.AddDays(-1)) && (cart.DiscountCodesCsv.Length > 0))
                    {
                        StoreHelper.EnsureValidDiscounts(store, cart);
                    }

                    if (siteUser != null)
                    {
                        if (cart.UserGuid == Guid.Empty)
                        {
                            // take ownership of anonymous cart
                            cart.UserGuid = siteUser.UserGuid;
                            cart.Save();
                            StoreHelper.InitializeOrderInfo(cart, siteUser);
                        }
                        else
                        {
                            // cart already has a user guid but
                            // check if it matches the current user
                            // cart cookie could have been left behind by a previous user
                            // on shared computers
                            // if cart user guid doesn't match reset billing shipping info
                            // and any other identifiers
                            // but leave items in cart
                            if (cart.UserGuid != siteUser.UserGuid)
                            {
                                cart.ResetUserInfo();
                                cart.UserGuid = siteUser.UserGuid;
                                cart.Save();
                                StoreHelper.InitializeOrderInfo(cart, siteUser);
                            }
                        }
                    }

                    if (WebStoreConfiguration.IsDemo)
                    {
                        LoadDemoCustomer();
                    }


                    canCheckoutWithoutAuthentication = store.CanCheckoutWithoutAuthentication(cart);


                    // disable till I finish
                    //canCheckoutWithoutAuthentication = false;
                }

                AddClassToBody("webstore webstoreconfirmorder");
            }


            pnlRequireLogin.Visible = !Request.IsAuthenticated;

            if ((canCheckoutWithoutAuthentication) || (Request.IsAuthenticated))
            {
                pnlOrderDetail.Visible   = commerceConfig.CanProcessStandardCards || (commerceConfig.WorldPayInstallationId.Length > 0);
                pnlRequireLogin.Visible  = true;
                pnlShippingTotal.Visible = false;
                pnlTaxTotal.Visible      = false;
                pnlOrderTotal.Visible    = false;
            }

            if ((cart != null) && (cart.SubTotal == 0) && (cart.CartOffers.Count > 0))
            {
                // free checkout
                pnlOrderDetail.Visible = true;
            }

            if (pnlOrderDetail.Visible)
            {
                tblCountryList = GeoCountry.GetList();
            }


            ConfigureCheckoutButtons();

            //if (!Page.IsPostBack)
            //{
            //    if ((commerceConfig.PayPalIsEnabled) && (commerceConfig.PayPalUsePayPalStandard))
            //    {
            //        if (Request.IsAuthenticated)
            //        {
            //            SetupPayPalStandardForm();
            //        }
            //        else
            //        {
            //            // we need the user to be signed in before we send them to paypal if using PayPal Standard
            //            // because we want to return them to their order summary and that requires login
            //            // so we need to know who the user is before sending them to PayPal
            //            litOr.Visible = false;
            //            btnPayPal.Visible = false;
            //            btnGoogleCheckout.Visible = false;
            //        }
            //    }
            //}

            //if (!Request.IsAuthenticated)
            //{

            //    pnlOrderDetail.Visible = false;
            //    pnlRequireLogin.Visible = true;
            //    pnlShippingTotal.Visible = false;
            //    pnlTaxTotal.Visible = false;
            //    pnlOrderTotal.Visible = false;

            //    if (commerceConfig.GoogleCheckoutIsEnabled)
            //    {
            //        if (
            //        (!commerceConfig.Is503TaxExempt)
            //        && ((cart != null) && (cart.HasDonations()))
            //        )
            //        {
            //            //btnGoogleCheckout.Visible = false;
            //            lblGoogleMessage.Text = WebStoreResources.GoogleCheckoutDisabledForDonationsMessage;
            //            lblGoogleMessage.Visible = true;
            //            PaymentAcceptanceMark mark = (PaymentAcceptanceMark)pam1;
            //            mark.SuppressGoogleCheckout = true;

            //            mark = (PaymentAcceptanceMark)PaymentAcceptanceMark1;
            //            mark.SuppressGoogleCheckout = true;

            //            btnGoogleCheckout.Visible = true;
            //            btnGoogleCheckout.Enabled = false;
            //        }
            //    }

            //}
            //else
            //{
            //    if (
            //        (!commerceConfig.Is503TaxExempt)
            //         && ((cart != null)&& (cart.HasDonations()))
            //        && (commerceConfig.GoogleCheckoutIsEnabled)
            //        )
            //    {
            //        btnGoogleCheckout.Visible = true;
            //        btnGoogleCheckout.Enabled = false;
            //        lblGoogleMessage.Text = WebStoreResources.GoogleCheckoutDisabledForDonationsMessage;
            //        lblGoogleMessage.Visible = true;
            //    }


            //}
        }