Forums / Built-in Shipping and Payment Modules / Shipping country dropdown

Shipping country dropdown

Views: 1,012

Results 1 to 5 of 5
30 Mar 2014, 7:00 AM
#1
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Shipping country dropdown

I accept orders from most countries but only deliver to some.

How do I populate the ship-to country dropdown (on the create account and shipping estimate page - there may be more) with only those countries I ship to whilst keeping all countries available for billing address?

Either there's an easy way of doing this - which I can't see, or perhaps I could hack the code of the ship-to dropdown in some way, although I haven't looked at this yet.

Simon

30 Mar 2014, 7:50 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Shipping country dropdown

simon1066:

I accept orders from most countries but only deliver to some.

How do I populate the ship-to country dropdown (on the create account and shipping estimate page - there may be more) with only those countries I ship to whilst keeping all countries available for billing address?

Either there's an easy way of doing this - which I can't see, or perhaps I could hack the code of the ship-to dropdown in some way, although I haven't looked at this yet.

There's no "easy" way to do this because in both cases the countries are pulled from the same database table.

Although I've not looked either, if this were a problem I needed to solve I would be inclined to create a different 'countries' table (eg 'countries_shipping') that contains only the countries you ship to, and modify the relevant parts of the code so that this table is used (where applicable) rather than the fully populated countries table.

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

30 Mar 2014, 9:00 AM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Shipping country dropdown

Design75:

I think you can use the selectable countries mod for it

I thought of that, but figured it wouldn't be suitable in this case.

"When a country is Inactive, that country cannot be used in any customer address -- neither the billing nor shipping address can reside in that country"

However, if the OP prefers to not create a separate table as per my suggestion, this module would be a good place to look for an example of how to add the excluded countries where needed.

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

30 Mar 2014, 10:03 AM
#5
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Shipping country dropdown

RodG:

There's no "easy" way to do this because in both cases the countries are pulled from the same database table.

Although I've not looked either, if this were a problem I needed to solve I would be inclined to create a different 'countries' table (eg 'countries_shipping') that contains only the countries you ship to, and modify the relevant parts of the code so that this table is used (where applicable) rather than the fully populated countries table.

Cheers
RodG

Yes, thanks that sounds like a doable solution.

I thought of that, but figured it wouldn't be suitable in this case.

"When a country is Inactive, that country cannot be used in any customer address -- neither the billing nor shipping address can reside in that country"

However, if the OP prefers to not create a separate table as per my suggestion, this module would be a good place to look for an example of how to add the excluded countries where needed.

I think that from a coding view the additional table option is the way to go.

One thing I'll have to be careful of is the 'same address for shipping/billing' checkbox option in FEC. I wouldn't necessarily want to be without that option but can't see how to get around that - at the moment.

Simon