Countries

Countries are key for demographics.

States/Counties/Provinces/Zones

A country can be divided into states/counties/zones/provinces. These are referred to as country zones. Some countries require zones specified in the shipping address. Some require zone for tax reasons.

By adding the country zones to LiteCart your customers can easily provide the information required.

Can I disable countries?

Disabling a country in LiteCart makes customers unable to select it from the list of countries.

How does LiteCart attempt to identify the user country?

LiteCart attempts to identify the country of the user visiting your website in the following detection order:

  1. Get country from current PHP session
  2. Get country from a previously set cookie
  3. Get country from the browser locale (primary)
  4. Get country from country TLD
  5. Get default country
  6. Get system country
  7. Get first country in list

Entity Object

$country = new ent_country();
$country->data['iso_code_2'] = 'XX';
$country->data['iso_code_3'] = 'XXX';
$country->data['name'] = 'Name of Country';
$country->save();

Reference Model

echo reference::country('US')->name;
echo reference::country('USA')->format_address($address);

Database Query

$query = database::query(
  "select * from ". DB_TABLE_PREFIX ."countries
  where iso_code_2 = '". database::input($country_code) ."'
  limit 1;"
);

$country = database::fetch($query);

Revisiot

Äskettäin muokatut artikkelit