Set Shipping to Selected Countries Only in OpenCart

  • SumoMe

By default, OpenCart has every country enabled in your Localisation settings. What if your online store only caters to a few countries. Disabling them all in the admin panel one by one would be a pain. You would have to:

  1. Open System > Localisation > Countries menu in admin panel.
  2. Click Edit on the country you want to disable.
  3. Choose Disabled in the Status field.

You would have to iterate this process several times if you are to do this manually.

A solution to this is to disable all of them at once through an SQL statement and enable the countries individually in the admin panel which is about a hundred times easier than the latter. Here’s how:

  1. Open your OpenCart database in phpMyAdmin or any other database management tool you use.
  2. Execute the following SQL: 
    UPDATE country SET status=0

    This SQL statement sets the Status of all countries to Disabled.

  3. Go back to your admin panel and enable your selected countries manually.

When you register a customer in OpenCart only the enabled countries will appear. How convenient. 🙂

Image by fangol

About maca

Hello, my name is Karlo Macariola. I once dreamed to be a painter or an animator but when I typed my first line of code I immediately fell in love with programming. Today my passions are with web development and web design though sometimes I still withdraw to my first love which is drawing. DeviantArt | Twitter | Facebook
This entry was posted in Web Development & Design and tagged . Bookmark the permalink.

13 Responses to Set Shipping to Selected Countries Only in OpenCart

  1. Wayne says:

    Thanks for the tip. Worked like a champ. Much appreciated.

  2. Pingback: limiting shipping country | Open Cart Know How

  3. Pingback: Modify Billing and shipping address form in cart | Open Cart Know How

  4. Bren says:

    I had to use SQL
    UPDATE oc_country SET status=0

    Thanks for the pointer……

  5. Anil says:

    Im a real newbie to sql and am using Opencart, should I type in that command in the SQL query box in phpmyadmin? should I type country_id instead of plain country?

  6. Wilson says:

    UPDATE `occountry` SET status=0;

  7. Charbs says:

    This was an amazing help, Thank you very much :))

  8. jen says:

    This suggestion worked for me. THANK YOU. Couldn’t imagine disabling every single country manually.

  9. livetvaccess says:

    in my case it was givving me errors till I added the prefex which corresponds to my database’s prefex, just in case if you are getting the same error 1146, check the prefex before the enteries in your database, mine was as follows: UPDATE qnu_country SET status=0

  10. I noticed while following your method it disables all countries from payment address as well as from shipping address while I only need to disable some shipping countries, please help me in this regard. I’ll be really thankful to you.

  11. kavlito says:

    Hi, you mention, “When you register a customer in OpenCart only the enabled countries will appear’, however, I set all the countries to status=0 except:
    United States
    United States Minor Outlying Islands
    Puerto Rico
    Virgin Islands (U.S.)
    and when I go to register a new customer, the entire countries db appears.
    I have verified all settings through Admin|System|Localisation|Countries.
    I am on Version

Leave a Reply to livetvaccess Cancel reply

Your email address will not be published. Required fields are marked *