Documentation
Installation instructions
You can install extension using Extension Installer or manually. In the latter case unpack and upload all folders from "upload" directory to the root of your store. If there's install.xml file in the package, rename it to extension_name.ocmod.xml, replacing "extension_name" with extension's name (or any other name), and upload it to "system" folder. When upgrading from previous version simply rewrite all existing files. Refresh modifications cache from Extensions -> Modifications page (not needed if install.xml file is not included in the package).
Note for OpenCart 3 users
If you see "The directory is not allowed to be written to" error message, download OpenCart 3.0 Extension Installer Fix from this page and install it. Then install the main extension.
Note for OpenCart 2.0.X users
Sometimes OCMod inserts modification in multiple files, which are separated by "|" character in XML-file. On earlier OpenCart 2 versions a comma was used instead. To quickly fix this, open XML file (usually, install.xml) and replace all occurrences of "|" character with "," for "path" attribute in every applicable <file> element. Search for "<file path=" to quickly find and highlight all elements.
If after installation you have "Permission denied" issue when accessing Modules, Shipping, Payments, Order Totals (or any other) section of Extensions menu, remove "module", "shipping", "payment", "total" (or any other) folder from "admin/controller/extension" directory. Same for "admin/language/en-gb/extension" directory. For example ("module" should be removed from both paths):
admin/controller/extension/module
admin/language/en-gb/extension/module
Permissions
In some cases it is required to manually set permissions for installed extension. To do this go to System -> User Groups, find your group and select access/modify permissions for desired extension. You can find extension in permissions list by folder/filename pair (for example, marketing/acoupon).
Extension Setup
Go to System -> Users -> User Groups, click to edit Administrators (or any other desired groups) and check access and modify permissions for localisation/country_zones. Now go to Extensions -> Modules and install Countries & Zones Manager module.
How to use
Go to System -> Localisation -> Countries (or Zones) and edit all items accordingly. All changes will be automatically available in the front-end.
NOTE: If you notice, that country or zone names displayed in wrong language, remove their cache manually. Using FTP go to system/cache folder and delete everything with "country" or "zone" word in it. Then switch languages in language module to re-cache names.
Custom ordering
By default OpenCart sorts countries and zones alphabetically. But sometimes it is quite useful to put most popular countries or zones to the top, especially, when you have a lot of countries enabled and some of them have large zone lists. To set custom ordering select Sort Order as Default Ordering value in extension settings. Then re-define Sort Order for countries or zones.
For example, if you want to put New York and Washington DC for USA to the top of the zone list, enter 1 and 2 correspondingly as Sort Order value. Add 2 in Sort Order value for all other zones to avoid any potential issues with sorting. You should now see both cities at the top of the zones list for USA.
Using with other extensions
In general, Countries & Zones Manager should work for 3rd party extensions, which use standard OpenCart functions to get country and zone lists. But if a certain 3rd party extension uses its own functions, names will be displayed improperly. To fix this you need to update 3rd party extension and make it use getItemNames() function from Countries & Zones Manager.
Add the following lines to 3rd party extension before returning country or zone name:
$this->load->model('module/countries_zones');
$names = $this->model_module_countries_zones->getItemNames($table, $id);
You need to pass 2 variables with it:
- $table — table name ('country' or 'zone');
- $id — country or zone ID.
A standard $key => $value array with country or zone names will be returned, where $key — language ID and $value — name for this language. To get county or zone name in current language add these lines:
$country = $names[$this->language->get('code')];
$zone = $names[$this->language->get('code')];
This technique can be used for any extension to get proper names in currently selected language. If you don't know, how to do this yourself, you may contact 3rd party extension developer or use our paid customization services.