Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default 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.

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Shipping country dropdown

    Quote Originally Posted by simon1066 View Post
    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

  3. #3
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Shipping country dropdown

    I think you can use the selectable countries mod for it

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Shipping country dropdown

    Quote Originally Posted by Design75 View Post
    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



  5. #5
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Shipping country dropdown

    Quote Originally Posted by RodG View Post
    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.

 

 

Similar Threads

  1. Country Dropdown
    By trevor4370 in forum General Questions
    Replies: 1
    Last Post: 5 Jan 2009, 01:20 PM
  2. [Done v1.3.6] Country Dropdown Bug
    By zytroop in forum Bug Reports
    Replies: 60
    Last Post: 20 Jan 2007, 12:37 PM
  3. 1.36 Country Dropdown - how do I fix?
    By kimsonvu in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 19 Jan 2007, 06:25 PM
  4. Country Dropdown
    By crichw in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 4 Dec 2006, 03:28 AM
  5. remove country dropdown
    By magicpants in forum Basic Configuration
    Replies: 1
    Last Post: 9 Nov 2006, 01:54 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR