<?php
// $Id: costa_rica_188_1.cif,v 1.2.4.3 2010-11-02 06:42:17 tr Exp $

/**
 * First implement hook_install() using the name of the country as the base of
 * the function name.
 */
function costa_rica_install() {
  // Make the entry in the country table.
  // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  db_query("INSERT INTO {uc_countries} VALUES (188, 'Costa Rica', 'CR', 'CRA', 1)");

  // Make the entries in the zones table.  Use %d for the zone_id and the
  // function uc_get_zone_ids($num) as the second argument for db_query() where
  // $num is the number of zones in the INSERT query.
  // VALUES = %d for ID, Parent Country ID, Zone Abbreviation, Zone Name
  db_query("INSERT INTO {uc_zones} VALUES "
          ."(%d, 188, 'AL','Alajuela'),"
          ."(%d, 188, 'CA','Cartago'),"
          ."(%d, 188, 'GU','Guanacaste'),"
          ."(%d, 188, 'HE','Heredia'),"
          ."(%d, 188, 'LI','Limón'),"
          ."(%d, 188, 'PU','Puntarenas'),"
          ."(%d, 188, 'SJ','San José')",
          uc_get_zone_ids(7));

  // Use uc_set_address_format() with the country ID as the first argument and
  // an address format string as the second.  Documentation on address formats
  // is available at:
  // http://www.ubercart.org/ubercart_users_guide/country_settings#address_format_docs
  uc_set_address_format(188,
    "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
   ."\r\n!city !zone_code !postal_code\r\n!country_name_if");
}
