Ban activity on your site by a specific country

You may wish to prevent activity by addresses from a certain country from your Zencart site (as opposed to your server). You can do this yourself, or you could ask us to do it for you.

To remove a country from the Create Account, Guest Checkout and Shipping options.

Go to admin > locations/taxes > countries and locate the specific country.

If you want to permanently remove it, just Delete it.

If you would prefer to make this an easily reversible choice, EDIT the country and alter the ISO-2 and ISO-3 codes to RX and RXS respectively, and remove the check mark from Status (Active for shipping?).

NOTE 1: It would be wise at this point to check the url after you've selected DELETE or EDIT and note the country id - it is toward the end of the url and will be in the format of cID=XXX&action=delete/edit where XXX is the id.

NOTE 2: Removing a country from the country list should be enough to block anyone from setting a shipping address to that country but just in case, rename the ISO codes. This should prevent (if you use it) Enhanced Shipper from picking up the country by name because of the ISO code mismatch, and (again, if you use it) PayPal express checkout also fetches the countries table by ISO codes when creating customer accounts from PayPal customer data. 


To block existing accounts with a registered address within that country and prevent them from logging into the site and buying products

There's no easy way via admin to list customer addresses and the best option we can suggest is to go to admin > tools > install sql patches and paste in the following command:

UPDATE zen_customers SET customers_authorization = 4 WHERE customers_id IN (SELECT DISTINCT customers_id FROM zen_address_book WHERE entry_country_id = 'XXX');

Confirm that the entry_country_id is the same as the country id you noted above, then hit Send.

This will set all relevant accounts to Banned and will show in admin > customers > customers with a red icon in the authorized column.

Was this answer helpful?