Country drop down list filter

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
nogatek
Ensign (ENS)
Ensign (ENS)
Posts: 18
Joined: Thu Aug 28, 2008 7:57 pm

Country drop down list filter

Post by nogatek » Sun Dec 07, 2008 5:31 pm

Hi,

I have a store that only ships to Australia and New Zealand.

I configured 2 x shipping zones in AC7 admin, but checkout still shoes all countries in the drop down list.

What is the best way to ensure that only Australia and New Zealand appear in all the various checkout countries drop down lists?

Shouldn't the shipping zones handle this?

I really don't want to have to delete ALL the other countries in the AC7 Shipping > Countries section.

Thanks, Mark

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Country drop down list filter

Post by mazhar » Thu Dec 11, 2008 2:42 am

You can update the country list loading code to take care of shipping zones. For example in the InitializeCountries() function in onepagecheckout.ascx.cs file you can update the following loader code

Code: Select all

_Countries = CountryDataSource.LoadForStore("Name");
something like below so that only specific countries should be loaded.

Code: Select all

_Countries = new CountryCollection();
        ShipZoneCollection shipZones = ShipZoneDataSource.LoadForStore();
        foreach (ShipZone shipZone in shipZones)
        {
            CountryCollection countries = CountryDataSource.LoadForShipZone(shipZone.ShipZoneId);
            _Countries.AddRange(countries);
        }

Post Reply