TYPO3/Configure countries regions states

From Aimeos documentation

TYPO3
Other languages:
English 100% • ‎русский 0%

Countries

If you want to ship your products to several countries or you need to know from which countries your customers are, you have to enable the country selection in the address page of the checkout process.

By default, the country list is hidden for the billing and delivery address in the checkout process. To make show them and make them mandatory you need to add "order.base.address.countryid" to the list of values defined in

In TYPO3 this is configured for billing and delivery addresses via TypoScript:

  1. plugin.tx_aimeos.settings.client.html.checkout.standard.address {
  2.     billing.mandatory {
  3.         0 = order.base.address.salutation
  4.         1 = order.base.address.firstname
  5.         2 = order.base.address.lastname
  6.         3 = order.base.address.address1
  7.         4 = order.base.address.postal
  8.         5 = order.base.address.city
  9.         6 = order.base.address.languageid
  10.         7 = order.base.address.email
  11.         8 = order.base.address.countryid
  12.     }
  13.     delivery.mandatory < .billing.mandatory
  14. }

If no selection should be enforced, you can use instead

In TYPO3 the country for billing and delivery addresses are optional with this TypoScript configuration:

  1. plugin.tx_aimeos.settings.client.html.checkout.standard.address {
  2.     billing.optional {
  3.         0 = order.base.address.salutation
  4.         1 = order.base.address.firstname
  5.         2 = order.base.address.lastname
  6.         3 = order.base.address.address1
  7.         4 = order.base.address.postal
  8.         5 = order.base.address.city
  9.         6 = order.base.address.languageid
  10.         7 = order.base.address.email
  11.         8 = order.base.address.countryid
  12.     }
  13.     delivery.optional < .billing.optional
  14. }

The list of countries is defined by the values added to the configuration key client/html/checkout/standard/address/countries. The TypoScript below will add all countries worldwide to the select boxes for the billing and delivery address:

  1. plugin.tx_aimeos.settings.client.html.checkout.standard.address.countries {
  2.      0 = AD
  3.      # Andorra
  4.      1 = AE
  5.      # United Arab Emirates
  6.      2 = AF
  7.      # Afghanistan
  8.      3 = AG
  9.      # Antigua and Barbuda
  10.      4 = AI
  11.      # Anguilla
  12.      5 = AL
  13.      # Albania
  14.      6 = AM
  15.      # Armenia
  16.      7 = AO
  17.      # Angola
  18.      8 = AQ
  19.      # Antarctica
  20.      9 = AR
  21.      # Argentina
  22.      10 = AS
  23.      # American Samoa
  24.      11 = AT
  25.      # Austria
  26.      12 = AU
  27.      # Australia
  28.      13 = AW
  29.      # Aruba
  30.      14 = AX
  31.      # Åland Islands
  32.      15 = AZ
  33.      # Azerbaijan
  34.      16 = BA
  35.      # Bosnia and Herzegovina
  36.      17 = BB
  37.      # Barbados
  38.      18 = BD
  39.      # Bangladesh
  40.      19 = BE
  41.      # Belgium
  42.      20 = BF
  43.      # Burkina Faso
  44.      21 = BG
  45.      # Bulgaria
  46.      22 = BH
  47.      # Bahrain
  48.      23 = BI
  49.      # Burundi
  50.      24 = BJ
  51.      # Benin
  52.      25 = BL
  53.      # Saint Barthélemy
  54.      26 = BM
  55.      # Bermuda
  56.      27 = BN
  57.      # Brunei Darussalam
  58.      28 = BO
  59.      # Bolivia, Plurinational State of
  60.      29 = BQ
  61.      # Bonaire, Sint Eustatius and Saba
  62.      30 = BR
  63.      # Brazil
  64.      31 = BS
  65.      # Bahamas
  66.      32 = BT
  67.      # Bhutan
  68.      33 = BV
  69.      # Bouvet Island
  70.      34 = BW
  71.      # Botswana
  72.      35 = BY
  73.      # Belarus
  74.      36 = BZ
  75.      # Belize
  76.      37 = CA
  77.      # Canada
  78.      38 = CC
  79.      # Cocos (Keeling) Islands
  80.      39 = CD
  81.      # Congo, the Democratic Republic of the
  82.      40 = CF
  83.      # Central African Republic
  84.      41 = CG
  85.      # Congo
  86.      42 = CH
  87.      # Switzerland
  88.      43 = CI
  89.      # Côte d'Ivoire
  90.      44 = CK
  91.      # Cook Islands
  92.      45 = CL
  93.      # Chile
  94.      46 = CM
  95.      # Cameroon
  96.      47 = CN
  97.      # China
  98.      48 = CO
  99.      # Colombia
  100.      49 = CR
  101.      # Costa Rica
  102.      50 = CU
  103.      # Cuba
  104.      51 = CV
  105.      # Cape Verde
  106.      52 = CW
  107.      # Curaçao
  108.      53 = CX
  109.      # Christmas Island
  110.      54 = CY
  111.      # Cyprus
  112.      55 = CZ
  113.      # Czech Republic
  114.      56 = DE
  115.      # Germany
  116.      57 = DJ
  117.      # Djibouti
  118.      58 = DK
  119.      # Denmark
  120.      59 = DM
  121.      # Dominica
  122.      60 = DO
  123.      # Dominican Republic
  124.      61 = DZ
  125.      # Algeria
  126.      62 = EC
  127.      # Ecuador
  128.      63 = EE
  129.      # Estonia
  130.      64 = EG
  131.      # Egypt
  132.      65 = EH
  133.      # Western Sahara
  134.      66 = ER
  135.      # Eritrea
  136.      67 = ES
  137.      # Spain
  138.      68 = ET
  139.      # Ethiopia
  140.      69 = FI
  141.      # Finland
  142.      70 = FJ
  143.      # Fiji
  144.      71 = FK
  145.      # Falkland Islands (Malvinas)
  146.      72 = FM
  147.      # Micronesia, Federated States of
  148.      73 = FO
  149.      # Faroe Islands
  150.      74 = FR
  151.      # France
  152.      75 = GA
  153.      # Gabon
  154.      76 = GB
  155.      # United Kingdom
  156.      77 = GD
  157.      # Grenada
  158.      78 = GE
  159.      # Georgia
  160.      79 = GF
  161.      # French Guiana
  162.      80 = GG
  163.      # Guernsey
  164.      81 = GH
  165.      # Ghana
  166.      82 = GI
  167.      # Gibraltar
  168.      83 = GL
  169.      # Greenland
  170.      84 = GM
  171.      # Gambia
  172.      85 = GN
  173.      # Guinea
  174.      86 = GP
  175.      # Guadeloupe
  176.      87 = GQ
  177.      # Equatorial Guinea
  178.      88 = GR
  179.      # Greece
  180.      89 = GS
  181.      # South Georgia and the South Sandwich Islands
  182.      90 = GT
  183.      # Guatemala
  184.      91 = GU
  185.      # Guam
  186.      92 = GW
  187.      # Guinea-Bissau
  188.      93 = GY
  189.      # Guyana
  190.      94 = HK
  191.      # Hong Kong
  192.      95 = HM
  193.      # Heard Island and McDonald Islands
  194.      96 = HN
  195.      # Honduras
  196.      97 = HR
  197.      # Croatia
  198.      98 = HT
  199.      # Haiti
  200.      99 = HU
  201.      # Hungary
  202.      100 = ID
  203.      # Indonesia
  204.      101 = IE
  205.      # Ireland
  206.      102 = IL
  207.      # Israel
  208.      103 = IM
  209.      # Isle of Man
  210.      104 = IN
  211.      # India
  212.      105 = IO
  213.      # British Indian Ocean Territory
  214.      106 = IQ
  215.      # Iraq
  216.      107 = IR
  217.      # Iran, Islamic Republic of
  218.      108 = IS
  219.      # Iceland
  220.      109 = IT
  221.      # Italy
  222.      110 = JE
  223.      # Jersey
  224.      111 = JM
  225.      # Jamaica
  226.      112 = JO
  227.      # Jordan
  228.      113 = JP
  229.      # Japan
  230.      114 = KE
  231.      # Kenya
  232.      115 = KG
  233.      # Kyrgyzstan
  234.      116 = KH
  235.      # Cambodia
  236.      117 = KI
  237.      # Kiribati
  238.      118 = KM
  239.      # Comoros
  240.      119 = KN
  241.      # Saint Kitts and Nevis
  242.      120 = KP
  243.      # Korea, Democratic People's Republic of
  244.      121 = KR
  245.      # Korea, Republic of
  246.      122 = KW
  247.      # Kuwait
  248.      123 = KY
  249.      # Cayman Islands
  250.      124 = KZ
  251.      # Kazakhstan
  252.      125 = LA
  253.      # Lao People's Democratic Republic
  254.      126 = LB
  255.      # Lebanon
  256.      127 = LC
  257.      # Saint Lucia
  258.      128 = LI
  259.      # Liechtenstein
  260.      129 = LK
  261.      # Sri Lanka
  262.      130 = LR
  263.      # Liberia
  264.      131 = LS
  265.      # Lesotho
  266.      132 = LT
  267.      # Lithuania
  268.      133 = LU
  269.      # Luxembourg
  270.      134 = LV
  271.      # Latvia
  272.      135 = LY
  273.      # Libya
  274.      136 = MA
  275.      # Morocco
  276.      137 = MC
  277.      # Monaco
  278.      138 = MD
  279.      # Moldova, Republic of
  280.      139 = ME
  281.      # Montenegro
  282.      140 = MF
  283.      # Saint Martin (French part)
  284.      141 = MG
  285.      # Madagascar
  286.      142 = MH
  287.      # Marshall Islands
  288.      143 = MK
  289.      # Macedonia
  290.      144 = ML
  291.      # Mali
  292.      145 = MM
  293.      # Myanmar
  294.      146 = MN
  295.      # Mongolia
  296.      147 = MO
  297.      # Macao
  298.      148 = MP
  299.      # Northern Mariana Islands
  300.      149 = MQ
  301.      # Martinique
  302.      150 = MR
  303.      # Mauritania
  304.      151 = MS
  305.      # Montserrat
  306.      152 = MT
  307.      # Malta
  308.      153 = MU
  309.      # Mauritius
  310.      154 = MV
  311.      # Maldives
  312.      155 = MW
  313.      # Malawi
  314.      156 = MX
  315.      # Mexico
  316.      157 = MY
  317.      # Malaysia
  318.      158 = MZ
  319.      # Mozambique
  320.      159 = NA
  321.      # Namibia
  322.      160 = NC
  323.      # New Caledonia
  324.      161 = NE
  325.      # Niger
  326.      162 = NF
  327.      # Norfolk Island
  328.      163 = NG
  329.      # Nigeria
  330.      164 = NI
  331.      # Nicaragua
  332.      165 = NL
  333.      # Netherlands
  334.      166 = NO
  335.      # Norway
  336.      167 = NP
  337.      # Nepal
  338.      168 = NR
  339.      # Nauru
  340.      169 = NU
  341.      # Niue
  342.      170 = NZ
  343.      # New Zealand
  344.      171 = OM
  345.      # Oman
  346.      172 = PA
  347.      # Panama
  348.      173 = PE
  349.      # Peru
  350.      174 = PF
  351.      # French Polynesia
  352.      175 = PG
  353.      # Papua New Guinea
  354.      176 = PH
  355.      # Philippines
  356.      177 = PK
  357.      # Pakistan
  358.      178 = PL
  359.      # Poland
  360.      179 = PM
  361.      # Saint Pierre and Miquelon
  362.      180 = PN
  363.      # Pitcairn
  364.      181 = PR
  365.      # Puerto Rico
  366.      182 = PS
  367.      # Palestine, State of
  368.      183 = PT
  369.      # Portugal
  370.      184 = PW
  371.      # Palau
  372.      185 = PY
  373.      # Paraguay
  374.      186 = QA
  375.      # Qatar
  376.      187 = RE
  377.      # Réunion
  378.      188 = RO
  379.      # Romania
  380.      189 = RS
  381.      # Serbia
  382.      190 = RU
  383.      # Russian Federation
  384.      191 = RW
  385.      # Rwanda
  386.      192 = SA
  387.      # Saudi Arabia
  388.      193 = SB
  389.      # Solomon Islands
  390.      194 = SC
  391.      # Seychelles
  392.      195 = SD
  393.      # Sudan
  394.      196 = SE
  395.      # Sweden
  396.      197 = SG
  397.      # Singapore
  398.      198 = SH
  399.      # Saint Helena, Ascension and Tristan da Cunha
  400.      199 = SI
  401.      # Slovenia
  402.      200 = SJ
  403.      # Svalbard and Jan Mayen
  404.      201 = SK
  405.      # Slovakia
  406.      202 = SL
  407.      # Sierra Leone
  408.      203 = SM
  409.      # San Marino
  410.      204 = SN
  411.      # Senegal
  412.      205 = SO
  413.      # Somalia
  414.      206 = SR
  415.      # Suriname
  416.      207 = SS
  417.      # South Sudan
  418.      208 = ST
  419.      # Sao Tome and Principe
  420.      209 = SV
  421.      # El Salvador
  422.      210 = SX
  423.      # Sint Maarten (Dutch part)
  424.      211 = SY
  425.      # Syrian Arab Republic
  426.      212 = SZ
  427.      # Swaziland
  428.      213 = TC
  429.      # Turks and Caicos Islands
  430.      214 = TD
  431.      # Chad
  432.      215 = TF
  433.      # French Southern Territories
  434.      216 = TG
  435.      # Togo
  436.      217 = TH
  437.      # Thailand
  438.      218 = TJ
  439.      # Tajikistan
  440.      219 = TK
  441.      # Tokelau
  442.      220 = TL
  443.      # Timor-Leste
  444.      221 = TM
  445.      # Turkmenistan
  446.      222 = TN
  447.      # Tunisia
  448.      223 = TO
  449.      # Tonga
  450.      224 = TR
  451.      # Turkey
  452.      225 = TT
  453.      # Trinidad and Tobago
  454.      226 = TV
  455.      # Tuvalu
  456.      227 = TW
  457.      # Taiwan
  458.      228 = TZ
  459.      # Tanzania, United Republic of
  460.      229 = UA
  461.      # Ukraine
  462.      230 = UG
  463.      # Uganda
  464.      231 = UM
  465.      # United States Minor Outlying Islands
  466.      232 = US
  467.      # United States
  468.      233 = UY
  469.      # Uruguay
  470.      234 = UZ
  471.      # Uzbekistan
  472.      235 = VA
  473.      # Vatican City State (Holy See)
  474.      236 = VC
  475.      # Saint Vincent and the Grenadines
  476.      237 = VE
  477.      # Venezuela, Bolivarian Republic of
  478.      238 = VG
  479.      # Virgin Islands, British
  480.      239 = VI
  481.      # Virgin Islands, U.S.
  482.      240 = VN
  483.      # Viet Nam
  484.      241 = VU
  485.      # Vanuatu
  486.      242 = WF
  487.      # Wallis and Futuna
  488.      243 = WS
  489.      # Samoa
  490.      244 = YE
  491.      # Yemen
  492.      245 = YT
  493.      # Mayotte
  494.      246 = ZA
  495.      # South Africa
  496.      247 = ZM
  497.      # Zambia
  498.      248 = ZW
  499.      # Zimbabwe
  500.  }

States and Regions

For each country you can freely define a list of states or regions that can be used afterwards to calculate the final price for each delivery option. To define states or regions via TypoScript use something like this:

  1. plugin.tx_aimeos.settings.client.html.checkout.standard.address.states {
  2.     US {
  3.         CA = California
  4.         NY = New York
  5.        ...
  6.     }
  7.     EU {
  8.         W = Western Europe
  9.         C = Central Europe
  10.         ...
  11.     }
  12. }

The key you have chosen for the state or region will be stored in the order address of the customer and can then be used during the rest of the checkout process. More details can be found in the documentation of the configuration option: