PlaceOrder2.aspx - set default country in dropdownlist
PlaceOrder2.aspx - set default country in dropdownlist
How do you set the default country in the dropdown list when placing an order in the admin interface, PlaceOrder2.aspx
Re: PlaceOrder2.aspx - set default country in dropdownlist
Any ideas?
Can/should it be set to the default warehouse location?
Can/should it be set to the default warehouse location?
Re: PlaceOrder2.aspx - set default country in dropdownlist
Well in 7.0.1 it seems that we are just picking the first available country in list. As for as 7.0.3 is concerned on checkout page we first try to locate the default country from within any available user address other wise we pick the default warehouse country.
Re: PlaceOrder2.aspx - set default country in dropdownlist
Any suggestions about how to do it in 7.0.1?
e.g. in the Page_Load
e.g. in the Page_Load
Code: Select all
if (!Page.IsPostBack)
{
// INITIALIZE THE BILLING ADDRESS
if (_Basket.User != null && !_Basket.User.IsAnonymous)
{
BindBillingAddress();
BindShippingAddress();
}
else
{
CustomerLookupButton.Visible = true;
BillToCountryCode.SelectedValue = "GB";
}
UpdateShipMethod();
}
Re: PlaceOrder2.aspx - set default country in dropdownlist
It could be something like below. I haven't tested it you can try it.
Code: Select all
// INITIALIZE THE BILLING ADDRESS
if (_Basket.User != null && !_Basket.User.IsAnonymous)
{
BindBillingAddress();
BindShippingAddress();
ListItem defaultCountry1 = BillToCountryCode.Items.FindByValue(Token.Instance.Store.DefaultWarehouse.Country.CountryCode);
defaultCountry1.Selected = true;
ListItem defaultCountry2 = ShipToCountryCode.Items.FindByValue(Token.Instance.Store.DefaultWarehouse.Country.CountryCode);
defaultCountry2.Selected = true;
}
else
{
CustomerLookupButton.Visible = true;
}
UpdateShipMethod();
Re: PlaceOrder2.aspx - set default country in dropdownlist
Thanks Mazhar - I'd seen a reference to "DefaultWarehouse" as a means of setting the default CountryCode somewhere in the code, but I couldn't remember where.
Re: PlaceOrder2.aspx - set default country in dropdownlist
Go to OnePageCheckout code, I think you will find something similar there.