Time for action—shipping items to selected countries only

In this section, we will learn how to disable country and zone definitions from OpenCart to allow registrations from certain countries only. Let's assume that we will ship products only to US, Canada, UK, and Germany.

There are two methods to enable/disable the countries for shipping.

Manual method

  1. Let's open the System | Localisation | Countries menu. We will Edit the first country, which we will disable.
    Manual method
  2. Let's choose Country Status as Disabled. Let's click on the Save button to finish.
    Manual method
  3. We should repeat this process for all pages of countries which we will not need, one by one. Note that it is a very time consuming process.

Automatic method

  1. We will take advantage of phpMyAdmin database administration tool which we can reach at cPanel. Let's open cPanel which the hosting service has provided for us. Let's click on the phpMyAdmin link.

    Note

    We should be very careful when applying operations on phpMyAdmin. A wrong operation can damage the whole store structure.

    Automatic method
  2. We list the content of the database and see the tables in our OpenCart installation. The information for countries is in the country table. Let's click on the SQL link on the top menu.
    Automatic method
  3. Let's write the following SQL statement and click the Go button to execute it:

    update country set status=0

    This SQL query will disable all countries in the database.

    Automatic method
  4. Now, it is easy to enable just a few countries one by one at the administration panel. For example, we would enable the US like in the following screenshot. We will repeat this for the remaining countries—Canada, UK, and Germany in this case.
    Automatic method
  5. Now, if we try to register as a new customer, only enabled countries will be listed.
    Automatic method
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.83.199