2011-08-09 15:16:18 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2011-08-10 17:11:11 +00:00
|
|
|
* WooCommerce countries
|
2011-08-09 15:16:18 +00:00
|
|
|
*
|
2011-08-10 17:11:11 +00:00
|
|
|
* The WooCommerce countries class stores country/state data.
|
2011-08-09 15:16:18 +00:00
|
|
|
*
|
2011-08-10 17:11:11 +00:00
|
|
|
* @class woocommerce_countries
|
|
|
|
* @package WooCommerce
|
|
|
|
* @category Class
|
|
|
|
* @author WooThemes
|
2011-08-09 15:16:18 +00:00
|
|
|
*/
|
2011-08-10 17:11:11 +00:00
|
|
|
class woocommerce_countries {
|
2011-08-09 15:16:18 +00:00
|
|
|
|
2011-11-17 10:40:32 +00:00
|
|
|
var $countries;
|
|
|
|
var $states;
|
2011-12-15 23:24:02 +00:00
|
|
|
var $locale;
|
|
|
|
var $address_formats;
|
2011-08-09 15:16:18 +00:00
|
|
|
|
2011-11-17 10:40:32 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
function __construct() {
|
|
|
|
|
|
|
|
$this->countries = array(
|
|
|
|
'AF' => __('Afghanistan', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'AX' => __('Aland Islands', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'AL' => __('Albania', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'DZ' => __('Algeria', 'woothemes'),
|
|
|
|
'AS' => __('American Samoa', 'woothemes'),
|
|
|
|
'AD' => __('Andorra', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'AO' => __('Angola', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'AI' => __('Anguilla', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'AQ' => __('Antarctica', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'AG' => __('Antigua and Barbuda', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'AR' => __('Argentina', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'AM' => __('Armenia', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'AW' => __('Aruba', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'AU' => __('Australia', 'woothemes'),
|
|
|
|
'AT' => __('Austria', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'AZ' => __('Azerbaijan', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'BS' => __('Bahamas', 'woothemes'),
|
|
|
|
'BH' => __('Bahrain', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'BD' => __('Bangladesh', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'BB' => __('Barbados', 'woothemes'),
|
|
|
|
'BY' => __('Belarus', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'BE' => __('Belgium', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'BZ' => __('Belize', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'BJ' => __('Benin', 'woothemes'),
|
|
|
|
'BM' => __('Bermuda', 'woothemes'),
|
|
|
|
'BT' => __('Bhutan', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'BO' => __('Bolivia', 'woothemes'),
|
|
|
|
'BA' => __('Bosnia and Herzegovina', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'BW' => __('Botswana', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'BV' => __('Bouvet Island', 'woothemes'),
|
|
|
|
'BR' => __('Brazil', 'woothemes'),
|
|
|
|
'IO' => __('British Indian Ocean Territory', 'woothemes'),
|
|
|
|
'VG' => __('British Virgin Islands', 'woothemes'),
|
|
|
|
'BN' => __('Brunei', 'woothemes'),
|
|
|
|
'BG' => __('Bulgaria', 'woothemes'),
|
|
|
|
'BF' => __('Burkina Faso', 'woothemes'),
|
|
|
|
'BI' => __('Burundi', 'woothemes'),
|
|
|
|
'KH' => __('Cambodia', 'woothemes'),
|
|
|
|
'CM' => __('Cameroon', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'CA' => __('Canada', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'CV' => __('Cape Verde', 'woothemes'),
|
|
|
|
'KY' => __('Cayman Islands', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'CF' => __('Central African Republic', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'TD' => __('Chad', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'CL' => __('Chile', 'woothemes'),
|
|
|
|
'CN' => __('China', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'CX' => __('Christmas Island', 'woothemes'),
|
|
|
|
'CC' => __('Cocos (Keeling) Islands', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'CO' => __('Colombia', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'KM' => __('Comoros', 'woothemes'),
|
|
|
|
'CG' => __('Congo (Brazzaville)', 'woothemes'),
|
|
|
|
'CD' => __('Congo (Kinshasa)', 'woothemes'),
|
|
|
|
'CK' => __('Cook Islands', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'CR' => __('Costa Rica', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'HR' => __('Croatia', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'CU' => __('Cuba', 'woothemes'),
|
|
|
|
'CY' => __('Cyprus', 'woothemes'),
|
|
|
|
'CZ' => __('Czech Republic', 'woothemes'),
|
|
|
|
'DK' => __('Denmark', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'DJ' => __('Djibouti', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'DM' => __('Dominica', 'woothemes'),
|
|
|
|
'DO' => __('Dominican Republic', 'woothemes'),
|
|
|
|
'EC' => __('Ecuador', 'woothemes'),
|
|
|
|
'EG' => __('Egypt', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'SV' => __('El Salvador', 'woothemes'),
|
|
|
|
'GQ' => __('Equatorial Guinea', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'ER' => __('Eritrea', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'EE' => __('Estonia', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'ET' => __('Ethiopia', 'woothemes'),
|
|
|
|
'FK' => __('Falkland Islands', 'woothemes'),
|
|
|
|
'FO' => __('Faroe Islands', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'FJ' => __('Fiji', 'woothemes'),
|
|
|
|
'FI' => __('Finland', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'FR' => __('France', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'GF' => __('French Guiana', 'woothemes'),
|
|
|
|
'PF' => __('French Polynesia', 'woothemes'),
|
|
|
|
'TF' => __('French Southern Territories', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'GA' => __('Gabon', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'GM' => __('Gambia', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'GE' => __('Georgia', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'DE' => __('Germany', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'GH' => __('Ghana', 'woothemes'),
|
|
|
|
'GI' => __('Gibraltar', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'GR' => __('Greece', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'GL' => __('Greenland', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'GD' => __('Grenada', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'GP' => __('Guadeloupe', 'woothemes'),
|
|
|
|
'GU' => __('Guam', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'GT' => __('Guatemala', 'woothemes'),
|
|
|
|
'GG' => __('Guernsey', 'woothemes'),
|
|
|
|
'GN' => __('Guinea', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'GW' => __('Guinea-Bissau', 'woothemes'),
|
|
|
|
'GY' => __('Guyana', 'woothemes'),
|
|
|
|
'HT' => __('Haiti', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'HN' => __('Honduras', 'woothemes'),
|
|
|
|
'HK' => __('Hong Kong', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'HU' => __('Hungary', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'IS' => __('Iceland', 'woothemes'),
|
|
|
|
'IN' => __('India', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'ID' => __('Indonesia', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'IR' => __('Iran', 'woothemes'),
|
|
|
|
'IQ' => __('Iraq', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'IE' => __('Ireland', 'woothemes'),
|
|
|
|
'IM' => __('Isle of Man', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'IL' => __('Israel', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'IT' => __('Italy', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'CI' => __('Ivory Coast', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'JM' => __('Jamaica', 'woothemes'),
|
|
|
|
'JP' => __('Japan', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'JE' => __('Jersey', 'woothemes'),
|
|
|
|
'JO' => __('Jordan', 'woothemes'),
|
|
|
|
'KZ' => __('Kazakhstan', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'KE' => __('Kenya', 'woothemes'),
|
|
|
|
'KI' => __('Kiribati', 'woothemes'),
|
|
|
|
'KW' => __('Kuwait', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'KG' => __('Kyrgyzstan', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'LA' => __('Laos', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'LV' => __('Latvia', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'LB' => __('Lebanon', 'woothemes'),
|
|
|
|
'LS' => __('Lesotho', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'LR' => __('Liberia', 'woothemes'),
|
|
|
|
'LY' => __('Libya', 'woothemes'),
|
|
|
|
'LI' => __('Liechtenstein', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'LT' => __('Lithuania', 'woothemes'),
|
|
|
|
'LU' => __('Luxembourg', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'MO' => __('Macao S.A.R., China', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'MK' => __('Macedonia', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'MG' => __('Madagascar', 'woothemes'),
|
|
|
|
'MW' => __('Malawi', 'woothemes'),
|
|
|
|
'MY' => __('Malaysia', 'woothemes'),
|
|
|
|
'MV' => __('Maldives', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'ML' => __('Mali', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'MT' => __('Malta', 'woothemes'),
|
|
|
|
'MH' => __('Marshall Islands', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'MQ' => __('Martinique', 'woothemes'),
|
|
|
|
'MR' => __('Mauritania', 'woothemes'),
|
|
|
|
'MU' => __('Mauritius', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'YT' => __('Mayotte', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'MX' => __('Mexico', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'FM' => __('Micronesia', 'woothemes'),
|
|
|
|
'MD' => __('Moldova', 'woothemes'),
|
|
|
|
'MC' => __('Monaco', 'woothemes'),
|
|
|
|
'MN' => __('Mongolia', 'woothemes'),
|
|
|
|
'ME' => __('Montenegro', 'woothemes'),
|
|
|
|
'MS' => __('Montserrat', 'woothemes'),
|
|
|
|
'MA' => __('Morocco', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'MZ' => __('Mozambique', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'MM' => __('Myanmar', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'NA' => __('Namibia', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'NR' => __('Nauru', 'woothemes'),
|
|
|
|
'NP' => __('Nepal', 'woothemes'),
|
|
|
|
'NL' => __('Netherlands', 'woothemes'),
|
|
|
|
'AN' => __('Netherlands Antilles', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'NC' => __('New Caledonia', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'NZ' => __('New Zealand', 'woothemes'),
|
|
|
|
'NI' => __('Nicaragua', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'NE' => __('Niger', 'woothemes'),
|
|
|
|
'NG' => __('Nigeria', 'woothemes'),
|
|
|
|
'NU' => __('Niue', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'NF' => __('Norfolk Island', 'woothemes'),
|
|
|
|
'KP' => __('North Korea', 'woothemes'),
|
|
|
|
'MP' => __('Northern Mariana Islands', 'woothemes'),
|
|
|
|
'NO' => __('Norway', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'OM' => __('Oman', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'PK' => __('Pakistan', 'woothemes'),
|
|
|
|
'PW' => __('Palau', 'woothemes'),
|
|
|
|
'PS' => __('Palestinian Territory', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'PA' => __('Panama', 'woothemes'),
|
|
|
|
'PG' => __('Papua New Guinea', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'PY' => __('Paraguay', 'woothemes'),
|
|
|
|
'PE' => __('Peru', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'PH' => __('Philippines', 'woothemes'),
|
|
|
|
'PN' => __('Pitcairn', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'PL' => __('Poland', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'PT' => __('Portugal', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'PR' => __('Puerto Rico', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'QA' => __('Qatar', 'woothemes'),
|
|
|
|
'RE' => __('Reunion', 'woothemes'),
|
|
|
|
'RO' => __('Romania', 'woothemes'),
|
|
|
|
'RU' => __('Russia', 'woothemes'),
|
|
|
|
'RW' => __('Rwanda', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'BL' => __('Saint Barthélemy', 'woothemes'),
|
|
|
|
'SH' => __('Saint Helena', 'woothemes'),
|
|
|
|
'KN' => __('Saint Kitts and Nevis', 'woothemes'),
|
|
|
|
'LC' => __('Saint Lucia', 'woothemes'),
|
|
|
|
'MF' => __('Saint Martin (French part)', 'woothemes'),
|
|
|
|
'PM' => __('Saint Pierre and Miquelon', 'woothemes'),
|
|
|
|
'VC' => __('Saint Vincent and the Grenadines', 'woothemes'),
|
|
|
|
'WS' => __('Samoa', 'woothemes'),
|
|
|
|
'SM' => __('San Marino', 'woothemes'),
|
|
|
|
'ST' => __('Sao Tome and Principe', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'SA' => __('Saudi Arabia', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'SN' => __('Senegal', 'woothemes'),
|
|
|
|
'RS' => __('Serbia', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'SC' => __('Seychelles', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'SL' => __('Sierra Leone', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'SG' => __('Singapore', 'woothemes'),
|
|
|
|
'SK' => __('Slovakia', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'SI' => __('Slovenia', 'woothemes'),
|
|
|
|
'SB' => __('Solomon Islands', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'SO' => __('Somalia', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'ZA' => __('South Africa', 'woothemes'),
|
|
|
|
'GS' => __('South Georgia/Sandwich Islands', 'woothemes'),
|
|
|
|
'KR' => __('South Korea', 'woothemes'),
|
|
|
|
'ES' => __('Spain', 'woothemes'),
|
|
|
|
'LK' => __('Sri Lanka', 'woothemes'),
|
|
|
|
'SD' => __('Sudan', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'SR' => __('Suriname', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'SJ' => __('Svalbard and Jan Mayen', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'SZ' => __('Swaziland', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'SE' => __('Sweden', 'woothemes'),
|
|
|
|
'CH' => __('Switzerland', 'woothemes'),
|
|
|
|
'SY' => __('Syria', 'woothemes'),
|
|
|
|
'TW' => __('Taiwan', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'TJ' => __('Tajikistan', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'TZ' => __('Tanzania', 'woothemes'),
|
|
|
|
'TH' => __('Thailand', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'TL' => __('Timor-Leste', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'TG' => __('Togo', 'woothemes'),
|
|
|
|
'TK' => __('Tokelau', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'TO' => __('Tonga', 'woothemes'),
|
|
|
|
'TT' => __('Trinidad and Tobago', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'TN' => __('Tunisia', 'woothemes'),
|
|
|
|
'TR' => __('Turkey', 'woothemes'),
|
|
|
|
'TM' => __('Turkmenistan', 'woothemes'),
|
|
|
|
'TC' => __('Turks and Caicos Islands', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'TV' => __('Tuvalu', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'VI' => __('U.S. Virgin Islands', 'woothemes'),
|
|
|
|
'USAF' => __('US Armed Forces', 'woothemes'),
|
2011-11-23 00:44:11 +00:00
|
|
|
'UM' => __('US Minor Outlying Islands', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'UG' => __('Uganda', 'woothemes'),
|
|
|
|
'UA' => __('Ukraine', 'woothemes'),
|
|
|
|
'AE' => __('United Arab Emirates', 'woothemes'),
|
|
|
|
'GB' => __('United Kingdom', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'US' => __('United States', 'woothemes'),
|
|
|
|
'UY' => __('Uruguay', 'woothemes'),
|
|
|
|
'UZ' => __('Uzbekistan', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'VU' => __('Vanuatu', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'VA' => __('Vatican', 'woothemes'),
|
|
|
|
'VE' => __('Venezuela', 'woothemes'),
|
|
|
|
'VN' => __('Vietnam', 'woothemes'),
|
|
|
|
'WF' => __('Wallis and Futuna', 'woothemes'),
|
2011-12-15 23:24:02 +00:00
|
|
|
'EH' => __('Western Sahara', 'woothemes'),
|
2011-11-17 10:40:32 +00:00
|
|
|
'YE' => __('Yemen', 'woothemes'),
|
|
|
|
'ZM' => __('Zambia', 'woothemes'),
|
|
|
|
'ZW' => __('Zimbabwe', 'woothemes')
|
|
|
|
);
|
2011-12-15 23:24:02 +00:00
|
|
|
|
2011-11-17 10:40:32 +00:00
|
|
|
$this->states = array(
|
|
|
|
'AU' => array(
|
|
|
|
'ACT' => __('Australian Capital Territory', 'woothemes') ,
|
|
|
|
'NSW' => __('New South Wales', 'woothemes') ,
|
|
|
|
'NT' => __('Northern Territory', 'woothemes') ,
|
|
|
|
'QLD' => __('Queensland', 'woothemes') ,
|
|
|
|
'SA' => __('South Australia', 'woothemes') ,
|
|
|
|
'TAS' => __('Tasmania', 'woothemes') ,
|
|
|
|
'VIC' => __('Victoria', 'woothemes') ,
|
|
|
|
'WA' => __('Western Australia', 'woothemes')
|
2011-08-09 15:16:18 +00:00
|
|
|
),
|
2011-12-15 19:22:15 +00:00
|
|
|
'AT' => array(),
|
2011-11-17 10:40:32 +00:00
|
|
|
'BR' => array(
|
|
|
|
'AM' => __('Amazonas', 'woothemes'),
|
|
|
|
'AC' => __('Acre', 'woothemes'),
|
|
|
|
'AL' => __('Alagoas', 'woothemes'),
|
|
|
|
'AP' => __('Amapá', 'woothemes'),
|
|
|
|
'CE' => __('Ceará', 'woothemes'),
|
|
|
|
'DF' => __('Distrito federal', 'woothemes'),
|
|
|
|
'ES' => __('Espirito santo', 'woothemes'),
|
|
|
|
'MA' => __('Maranhão', 'woothemes'),
|
|
|
|
'PR' => __('Paraná', 'woothemes'),
|
|
|
|
'PE' => __('Pernambuco', 'woothemes'),
|
|
|
|
'PI' => __('Piauí', 'woothemes'),
|
|
|
|
'RN' => __('Rio grande do norte', 'woothemes'),
|
|
|
|
'RS' => __('Rio grande do sul', 'woothemes'),
|
|
|
|
'RO' => __('Rondônia', 'woothemes'),
|
|
|
|
'RR' => __('Roraima', 'woothemes'),
|
|
|
|
'SC' => __('Santa catarina', 'woothemes'),
|
|
|
|
'SE' => __('Sergipe', 'woothemes'),
|
|
|
|
'TO' => __('Tocantins', 'woothemes'),
|
|
|
|
'PA' => __('Pará', 'woothemes'),
|
|
|
|
'BH' => __('Bahia', 'woothemes'),
|
|
|
|
'GO' => __('Goiás', 'woothemes'),
|
|
|
|
'MT' => __('Mato grosso', 'woothemes'),
|
|
|
|
'MS' => __('Mato grosso do sul', 'woothemes'),
|
|
|
|
'RJ' => __('Rio de janeiro', 'woothemes'),
|
|
|
|
'SP' => __('São paulo', 'woothemes'),
|
|
|
|
'RS' => __('Rio grande do sul', 'woothemes'),
|
|
|
|
'MG' => __('Minas gerais', 'woothemes'),
|
|
|
|
'PB' => __('Paraiba', 'woothemes'),
|
2011-08-09 15:16:18 +00:00
|
|
|
),
|
2011-11-17 10:40:32 +00:00
|
|
|
'CA' => array(
|
|
|
|
'AB' => __('Alberta', 'woothemes') ,
|
|
|
|
'BC' => __('British Columbia', 'woothemes') ,
|
|
|
|
'MB' => __('Manitoba', 'woothemes') ,
|
|
|
|
'NB' => __('New Brunswick', 'woothemes') ,
|
|
|
|
'NF' => __('Newfoundland', 'woothemes') ,
|
|
|
|
'NT' => __('Northwest Territories', 'woothemes') ,
|
|
|
|
'NS' => __('Nova Scotia', 'woothemes') ,
|
|
|
|
'NU' => __('Nunavut', 'woothemes') ,
|
|
|
|
'ON' => __('Ontario', 'woothemes') ,
|
|
|
|
'PE' => __('Prince Edward Island', 'woothemes') ,
|
|
|
|
'PQ' => __('Quebec', 'woothemes') ,
|
|
|
|
'SK' => __('Saskatchewan', 'woothemes') ,
|
|
|
|
'YT' => __('Yukon Territory', 'woothemes')
|
2011-08-09 15:16:18 +00:00
|
|
|
),
|
2011-12-15 19:22:15 +00:00
|
|
|
'CZ' => array(),
|
2011-12-15 01:14:47 +00:00
|
|
|
'DE' => array(),
|
2011-12-15 19:22:15 +00:00
|
|
|
'DK' => array(),
|
2011-12-15 23:24:02 +00:00
|
|
|
'FI' => array(),
|
|
|
|
'FR' => array(),
|
|
|
|
'HK' => array(
|
|
|
|
'HONG KONG' => __('Hong Kong Island', 'woothemes'),
|
|
|
|
'KOWLOONG' => __('Kowloong', 'woothemes'),
|
|
|
|
'NEW TERRITORIES' => __('New Territories', 'woothemes')
|
|
|
|
),
|
2011-11-17 10:40:32 +00:00
|
|
|
'US' => array(
|
|
|
|
'AL' => __('Alabama', 'woothemes') ,
|
|
|
|
'AK' => __('Alaska', 'woothemes') ,
|
|
|
|
'AZ' => __('Arizona', 'woothemes') ,
|
|
|
|
'AR' => __('Arkansas', 'woothemes') ,
|
|
|
|
'CA' => __('California', 'woothemes') ,
|
|
|
|
'CO' => __('Colorado', 'woothemes') ,
|
|
|
|
'CT' => __('Connecticut', 'woothemes') ,
|
|
|
|
'DE' => __('Delaware', 'woothemes') ,
|
|
|
|
'DC' => __('District Of Columbia', 'woothemes') ,
|
|
|
|
'FL' => __('Florida', 'woothemes') ,
|
|
|
|
'GA' => __('Georgia', 'woothemes') ,
|
|
|
|
'HI' => __('Hawaii', 'woothemes') ,
|
|
|
|
'ID' => __('Idaho', 'woothemes') ,
|
|
|
|
'IL' => __('Illinois', 'woothemes') ,
|
|
|
|
'IN' => __('Indiana', 'woothemes') ,
|
|
|
|
'IA' => __('Iowa', 'woothemes') ,
|
|
|
|
'KS' => __('Kansas', 'woothemes') ,
|
|
|
|
'KY' => __('Kentucky', 'woothemes') ,
|
|
|
|
'LA' => __('Louisiana', 'woothemes') ,
|
|
|
|
'ME' => __('Maine', 'woothemes') ,
|
|
|
|
'MD' => __('Maryland', 'woothemes') ,
|
|
|
|
'MA' => __('Massachusetts', 'woothemes') ,
|
|
|
|
'MI' => __('Michigan', 'woothemes') ,
|
|
|
|
'MN' => __('Minnesota', 'woothemes') ,
|
|
|
|
'MS' => __('Mississippi', 'woothemes') ,
|
|
|
|
'MO' => __('Missouri', 'woothemes') ,
|
|
|
|
'MT' => __('Montana', 'woothemes') ,
|
|
|
|
'NE' => __('Nebraska', 'woothemes') ,
|
|
|
|
'NV' => __('Nevada', 'woothemes') ,
|
|
|
|
'NH' => __('New Hampshire', 'woothemes') ,
|
|
|
|
'NJ' => __('New Jersey', 'woothemes') ,
|
|
|
|
'NM' => __('New Mexico', 'woothemes') ,
|
|
|
|
'NY' => __('New York', 'woothemes') ,
|
|
|
|
'NC' => __('North Carolina', 'woothemes') ,
|
|
|
|
'ND' => __('North Dakota', 'woothemes') ,
|
|
|
|
'OH' => __('Ohio', 'woothemes') ,
|
|
|
|
'OK' => __('Oklahoma', 'woothemes') ,
|
|
|
|
'OR' => __('Oregon', 'woothemes') ,
|
|
|
|
'PA' => __('Pennsylvania', 'woothemes') ,
|
|
|
|
'RI' => __('Rhode Island', 'woothemes') ,
|
|
|
|
'SC' => __('South Carolina', 'woothemes') ,
|
|
|
|
'SD' => __('South Dakota', 'woothemes') ,
|
|
|
|
'TN' => __('Tennessee', 'woothemes') ,
|
|
|
|
'TX' => __('Texas', 'woothemes') ,
|
|
|
|
'UT' => __('Utah', 'woothemes') ,
|
|
|
|
'VT' => __('Vermont', 'woothemes') ,
|
|
|
|
'VA' => __('Virginia', 'woothemes') ,
|
|
|
|
'WA' => __('Washington', 'woothemes') ,
|
|
|
|
'WV' => __('West Virginia', 'woothemes') ,
|
|
|
|
'WI' => __('Wisconsin', 'woothemes') ,
|
|
|
|
'WY' => __('Wyoming', 'woothemes')
|
|
|
|
),
|
|
|
|
'USAF' => array(
|
|
|
|
'AA' => __('Americas', 'woothemes') ,
|
|
|
|
'AE' => __('Europe', 'woothemes') ,
|
|
|
|
'AP' => __('Pacific', 'woothemes')
|
2011-08-09 15:16:18 +00:00
|
|
|
)
|
2011-11-17 10:40:32 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
}
|
2011-08-09 15:16:18 +00:00
|
|
|
|
|
|
|
/** get base country */
|
|
|
|
function get_base_country() {
|
2011-08-10 17:11:11 +00:00
|
|
|
$default = get_option('woocommerce_default_country');
|
2011-08-09 15:16:18 +00:00
|
|
|
if (strstr($default, ':')) :
|
|
|
|
$country = current(explode(':', $default));
|
|
|
|
$state = end(explode(':', $default));
|
|
|
|
else :
|
|
|
|
$country = $default;
|
|
|
|
$state = '';
|
|
|
|
endif;
|
|
|
|
|
|
|
|
return $country;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** get base state */
|
|
|
|
function get_base_state() {
|
2011-08-10 17:11:11 +00:00
|
|
|
$default = get_option('woocommerce_default_country');
|
2011-08-09 15:16:18 +00:00
|
|
|
if (strstr($default, ':')) :
|
|
|
|
$country = current(explode(':', $default));
|
|
|
|
$state = end(explode(':', $default));
|
|
|
|
else :
|
|
|
|
$country = $default;
|
|
|
|
$state = '';
|
|
|
|
endif;
|
|
|
|
|
|
|
|
return $state;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** get countries we allow only */
|
|
|
|
function get_allowed_countries() {
|
|
|
|
|
2011-09-06 11:11:22 +00:00
|
|
|
$countries = $this->countries;
|
2011-08-09 15:16:18 +00:00
|
|
|
|
2011-08-10 17:11:11 +00:00
|
|
|
if (get_option('woocommerce_allowed_countries')!=='specific') return $countries;
|
2011-08-09 15:16:18 +00:00
|
|
|
|
|
|
|
$allowed_countries = array();
|
|
|
|
|
2011-08-10 17:11:11 +00:00
|
|
|
$allowed_countries_raw = get_option('woocommerce_specific_allowed_countries');
|
2011-08-09 15:16:18 +00:00
|
|
|
|
|
|
|
foreach ($allowed_countries_raw as $country) :
|
|
|
|
|
|
|
|
$allowed_countries[$country] = $countries[$country];
|
|
|
|
|
|
|
|
endforeach;
|
|
|
|
|
|
|
|
asort($allowed_countries);
|
|
|
|
|
|
|
|
return $allowed_countries;
|
|
|
|
}
|
|
|
|
|
2011-10-31 10:54:49 +00:00
|
|
|
/** Gets an array of countries in the EU */
|
|
|
|
function get_european_union_countries() {
|
|
|
|
return array('AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HU', 'IE', 'IT', 'LT', 'LU', 'LV', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK');
|
|
|
|
}
|
|
|
|
|
2011-08-09 15:16:18 +00:00
|
|
|
/** Gets the correct string for shipping - ether 'to the' or 'to' */
|
|
|
|
function shipping_to_prefix() {
|
2011-09-06 11:11:22 +00:00
|
|
|
global $woocommerce;
|
2011-08-09 15:16:18 +00:00
|
|
|
$return = '';
|
2011-12-14 23:50:32 +00:00
|
|
|
if (in_array($woocommerce->customer->get_shipping_country(), array( 'GB', 'US', 'AE', 'CZ', 'DO', 'NL', 'PH', 'USAF' ))) $return = __('to the', 'woothemes');
|
2011-08-10 17:11:11 +00:00
|
|
|
else $return = __('to', 'woothemes');
|
2011-10-31 10:54:49 +00:00
|
|
|
return apply_filters('woocommerce_countries_shipping_to_prefix', $return, $woocommerce->customer->get_shipping_country());
|
2011-08-09 15:16:18 +00:00
|
|
|
}
|
|
|
|
|
2011-10-31 10:54:49 +00:00
|
|
|
/** Prefix certain countries with 'the' */
|
2011-08-09 15:16:18 +00:00
|
|
|
function estimated_for_prefix() {
|
2011-09-06 11:11:22 +00:00
|
|
|
global $woocommerce;
|
2011-08-09 15:16:18 +00:00
|
|
|
$return = '';
|
2011-12-14 23:50:32 +00:00
|
|
|
if (in_array($this->get_base_country(), array( 'GB', 'US', 'AE', 'CZ', 'DO', 'NL', 'PH', 'USAF' ))) $return = __('the', 'woothemes') . ' ';
|
|
|
|
return apply_filters('woocommerce_countries_estimated_for_prefix', $return, $this->get_base_country());
|
2011-10-31 10:54:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** Correctly name tax in some countries VAT on the frontend */
|
|
|
|
function tax_or_vat() {
|
|
|
|
global $woocommerce;
|
|
|
|
|
2011-11-22 13:18:33 +00:00
|
|
|
$return = ( in_array($this->get_base_country(), $this->get_european_union_countries()) ) ? __('VAT', 'woothemes') : __('Tax', 'woothemes');
|
2011-10-31 10:54:49 +00:00
|
|
|
|
|
|
|
return apply_filters('woocommerce_countries_tax_or_vat', $return);
|
|
|
|
}
|
|
|
|
|
2011-11-26 16:15:25 +00:00
|
|
|
function inc_tax_or_vat( $rate = false ) {
|
2011-10-31 10:54:49 +00:00
|
|
|
global $woocommerce;
|
|
|
|
|
2011-11-27 00:03:46 +00:00
|
|
|
if ( $rate > 0 || $rate === 0 ) :
|
2011-12-01 11:34:26 +00:00
|
|
|
$rate = rtrim(rtrim($rate, '0'), '.');
|
2011-11-26 16:15:25 +00:00
|
|
|
if (!$rate) $rate = 0;
|
|
|
|
$return = ( in_array($this->get_base_country(), $this->get_european_union_countries()) ) ? sprintf(__('(inc. %s%% VAT)', 'woothemes'), $rate) : sprintf(__('(inc. %s%% tax)', 'woothemes'), $rate);
|
|
|
|
else :
|
|
|
|
$return = ( in_array($this->get_base_country(), $this->get_european_union_countries()) ) ? __('(inc. VAT)', 'woothemes') : __('(inc. tax)', 'woothemes');
|
|
|
|
endif;
|
2011-10-31 10:54:49 +00:00
|
|
|
|
2011-11-26 16:15:25 +00:00
|
|
|
return apply_filters('woocommerce_countries_inc_tax_or_vat', $return, $rate);
|
2011-10-31 10:54:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function ex_tax_or_vat() {
|
|
|
|
global $woocommerce;
|
|
|
|
|
|
|
|
$return = ( in_array($this->get_base_country(), $this->get_european_union_countries()) ) ? __('(ex. VAT)', 'woothemes') : __('(ex. tax)', 'woothemes');
|
|
|
|
|
|
|
|
return apply_filters('woocommerce_countries_ex_tax_or_vat', $return);
|
2011-08-09 15:16:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** get states */
|
|
|
|
function get_states( $cc ) {
|
2011-09-06 11:11:22 +00:00
|
|
|
if (isset( $this->states[$cc] )) return $this->states[$cc];
|
2011-08-09 15:16:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** Outputs the list of countries and states for use in dropdown boxes */
|
|
|
|
function country_dropdown_options( $selected_country = '', $selected_state = '', $escape=false ) {
|
|
|
|
|
2011-09-06 11:11:22 +00:00
|
|
|
$countries = $this->countries;
|
2011-08-09 15:16:18 +00:00
|
|
|
|
|
|
|
if ( $countries ) foreach ( $countries as $key=>$value) :
|
2011-09-06 11:11:22 +00:00
|
|
|
if ( $states = $this->get_states($key) ) :
|
2011-08-09 15:16:18 +00:00
|
|
|
echo '<optgroup label="'.$value.'">';
|
|
|
|
foreach ($states as $state_key=>$state_value) :
|
|
|
|
echo '<option value="'.$key.':'.$state_key.'"';
|
|
|
|
|
|
|
|
if ($selected_country==$key && $selected_state==$state_key) echo ' selected="selected"';
|
|
|
|
|
|
|
|
echo '>'.$value.' — '. ($escape ? esc_js($state_value) : $state_value) .'</option>';
|
|
|
|
endforeach;
|
|
|
|
echo '</optgroup>';
|
|
|
|
else :
|
|
|
|
echo '<option';
|
|
|
|
if ($selected_country==$key && $selected_state=='*') echo ' selected="selected"';
|
2011-08-10 17:11:11 +00:00
|
|
|
echo ' value="'.$key.'">'. ($escape ? esc_js( __($value, 'woothemes') ) : __($value, 'woothemes') ) .'</option>';
|
2011-08-09 15:16:18 +00:00
|
|
|
endif;
|
|
|
|
endforeach;
|
|
|
|
}
|
2011-08-24 16:23:04 +00:00
|
|
|
|
|
|
|
/** Outputs the list of countries and states for use in multiselect boxes */
|
|
|
|
function country_multiselect_options( $selected_countries = '', $escape=false ) {
|
|
|
|
|
2011-09-06 11:11:22 +00:00
|
|
|
$countries = $this->countries;
|
2011-08-24 16:23:04 +00:00
|
|
|
|
|
|
|
if ( $countries ) foreach ( $countries as $key=>$value) :
|
2011-09-06 11:11:22 +00:00
|
|
|
if ( $states = $this->get_states($key) ) :
|
2011-08-24 16:23:04 +00:00
|
|
|
echo '<optgroup label="'.$value.'">';
|
|
|
|
foreach ($states as $state_key=>$state_value) :
|
|
|
|
echo '<option value="'.$key.':'.$state_key.'"';
|
|
|
|
|
|
|
|
if (isset($selected_countries[$key]) && in_array($state_key, $selected_countries[$key])) echo ' selected="selected"';
|
|
|
|
|
|
|
|
echo '>' . ($escape ? esc_js($state_value) : $state_value) .'</option>';
|
|
|
|
endforeach;
|
|
|
|
echo '</optgroup>';
|
|
|
|
else :
|
|
|
|
echo '<option';
|
|
|
|
|
|
|
|
if (isset($selected_countries[$key]) && in_array('*', $selected_countries[$key])) echo ' selected="selected"';
|
|
|
|
|
|
|
|
echo ' value="'.$key.'">'. ($escape ? esc_js( __($value, 'woothemes') ) : __($value, 'woothemes') ) .'</option>';
|
|
|
|
endif;
|
|
|
|
endforeach;
|
|
|
|
}
|
2011-12-15 23:24:02 +00:00
|
|
|
|
|
|
|
/** Get country address formats */
|
|
|
|
function get_address_format( $country = '' ) {
|
|
|
|
|
|
|
|
if (!$this->address_formats) :
|
|
|
|
$this->address_formats = apply_filters('woocommerce_localisation_address_formats', array(
|
|
|
|
'default' => "{name}\n{company}\n{address_1}\n{address_2}\n{city}\n{state}\n{postcode}\n{country}",
|
|
|
|
'AU' => "{name}\n{company}\n{address_1}\n{address_2}\n{city} {state} {postcode}\n{country}",
|
|
|
|
'AT' => "{name}\n{company}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}",
|
|
|
|
'CN' => "{country} {postcode}\n{state}, {city}, {address_2}, {address_1}\n{company}\n{name}",
|
|
|
|
'CZ' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}",
|
|
|
|
'DE' => "{name}\n{company}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}",
|
|
|
|
'FI' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}",
|
|
|
|
'DK' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}",
|
|
|
|
'FR' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city_upper}\n{country}",
|
|
|
|
'HK' => "{company}\n{first_name} {last_name_upper}\n{address_1}\n{address_2}\n{city_upper}\n{state_upper}\n{country}"
|
|
|
|
));
|
|
|
|
endif;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Get country locale settings */
|
|
|
|
function get_country_locale() {
|
|
|
|
global $woocommerce;
|
|
|
|
|
|
|
|
if (!$this->locale) :
|
|
|
|
|
|
|
|
// Locale information used by the checkout
|
|
|
|
$this->locale = array(
|
|
|
|
|
|
|
|
// Austria
|
|
|
|
'AT' => array(
|
|
|
|
'city' => array(
|
|
|
|
'position' => 7,
|
|
|
|
'class' => array('form-row-last')
|
|
|
|
),
|
|
|
|
'postcode' => array(
|
|
|
|
'position' => 6,
|
|
|
|
'class' => array('form-row-first update_totals_on_change')
|
|
|
|
),
|
|
|
|
'state' => array(
|
|
|
|
'required' => false
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
// Canada
|
|
|
|
'CA' => array(
|
|
|
|
'state' => array(
|
|
|
|
'label' => __('Province', 'woothemes')
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
// Chile
|
|
|
|
'CL' => array(
|
|
|
|
'state' => array(
|
|
|
|
'required' => false,
|
|
|
|
'label' => __('Municipality', 'woothemes')
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
// China
|
|
|
|
'CN' => array(
|
|
|
|
'state' => array(
|
|
|
|
'label' => __('Province', 'woothemes')
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
// Czech Republic
|
|
|
|
'CZ' => array(
|
|
|
|
'city' => array(
|
|
|
|
'label' => __('Town', 'woothemes')
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
// Germany
|
|
|
|
'DE' => array(
|
|
|
|
'city' => array(
|
|
|
|
'position' => 7,
|
|
|
|
'class' => array('form-row-last')
|
|
|
|
),
|
|
|
|
'postcode' => array(
|
|
|
|
'position' => 6,
|
|
|
|
'class' => array('form-row-first update_totals_on_change')
|
|
|
|
),
|
|
|
|
'state' => array(
|
|
|
|
'required' => false
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
// Denmark
|
|
|
|
'DK' => array(
|
|
|
|
'city' => array(
|
|
|
|
'position' => 7,
|
|
|
|
'class' => array('form-row-last')
|
|
|
|
),
|
|
|
|
'postcode' => array(
|
|
|
|
'position' => 6,
|
|
|
|
'class' => array('form-row-first update_totals_on_change')
|
|
|
|
),
|
|
|
|
'city' => array(
|
|
|
|
'label' => __('Town', 'woothemes')
|
|
|
|
),
|
|
|
|
'state' => array(
|
|
|
|
'required' => false
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
// Finland
|
|
|
|
'FI' => array(
|
|
|
|
'city' => array(
|
|
|
|
'position' => 7,
|
|
|
|
'class' => array('form-row-last')
|
|
|
|
),
|
|
|
|
'postcode' => array(
|
|
|
|
'position' => 6,
|
|
|
|
'class' => array('form-row-first update_totals_on_change')
|
|
|
|
),
|
|
|
|
'city' => array(
|
|
|
|
'label' => __('Town', 'woothemes')
|
|
|
|
),
|
|
|
|
'state' => array(
|
|
|
|
'required' => false
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
// France
|
|
|
|
'FR' => array(
|
|
|
|
'city' => array(
|
|
|
|
'position' => 7,
|
|
|
|
'class' => array('form-row-last')
|
|
|
|
),
|
|
|
|
'postcode' => array(
|
|
|
|
'position' => 6,
|
|
|
|
'class' => array('form-row-first update_totals_on_change')
|
|
|
|
),
|
|
|
|
'city' => array(
|
|
|
|
'label' => __('Town', 'woothemes')
|
|
|
|
),
|
|
|
|
'state' => array(
|
|
|
|
'required' => false
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
// Hong Kong
|
|
|
|
'HK' => array(
|
|
|
|
'postcode' => array(
|
|
|
|
'required' => false
|
|
|
|
),
|
|
|
|
'city' => array(
|
|
|
|
'label' => __('Town/District', 'woothemes')
|
|
|
|
),
|
|
|
|
'state' => array(
|
|
|
|
'label' => __('Region', 'woothemes')
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
endif;
|
|
|
|
|
|
|
|
return array_intersect_key($this->locale, $this->get_allowed_countries());
|
|
|
|
|
|
|
|
}
|
2011-08-09 15:16:18 +00:00
|
|
|
}
|
|
|
|
|