Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    May 2006
    Location
    Australia
    Posts
    110
    Plugin Contributions
    2

    Default How can country selection be disabled?

    For the time being, I would like to prevent anyone from making international orders from my online store. Is there a proper way to disable "international" shipping?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: How can country selection be disabled?

    Yes ... manually remove all the undesired countries from the list:
    Admin->Localization/Taxes->Countries

    That way customers cannot sign up using a non-supported country in their address, and also cannot checkout using a non-accepted shipping address.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2006
    Location
    Australia
    Posts
    110
    Plugin Contributions
    2

    Default Re: How can country selection be disabled?

    Quote Originally Posted by DrByte
    Yes ... manually remove all the undesired countries from the list:
    Admin->Localization/Taxes->Countries

    That way customers cannot sign up using a non-supported country in their address, and also cannot checkout using a non-accepted shipping address.
    Darn, I was hoping there would be a quicker way.

    Have you thought about adding an option to exclude all countries except the primary/default/selected country, instead of having to remove everything and then add it in again later when the time comes?

    Just a thought.

    Thanks for the answer.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can country selection be disabled?

    Yeps ... have thought about that a lot ...

    But then you are gonna say ... oh! oh! wait! I want these 2 only ... and the next guy says ... oh!! I just need these 4 ... and on and on and on ...

    So ... need to have a longer think on this so that everyone can be happy ... simultaneously ... at one time ... in the same moment ... and not break everything all to ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    May 2006
    Location
    Australia
    Posts
    110
    Plugin Contributions
    2

    Default Re: How can country selection be disabled?

    Yeah good point Ajeh, what about having a checkbox next to each country and a delete and/or disable button at the bottom? There could be a checkbox to select everything, and then the admin can un-tick only the ones they wish to keep.

    By the way, is it possible to just delete * from countries where id !=50;? I'm not sure if the syntax is right, but it's taking a long time to get through all of these.

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can country selection be disabled?

    Yes ... that global delete ... after you make a backup of course ... can be done to delete all except the 1 you want ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Jun 2005
    Posts
    29
    Plugin Contributions
    0

    Idea or Suggestion Re: How can country selection be disabled?

    delete is a pain, because then when you later want to start shipping to a country, you will have to add all the details. also, a delete is irreversible, so if you make a mistake you are somewhat stuck (who knows what are the correct iso codes and address format of each country?).
    an additional "enabled" field in the database makes more sense. a checkbox per country, with a global "apply" button on the admin/countries page (if you can add a "select all/deselect all" it would be even nicer)
    this way, you only need to do it twelve times (currently there are 12 pages in the countries, displaying all 239 countries).

    the current state, where you have to go through 239 countries and delete all those you dont want to do business with is a huge pita, especially since deleting a country requires 3 clicks, each of which requires a page refresh. do that 238 times (if you want to ship only in one country), and you are a prime candidate for carpal syndrom. also, it will take you quite a long time.

    true, you only need to do this once, but the "bad news" is that you need to do it while setting up your store for the first time. a major inconvinience.

    hint to the original poster:
    there is a "shortcut", although it is somewhat of a dirty trick (i tested it in 1.3.5. if you need this code i assume your store is new, so you are likely using the latest. otherwise, i don't know if this works):

    1) make a list of the 2-letter ISO codes of the countries you want to remain.
    if you wish to ship to us and gb, your list will be US and GB.
    2) from admin panel, use Tools/Install SQL Patch
    3) enter the following SQL:
    Code:
    delete from countries where countries_iso_code_2 not in ('GB', 'US');
    4) poof! all the countries not in your list (in the example above GB and US) disappear!

  8. #8
    Join Date
    May 2005
    Location
    Cheshire, UK
    Posts
    542
    Plugin Contributions
    3

    Default Re: How can country selection be disabled?

    This is really simpler than you think. It can be done in three steps (one being looking at the country tables for some info and the other two deleting and inserting using two simple sql queries).

    USING NAVICAT OR PHP MY ADMIN
    1) Open the Countries table and find the countries which you want to keep. In the one I am using for this example there are five columns:
    countries_id
    countries_name
    countries_iso_code_2
    countries_iso_code_3
    address_format_id


    BACK UP THE COUNTRIES TABLE!!!!!

    Now, assuming for example you only wanted to keep one country and this was the United Kingdom, you scroll down the table until you find the country then copy all the data in the row for the country into a text file.

    countries_id | 222 | countries_name | United Kingdom | countries_iso_code_2 | GB | countries_iso_code_3 | GBR | address_format_id | 6

    (A quick and dirty way to do this is to export the entire countries table then delete all the insert statements except the one you want to keep)

    Now all you need to do is delete all the countries and insert the one you want back in again:

    You can use the delete command:
    Delete * from countries where countries_id IS NOT NULL;

    Next you can run the insert statement to put back your chosen country:

    INSERT INTO `countries` VALUES (222, 'United Kingdom', 'GB', 'GBR', 6);

    Do this insert statement for every country you want back in there.

    Job done

    (EDIT** - Just saw the post above this one - that solution would do the same thing as mine - guess I should read all of the thread next time before posting but in my defence it is 3:20am here and I am off to bed :))
    Last edited by JollyJim; 5 Sep 2006 at 03:16 AM.

  9. #9
    Join Date
    Jan 2007
    Location
    York
    Posts
    32
    Plugin Contributions
    0

    Default Re: How can country selection be disabled?

    That little bit of sql is a genius!! Thanks so much, I still remember when I installed cubecart having to go through and delete all the countries manually!
    Many thanks
    H

  10. #10
    Join Date
    Feb 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: How can country selection be disabled?

    1) make a list of the 2-letter ISO codes of the countries you want to remain.
    if you wish to ship to us and gb, your list will be US and GB.
    2) from admin panel, use Tools/Install SQL Patch
    3) enter the following SQL:
    Code:
    delete from countries where countries_iso_code_2 not in ('GB', 'US');
    4) poof! all the countries not in your list (in the example above GB and US) disappear!
    This looks great! Has anyone used it on 1.3.7 ?

    If I do this & it does not work can I reverse it?

    Thanks :)

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Limiting country selection
    By hokyk in forum Managing Customers and Orders
    Replies: 5
    Last Post: 28 Jan 2011, 04:08 AM
  2. Country selection
    By Z0C in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 4 Nov 2007, 02:14 PM
  3. Country selection no longer working
    By gossamerLL in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 8 Nov 2006, 12:36 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