多嚿魚教室

Opencart優化技巧

In Opencart Admin panel, this is an Autocomplete function for entry of product attributes. When user types in something into the text field of product attribute, a word box of defined product attributes will appear below the field to let user click that wanted to save the typing time.

However, if the user does not click the word box and type a complete word by oneself, the Opencart system will not save the product attribute data the user types. In fact, the Autocomplete function wanted to prevent user inputting undefined product attributes. In other words, the system does not record what the user types but just detects which item the user clicks in the word box. The Autocomplete function is user-unfriendly, especially there are many product attributes defined.

To simplify the entry of product attributes, I have programmed a vQmod plug-in to change the text field into drop-down list so that the user does not need to type anything.

If vQmod have been installed in your Opencart system,
click the below fish and save the XML script into the directory [vqmod/xml].


<p>
&#60;!--<br />
Make sure that you have properly installed Opencart vQmod.<br />
Copy this page of script.<br />
Save as a .xml file of utf-8 encoding without BOM into the directory [vqmod/xml].<br />
Name the file as you like.<br />
--&gt;</p>
<pre contenteditable="true">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;modification&gt;
 &lt;id&gt;Display attribute choices of products in drop-down list&lt;/id&gt;
 &lt;version&gt;1.1.0&lt;/version&gt;
 &lt;author&gt;Flexidigi Solution Ltd.&lt;/author&gt;
 &lt;file name=&quot;admin/model/catalog/product.php&quot;&gt;
  &lt;operation&gt;
   &lt;search position=&quot;after&quot;&gt;&lt;![CDATA[class ModelCatalogProduct extends Model {]]&gt;&lt;/search&gt;
   &lt;add&gt;&lt;![CDATA[
 public function get_all_attribute_names() {
  $query = $this-&gt;db-&gt;query(&quot;SELECT attribute_group_id, attribute_id , name FROM &quot; . DB_PREFIX . &quot;attribute_description NATURAL JOIN &quot; . DB_PREFIX . &quot;attribute WHERE language_id = '&quot; . (int)$this-&gt;config-&gt;get('config_language_id') . &quot;' order by attribute_group_id DESC&quot;);
  
  return $query-&gt;rows;
 }
 public function get_all_attribute_group_names() {
  $query = $this-&gt;db-&gt;query(&quot;SELECT attribute_group_id , name FROM &quot; . DB_PREFIX . &quot;attribute_group_description WHERE language_id = '&quot; . (int)$this-&gt;config-&gt;get('config_language_id') . &quot;' order by attribute_group_id DESC&quot;);
  
  return $query-&gt;rows;
 }  
   ]]&gt;&lt;/add&gt;
  &lt;/operation&gt;
 &lt;/file&gt;
 &lt;file name=&quot;admin/controller/catalog/product.php&quot;&gt;
  &lt;operation&gt;
   &lt;search position=&quot;after&quot;&gt;&lt;![CDATA[private function getForm() {]]&gt;&lt;/search&gt;
   &lt;add&gt;&lt;![CDATA[
     $this-&gt;data['attribute_names'] = array();
  $results = $this-&gt;model_catalog_product-&gt;get_all_attribute_names();
  foreach ($results as $result) {
   $this-&gt;data['attribute_names'][] = array(
    'name' =&gt; $result['name'],
    'attribute_id' =&gt; $result['attribute_id'],
    'attribute_group_id' =&gt; $result['attribute_group_id']);
  }
  $this-&gt;data['attribute_group_names'] = array();
  $results = $this-&gt;model_catalog_product-&gt;get_all_attribute_group_names();
  foreach ($results as $result) {
   $this-&gt;data['attribute_group_names'][] = array(
    'name' =&gt; $result['name'],
    'attribute_group_id' =&gt; $result['attribute_group_id']);
  }
   ]]&gt;&lt;/add&gt;
  &lt;/operation&gt;
 &lt;/file&gt;
 &lt;file name=&quot;admin/view/template/catalog/product_form.tpl&quot;&gt;
 &lt;!-- Show all existing Product attributes --&gt;
  &lt;operation&gt;
   &lt;search position=&quot;before&quot; offset=&quot;1&quot;&gt;&lt;![CDATA[&lt;div id=&quot;tab-option&quot;&gt;]]&gt;&lt;/search&gt;
   &lt;add&gt;&lt;![CDATA[
   &lt;aside&gt;
   &lt;header style=&quot;margin-right: 3em;float:left;font-size:1.5em&quot;&gt;&lt;?php echo $entry_attribute; ?&gt;&lt;/header&gt;
            &lt;?php foreach ($attribute_group_names as $all_attribute_group){ ?&gt;
            &lt;details style=&quot;border:#6FF solid thin; margin-right: 3em; padding:1em;float:left;&quot;&gt;
            &lt;summary style=&quot;text-decoration:underline;&quot;&gt;&lt;?php print($all_attribute_group['name']); ?&gt;&lt;/summary&gt;
        &lt;ul style=&quot;list-style-type:none;&quot; title=&quot;&lt;?php echo $all_attribute_group['name']; ?&gt;&quot;&gt;
        &lt;?php foreach ($attribute_names as $all_attribute){ 
   if($all_attribute['attribute_group_id']==$all_attribute_group['attribute_group_id']) { ?&gt;
         &lt;li&gt;&lt;?php print($all_attribute['name']); ?&gt;&lt;/li&gt;
        &lt;?php } } ?&gt;
        &lt;/ul&gt;
        &lt;/details&gt;
        &lt;?php } ?&gt;
        &lt;/aside&gt;
   ]]&gt;&lt;/add&gt;
  &lt;/operation&gt;
  &lt;operation&gt;
   &lt;search position=&quot;replace&quot;&gt;&lt;![CDATA[&lt;input type=&quot;text&quot; name=&quot;product_attribute[' + attribute_row + '][name]&quot;]]&gt;&lt;/search&gt;
   &lt;add&gt;&lt;![CDATA[';
   html += '&lt;select title=&quot;Product attributes&quot; name=&quot;product_attribute[' + attribute_row + '][name]&quot; onchange=&quot;document.getElementsByName(\'product_attribute[' + attribute_row + '][attribute_id]\')[0].value=this.options[this.selectedIndex].value;&quot;&gt;';
   html += '&lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;&lt;?php echo $text_select; ?&gt;&lt;/option&gt;';
  &lt;?php foreach ($attribute_group_names as $all_attribute_group){ ?&gt;
  html += '&lt;optgroup label=&quot;&lt;?php echo $all_attribute_group['name']; ?&gt;&quot;&gt;';
  &lt;?php foreach ($attribute_names as $all_attribute){ 
   if($all_attribute['attribute_group_id']==$all_attribute_group['attribute_group_id']) { ?&gt;
   html += '&lt;option value=&quot;&lt;?php echo $all_attribute['attribute_id']; ?&gt;&quot;&gt;&lt;?php print($all_attribute['name']); ?&gt;&lt;/option&gt;';
  &lt;?php } } ?&gt;
  html += '&lt;/optgroup&gt;';
  &lt;?php } ?&gt;
 html += '    &lt;/select&gt;';
   html += '&lt;input style=&quot;visibility:hidden&quot; list=&quot;attribute_list&quot; type=&quot;text&quot; name=&quot;product_attribute[' + attribute_row + '][name]&quot;]]&gt;&lt;/add&gt;
  &lt;/operation&gt;
 &lt;/file&gt;
&lt;/modification&gt;
</pre>
唔識英文?
自己查字典啦!

我在Opencart後台用CKEditor編輯文章,想插入圖片,於是用CKEditor上傳圖片,但失敗了。到底是甚麼一回事?

以下是錯誤的圖片上傳示範:

  1. 在CKEditor按「影像」,「影像屬性」視窗會彈出。
  2. 按「上傳」標籤,再按「瀏覽...」。
  3. 挑選一個檔案,按「開啟舊檔」。
  4. 按「上傳至伺服器」。
  5. 出錯了!沒有圖片上傳到Opencart伺服器。
上載唔到圖片
有乜叉用!

CKEditor本身不是用來上傳檔案,要插入圖片就要配合檔案上傳工具(file manager)。CKFinder是CKEditor的官方搭檔,專門配合CKEditor上傳圖片。
CKFinder file manager

不過,Opencart並沒有安裝CKFinder,因為Opencart本身已經有檔案上傳工具“Image Manager”。


Finding Solution

正確的圖片上傳方法:

  1. 在CKEditor按「影像」,「影像屬性」視窗會彈出。
  2. 按「影像資訊」標籤,再「瀏覽伺服器端」,“Image Manager”視窗會彈出。
  3. 按“Upload”,檔案瀏覽器會彈出。
  4. 挑選需要的圖片檔案,按「開啟舊檔」。
  5. 上傳完成後,所需圖片會出現在“Image Manager”,雙擊圖片。
  6. 在「影像資訊」輸入有關設定,按「確定」完成圖片插入。

原來Opencart已經有圖片上載工具。但是既然CKEditor的「上傳」是無效,怎樣防止其他人再用?

CKEditor的「上傳」標籤十分誤導用家,既然是失效的,就應該隱藏掉。

隱藏「上傳」標籤的步驟:

  1. 到安裝了Opencart的伺服器,開啟路徑[admin/view/javascript/ckeditor/plugins/image/dialogs]。
  2. 編輯[image.js],搜尋並刪除以下程式碼,然後儲存檔案:
    {id:'Upload',hidden:true,filebrowser:'uploadButton',label:b.lang.image.upload,elements:[{type:'file',id:'upload',label:b.lang.image.btnUpload,style:'height:40px',size:38},{type:'fileButton',id:'uploadButton',filebrowser:'info:txtUrl',label:b.lang.image.btnUpload,'for':['Upload','upload']}]},
    
  3. 在CKEditor按「影像」,「影像屬性」視窗會彈出。「上傳」標籤不見了。

Opencart後台內置了CKEditor,讓用家以所見即所得方式編輯文本,例如 product 和 category 的 description。

不過,Opencart和CKEditor的版本更新並不同步,所以用家要自行安裝新版本的CKEditor到Opencart。


為什麼要使用新版本的CKEditor?
怎樣安裝新版本的CKEditor到Opencart?

HTML的最新版本——HTML5在網絡越來越普及,而新版本的CKEditor已支援HTML5的新標籤,包括<article><section><header>等等。另外,新版本有糾正錯誤和新增功能。

做乜叉嘢?


以下方法適用於Opencart v1.5.1.3

更新步驟:

  1. CKEditor官網下載最新版本的CKEditor,並解壓縮出來。
  2. 打開ckeditor文件夾,將多餘的“_samples”和“_source”文件夾刪除。
  3. 到安裝了Opencart的伺服器,開啟[admin/view/javascript/ckeditor]路徑,下載“config.js”和“contents.css”,儲存到剛才解壓縮出來的ckeditor文件夾,覆蓋掉原有的檔案。
  4. 將新版本的ckeditor文件夾上傳到伺服器,覆蓋掉舊版本的ckeditor文件夾即可。

本文最後更新日期:2012年3月12日

Opencart的註冊表格有超過200個國家和特殊政區可供選擇,真是他媽的詳盡!連南極洲都有,以便你將網店生意拓展到企鵝族群。

但是,光找國家名稱眼睛都看到脫窗了 。
若果將國家和特殊政區按世界七大洲排序,就可以方便客戶快速揀選。

咁叉麻煩呀!


以下修改方法適用於Opencart v1.5.1.3
以下國家和地區的資料源自《維基百科》

修改程式方法:

  1. 分別編輯以下檔案:
    • [catalog/view/theme/default/template/account/address_form.tpl]
    • [catalog/view/theme/default/template/account/register.tpl]
    • [catalog/view/theme/default/template/affiliate/edit.tpl]
    • [catalog/view/theme/default/template/affiliate/register.tpl]
    • [catalog/view/theme/default/template/checkout/address.tpl]
    • [catalog/view/theme/default/template/checkout/guest.tpl]
    • [catalog/view/theme/default/template/checkout/guest_shipping.tpl]
    • [catalog/view/theme/default/template/checkout/register.tpl ]
    • [catalog/view/theme/default/template/total/shipping.tpl]
  2. 搜索以下程式碼:
    <?php foreach ($countries as $country) { ?>
                  <?php if ($country['country_id'] == $country_id) { ?>
                  <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
                  <?php } else { ?>
                  <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
                  <?php } ?>
                  <?php } ?>
  3. 將以上程式碼替換為以下程式碼:
    <?php $countries_sort_by_continent=array(
      array( 'name' => 'Asia','iso_code_2' => array(
      "AF" /*Afghanistan, Islamic Republic of阿富汗伊斯蘭共和國*/ ,
      "AZ" /*Azerbaijan, Republic of阿塞拜疆共和國*/ ,
      "BH" /*Bahrain, Kingdom of巴林王國*/ ,
      "BD" /*Bangladesh, People's Republic of孟加拉國*/ ,
      "AM" /*Armenia, Republic of亞美尼亞共和國*/ ,
      "BT" /*Bhutan, Kingdom of不丹王國*/ ,
      "IO" /*British Indian Ocean Territory (Chagos Archipelago)英屬印度洋領地(查戈斯群島)*/ ,
      "BN" /*Brunei Darussalam汶萊*/ ,
      "MM" /*Myanmar, Union of緬甸聯盟*/ ,
      "KH" /*Cambodia, Kingdom of柬埔寨王國*/ ,
      "LK" /*Sri Lanka, Democratic Socialist Republic of斯里蘭卡民主社會主義共和國*/ ,
      "CN" /*China, People's Republic of中華人民共和國*/ ,
      "TW" /*Taiwan台灣*/ ,
      "CX" /*Christmas Island聖誕島*/ ,
      "CC" /*Cocos (Keeling) Islands科科斯(基林)群島*/ ,
      "CY" /*Cyprus, Republic of塞浦路斯共和國*/ ,
      "GE" /*Georgia格魯吉亞*/ ,
      "PS" /*Palestinian Territory, Occupied被佔巴勒斯坦領土*/ ,
      "HK" /*Hong Kong 香港*/ ,
      "IN" /*India, Republic of印度共和國*/ ,
      "ID" /*Indonesia, Republic of印度尼西亞共和國*/ ,
      "IR" /*Iran, Islamic Republic of伊朗伊斯蘭共和國*/ ,
      "IQ" /*Iraq, Republic of伊拉克共和國*/ ,
      "IL" /*Israel, State of以色列*/ ,
      "JP" /*Japan日本*/ ,
      "KZ" /*Kazakhstan, Republic of哈薩克斯坦共和國*/ ,
      "JO" /*Jordan, Hashemite Kingdom of約旦哈希姆王國*/ ,
      "KP" /*Korea, Democratic People's Republic of朝鮮民主主義人民共和國*/ ,
      "KR" /*Korea, Republic of大韓民國*/ ,
      "KW" /*Kuwait, State of科威特國家*/ ,
      "KG" /*Kyrgyz Republic吉爾吉斯共和國*/ ,
      "LA" /*Lao People's Democratic Republic老撾人民民主共和國*/ ,
      "LB" /*Lebanon, Lebanese Republic黎巴嫩*/ ,
      "MO" /*Macao 澳門*/ ,
      "MY" /*Malaysia馬來西亞*/ ,
      "MV" /*Maldives, Republic of馬爾代夫共和國*/ ,
      "MN" /*Mongolia蒙古*/ ,
      "OM" /*Oman, Sultanate of阿曼蘇丹國*/ ,
      "NP" /*Nepal, State of尼泊爾國家*/ ,
      "PK" /*Pakistan, Islamic Republic of巴基斯坦伊斯蘭共和國*/ ,
      "PH" /*Philippines, Republic of the菲律賓共和國*/ ,
      "TL" /*Timor-Leste, Democratic Republic of東帝汶民主共和國*/ ,
      "QA" /*Qatar, State of卡塔爾*/ ,
      "RU" /*Russian Federation俄羅斯聯邦*/ ,
      "SA" /*Saudi Arabia, Kingdom of沙特阿拉伯王國*/ ,
      "SG" /*Singapore, Republic of新加坡*/ ,
      "VN" /*Vietnam, Socialist Republic of越南社會主義共和國*/ ,
      "SY" /*Syrian Arab Republic阿拉伯敘利亞共和國*/ ,
      "TJ" /*Tajikistan, Republic of塔吉克斯坦共和國*/ ,
      "TH" /*Thailand, Kingdom of 泰國*/ ,
      "AE" /*United Arab Emirates阿拉伯聯合酋長國*/ ,
      "TR" /*Turkey, Republic of土耳其共和國*/ ,
      "TM" /*Turkmenistan土庫曼斯坦*/ ,
      "UZ" /*Uzbekistan, Republic of烏茲別克斯坦共和國*/ ,
      "YE" /*Yemen也門*/)
      ),array( 'name' => 'Europe','iso_code_2' => array(
      "AL" /*Albania, Republic of阿爾巴尼亞共和國*/ ,
      "AD" /*Andorra, Principality of安道​​爾公國的*/ ,
      "AZ" /*Azerbaijan, Republic of阿塞拜疆共和國*/ ,
      "AT" /*Austria, Republic of奧地利共和國*/ ,
      "AM" /*Armenia, Republic of亞美尼亞共和國*/ ,
      "BE" /*Belgium, Kingdom of比利時王國*/ ,
      "BA" /*Bosnia and Herzegovina波斯尼亞和黑塞哥維那*/ ,
      "BG" /*Bulgaria, Republic of保加利亞共和國*/ ,
      "BY" /*Belarus, Republic of白俄羅斯共和國*/ ,
      "HR" /*Croatia, Republic of克羅地亞*/ ,
      "CY" /*Cyprus, Republic of塞浦路斯共和國*/ ,
      "CZ" /*Czech Republic捷克共和國*/ ,
      "DK" /*Denmark, Kingdom of丹麥王國*/ ,
      "EE" /*Estonia, Republic of愛沙尼亞共和國*/ ,
      "FO" /*Faroe Islands法羅群島*/ ,
      "FI" /*Finland, Republic of芬蘭共和國*/ ,
      "AX" /*Åland Islands奧蘭群島*/ ,
      "FR" /*France, French Republic法國*/ ,
      "GE" /*Georgia格魯吉亞*/ ,
      "DE" /*Germany, Federal Republic of德意志聯邦共和國*/ ,
      "GI" /*Gibraltar直布羅陀*/ ,
      "GR" /*Greece, Hellenic Republic希臘*/ ,
      "VA" /*Holy See (Vatican City State)羅馬教廷(梵蒂岡城國)*/ ,
      "HU" /*Hungary, Republic of匈牙利共和國*/ ,
      "IS" /*Iceland, Republic of冰島共和國*/ ,
      "IE" /*Ireland愛爾蘭*/ ,
      "IT" /*Italy, Italian Republic意大利*/ ,
      "KZ" /*Kazakhstan, Republic of哈薩克斯坦共和國*/ ,
      "LV" /*Latvia, Republic of拉脫維亞共和國*/ ,
      "LI" /*Liechtenstein, Principality of列支敦士登公國的*/ ,
      "LT" /*Lithuania, Republic of立陶宛共和國*/ ,
      "LU" /*Luxembourg, Grand Duchy of盧森堡大公國*/ ,
      "MT" /*Malta, Republic of馬耳他共和國*/ ,
      "MC" /*Monaco, Principality of摩納哥公國的*/ ,
      "MD" /*Moldova, Republic of摩爾多瓦共和國*/ ,
      "ME" /*Montenegro, Republic of黑山共和國*/ ,
      "NL" /*Netherlands, Kingdom of the荷蘭王國*/ ,
      "NO" /*Norway, Kingdom of挪威王國*/ ,
      "PL" /*Poland, Republic of波蘭共和國*/ ,
      "PT" /*Portugal, Portuguese Republic葡萄牙*/ ,
      "RO" /*Romania羅馬尼亞*/ ,
      "RU" /*Russian Federation俄羅斯聯邦*/ ,
      "SM" /*San Marino, Republic of聖馬力諾共和國*/ ,
      "RS" /*Serbia, Republic of塞爾維亞共和國*/ ,
      "SK" /*Slovakia (Slovak Republic)斯洛伐克(斯洛伐克共和國)*/ ,
      "SI" /*Slovenia, Republic of斯洛文尼亞共和國*/ ,
      "ES" /*Spain, Kingdom of西班牙王國*/ ,
      "SJ" /*Svalbard , Jan Mayen Islands斯瓦爾巴群島和揚馬​​延島*/ ,
      "SE" /*Sweden, Kingdom of瑞典王國*/ ,
      "CH" /*Switzerland, Swiss Confederation瑞士*/ ,
      "TR" /*Turkey, Republic of土耳其共和國*/ ,
      "UA" /*Ukraine烏克蘭*/ ,
      "MK" /*Macedonia, Republic of馬其頓共和國*/ ,
      "GB" /*United Kingdom of Great Britain , Northern Ireland大不列顛及北愛爾蘭聯合王國*/ ,
      "GG" /*Guernsey, Bailiwick of根西島*/ ,
      "JE" /*Jersey, Bailiwick of 澤西島*/ ,
      "IM" /*Isle of Man馬恩島*/)
      ),array( 'name' => 'North America','iso_code_2' => array(
      "AG" /*Antigua and Barbuda安提瓜和巴布達*/ ,
      "BS" /*Bahamas, Commonwealth of the巴哈馬,英聯邦*/ ,
      "BB" /*Barbados巴巴多斯*/ ,
      "BM" /*Bermuda百慕大*/ ,
      "BZ" /*Belize伯利茲*/ ,
      "VG" /*British Virgin Islands英屬維爾京群島*/ ,
      "CA" /*Canada加拿大*/ ,
      "KY" /*Cayman Islands開曼群島*/ ,
      "CR" /*Costa Rica, Republic of哥斯達黎加共和國*/ ,
      "CU" /*Cuba, Republic of古巴共和國*/ ,
      "DM" /*Dominica, Commonwealth of多米尼加聯邦*/ ,
      "DO" /*Dominican Republic多米尼加共和國*/ ,
      "SV" /*El Salvador, Republic of薩爾瓦多共和國*/ ,
      "GL" /*Greenland格陵蘭*/ ,
      "GD" /*Grenada格林納達*/ ,
      "GP" /*Guadeloupe瓜德羅普島*/ ,
      "GT" /*Guatemala, Republic of危地馬拉共和國*/ ,
      "HT" /*Haiti, Republic of海地共和國*/ ,
      "HN" /*Honduras, Republic of洪都拉斯共和國*/ ,
      "JM" /*Jamaica牙買加*/ ,
      "MQ" /*Martinique馬提尼克島*/ ,
      "MX" /*Mexico, United Mexican States墨西哥*/ ,
      "MS" /*Montserrat蒙特塞拉特*/ ,
      "AN" /*Netherlands Antilles荷屬安的列斯*/ ,
      "CW" /*Curaçao庫拉索島*/ ,
      "AW" /*Aruba阿魯巴*/ ,
      "SX" /*Sint Maarten (Netherlands)聖馬丁島(荷蘭)*/ ,
      "BQ" /*Bonaire, Sint Eustatius and Saba博內爾島*/ ,
      "NI" /*Nicaragua, Republic of尼加拉瓜共和國*/ ,
      "UM" /*United States Minor Outlying Islands美國本土外小島嶼*/ ,
      "PA" /*Panama, Republic of巴拿馬共和國*/ ,
      "PR" /*Puerto Rico, Commonwealth of波多黎各聯邦*/ ,
      "BL" /*Saint Barthelemy聖巴泰勒米*/ ,
      "KN" /*Saint Kitts and Nevis, Federation of聖基茨和尼維斯聯邦*/ ,
      "AI" /*Anguilla安圭拉*/ ,
      "LC" /*Saint Lucia聖盧西亞*/ ,
      "MF" /*Saint Martin聖馬丁*/ ,
      "PM" /*Saint Pierre and Miquelon聖皮埃爾和密克隆*/ ,
      "VC" /*Saint Vincent and the Grenadines聖文森特和格林納丁斯*/ ,
      "TT" /*Trinidad and Tobago, Republic of特里尼達和多巴哥共和國*/ ,
      "TC" /*Turks and Caicos Islands特克斯和凱科斯群島*/ ,
      "US" /*United States of America美國美國*/ ,
      "VI" /*United States Virgin Islands美屬維爾京群島*/)
      ),array( 'name' => 'Oceania','iso_code_2' => array(
      "AS" /*American Samoa美屬薩摩亞*/ ,
      "AU" /*Australia, Commonwealth of澳大利亞聯邦*/ ,
      "SB" /*Solomon Islands所羅門群島*/ ,
      "CK" /*Cook Islands庫克群島*/ ,
      "FJ" /*Fiji, Republic of the Fiji Islands斐濟*/ ,
      "PF" /*French Polynesia法屬波利尼西亞*/ ,
      "KI" /*Kiribati, Republic of基里巴斯共和國*/ ,
      "GU" /*Guam關島*/ ,
      "NR" /*Nauru, Republic of瑙魯*/ ,
      "NC" /*New Caledonia新喀裡多尼亞*/ ,
      "VU" /*Vanuatu, Republic of瓦努阿圖共和國*/ ,
      "NZ" /*New Zealand新西蘭*/ ,
      "NU" /*Niue紐埃*/ ,
      "NF" /*Norfolk Island諾福克島*/ ,
      "MP" /*Northern Mariana Islands, Commonwealth of the北馬里亞納群島,英聯邦*/ ,
      "UM" /*United States Minor Outlying Islands美國本土外小島嶼*/ ,
      "FM" /*Micronesia, Federated States of密克羅尼西亞聯邦*/ ,
      "MH" /*Marshall Islands, Republic of the馬紹爾群島共和國*/ ,
      "PW" /*Palau, Republic of帕勞共和國*/ ,
      "PG" /*Papua New Guinea, Independent State of巴布亞新幾內亞獨立國*/ ,
      "PN" /*Pitcairn Islands皮特凱恩群島*/ ,
      "TK" /*Tokelau托克勞*/ ,
      "TO" /*Tonga, Kingdom of湯加王國*/ ,
      "TV" /*Tuvalu圖瓦盧*/ ,
      "WF" /*Wallis and Futuna瓦利斯群島和富圖納群島*/ ,
      "WS" /*Samoa, Independent State of薩摩亞獨立國*/)
      ),array( 'name' => 'South America','iso_code_2' => array(
      "AR" /*Argentina, Argentine Republic阿根廷*/ ,
      "BO" /*Bolivia, Republic of玻利維亞共和國*/ ,
      "BR" /*Brazil, Federative Republic of巴西聯邦共和國*/ ,
      "CL" /*Chile, Republic of智利共和國*/ ,
      "CO" /*Colombia, Republic of哥倫比亞共和國*/ ,
      "EC" /*Ecuador, Republic of厄瓜多爾共和國*/ ,
      "FK" /*Falkland Islands (Malvinas)福克蘭群島(馬爾維納斯)*/ ,
      "GF" /*French Guiana法屬圭亞那*/ ,
      "GY" /*Guyana, Co-operative Republic of圭亞那合作共和國*/ ,
      "PY" /*Paraguay, Republic of巴拉圭共和國*/ ,
      "PE" /*Peru, Republic of秘魯共和國*/ ,
      "SR" /*Suriname, Republic of蘇里南共和國*/ ,
      "UY" /*Uruguay, Eastern Republic of烏拉圭東岸共和國*/ ,
      "VE" /*Venezuela, Bolivarian Republic of委內瑞拉玻利瓦爾共和國*/ )
      ),array( 'name' => 'Africa','iso_code_2' => array(
      "DZ" /*Algeria, People's Democratic Republic of阿爾及利亞人民民主共和國*/ ,
      "AO" /*Angola, Republic of安哥拉共和國*/ ,
      "BW" /*Botswana, Republic of博茨瓦納共和國*/ ,
      "BI" /*Burundi, Republic of布隆迪共和國*/ ,
      "CM" /*Cameroon, Republic of喀麥隆共和國*/ ,
      "CV" /*Cape Verde, Republic of佛得角共和國*/ ,
      "CF" /*Central African Republic中非共和國*/ ,
      "TD" /*Chad, Republic of乍得共和國*/ ,
      "KM" /*Comoros, Union of the科摩羅聯盟*/ ,
      "YT" /*Mayotte馬約特島*/ ,
      "CG" /*Congo, Republic of the剛果共和國*/ ,
      "CD" /*Congo, Democratic Republic of the剛果民主共和國*/ ,
      "BJ" /*Benin, Republic of貝寧共和國*/ ,
      "GQ" /*Equatorial Guinea, Republic of赤道幾內亞共和國*/ ,
      "ET" /*Ethiopia, Federal Democratic Republic of埃塞俄比亞聯邦民主共和國*/ ,
      "ER" /*Eritrea, State of厄立特里亞國家*/ ,
      "DJ" /*Djibouti, Republic of吉布提共和國*/ ,
      "GA" /*Gabon, Gabonese Republic加蓬*/ ,
      "GM" /*Gambia, Republic of the岡比亞共和國*/ ,
      "GH" /*Ghana, Republic of加納共和國*/ ,
      "GN" /*Guinea, Republic of幾內亞共和國*/ ,
      "CI" /*Cote d'Ivoire, Republic of科特迪瓦共和國*/ ,
      "KE" /*Kenya, Republic of肯尼亞共和國*/ ,
      "LS" /*Lesotho, Kingdom of萊索托王國*/ ,
      "LR" /*Liberia, Republic of利比里亞共和國*/ ,
      "LY" /*Libyan Arab Jamahiriya阿拉伯利比亞民眾國*/ ,
      "MG" /*Madagascar, Republic of馬達加斯加共和國*/ ,
      "MW" /*Malawi, Republic of馬拉維共和國*/ ,
      "ML" /*Mali, Republic of馬里共和國*/ ,
      "MR" /*Mauritania, Islamic Republic of毛里塔尼亞伊斯蘭共和國*/ ,
      "MU" /*Mauritius, Republic of毛里求斯共和國*/ ,
      "MA" /*Morocco, Kingdom of摩洛哥王國*/ ,
      "MZ" /*Mozambique, Republic of莫桑比克共和國*/ ,
      "NA" /*Namibia, Republic of納米比亞共和國*/ ,
      "NE" /*Niger, Republic of尼日爾共和國*/ ,
      "NG" /*Nigeria, Federal Republic of尼日利亞聯邦共和國*/ ,
      "GW" /*Guinea-Bissau, Republic of幾內亞比紹共和國*/ ,
      "RE" /*Reunion留尼旺島*/ ,
      "RW" /*Rwanda, Republic of盧旺達共和國*/ ,
      "SH" /*Saint Helena聖赫勒拿*/ ,
      "ST" /*Sao Tome and Principe, Democratic Republic of聖多美與普林西比民主共和國*/ ,
      "SN" /*Senegal, Republic of塞內加爾共和國*/ ,
      "SC" /*Seychelles, Republic of塞舌爾共和國*/ ,
      "SL" /*Sierra Leone, Republic of塞拉利昂共和國*/ ,
      "SO" /*Somalia, Somali Republic索馬里*/ ,
      "ZA" /*South Africa, Republic of南非共和國*/ ,
      "ZW" /*Zimbabwe, Republic of津巴布韋共和國*/ ,
      "SS" /*South Sudan南蘇丹*/ ,
      "EH" /*Western Sahara西撒哈拉*/ ,
      "SD" /*Sudan, Republic of蘇丹共和國*/ ,
      "SZ" /*Swaziland, Kingdom of斯威士蘭王國*/ ,
      "TG" /*Togo, Togolese Republic多哥*/ ,
      "TN" /*Tunisia, Tunisian Republic突尼斯*/ ,
      "UG" /*Uganda, Republic of烏干達共和國*/ ,
      "EG" /*Egypt, Arab Republic of埃及*/ ,
      "TZ" /*Tanzania, United Republic of坦桑尼亞聯合共和國*/ ,
      "BF" /*Burkina Faso布基納法索*/ ,
      "ZM" /*Zambia, Republic of贊比亞共和國*/)
      ),array( 'name' => 'Antarctica','iso_code_2' => array(
      "AQ" /*Antarctica (the territory South of 60 deg S)南極洲*/ ,
      "BV" /*Bouvet Island (Bouvetoya)布維島*/ ,
      "GS" /*South Georgia and the South Sandwich Islands南喬治亞島和南桑威奇群島*/ ,
      "TF" /*French Southern Territories法國南部領土*/ ,
      "HM" /*Heard Island and McDonald Islands赫德島和麥當勞群島*/ )
     )
    );
      ?>
      <?php foreach ($countries_sort_by_continent as $continent_name) {  ?>
      <optgroup label="<?php echo $continent_name['name']; ?>">
      <?php foreach ($countries as $country) { 
      if (in_array($country['iso_code_2'],$continent_name['iso_code_2'])) { ?>
      <option value="<?php echo $country['country_id']; ?>"<?php if ($country['country_id'] == $country_id) { ?> selected="selected"<?php } ?>
      style="background: url('image/flags/<?php echo strtolower($country['iso_code_2']); ?>.png') center right no-repeat;">
    <?php echo $country['name']; ?></option>
      <?php } } ?>
      </optgroup>
      <?php } ?>
      <option value="236">Other Area</option>
    

示範:

有一點要注意,世界七大洲的地理劃分沒有統一的定義,而且有些國家的領土橫跨超過一個洲,所以有些國家會在列表重複出現,但這不影響Opencart儲存地址資料。

我的網店只服務特定地區。
我怎樣一次過隱藏不需要的國家?

剛才的程式碼中,每行變數值旁都標示了國家或特殊政區的名字。
如果你的網店不服務某個國家,就將標示該國家名字的一行刪除。
如果你的網店只服務某些大洲,就將其他洲的變數值刪除掉。
這樣你就不用在Opencart後台逐一修改國家的設定來停用它們。


<p>
&#60;!--<br />
Make sure that you have properly installed Opencart vQmod.<br />
Copy this page of script.<br />
Save as a .xml file of utf-8 encoding without BOM into the directory [vqmod/xml].<br />
Name the file as you like.<br />
--&gt;</p>
<pre>
&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;
&lt;modification&gt;
 &lt;id&gt;List of Countries by continents&lt;/id&gt;
 &lt;version&gt;2.0.0&lt;/version&gt;
 &lt;author&gt;Flexidigi Solution Ltd.&lt;/author&gt;
 &lt;file name=&#34;catalog/view/theme/default/template/account/register.tpl&#34;&gt;</pre>
<pre id="repeat_content">
    &lt;operation error=&#34;skip&#34;&gt;
      &lt;search position=&#34;replace&#34;&gt;&lt;![CDATA[&lt;?php foreach ($countries as $country) { ?&gt;]]&gt;&lt;/search&gt;
      &lt;add&gt;&lt;![CDATA[ &lt;!--
    &lt;?php $countries_sort_by_continent=array(
array( &#39;name&#39; =&gt; &#39;Asia&#39;,&#39;iso_code_2&#39; =&gt; array(&#34;AF&#34; /*Afghanistan, Islamic Republic of阿富汗伊斯蘭共和國*/ ,
&#34;AZ&#34; /*Azerbaijan, Republic of阿塞拜疆共和國*/ ,
&#34;BH&#34; /*Bahrain, Kingdom of巴林王國*/ ,
&#34;BD&#34; /*Bangladesh, People&#39;s Republic of孟加拉國*/ ,
&#34;AM&#34; /*Armenia, Republic of亞美尼亞共和國*/ ,
&#34;BT&#34; /*Bhutan, Kingdom of不丹王國*/ ,
&#34;IO&#34; /*British Indian Ocean Territory (Chagos Archipelago)英屬印度洋領地(查戈斯群島)*/ ,
&#34;BN&#34; /*Brunei Darussalam汶萊*/ ,
&#34;MM&#34; /*Myanmar, Union of緬甸聯盟*/ ,
&#34;KH&#34; /*Cambodia, Kingdom of柬埔寨王國*/ ,
&#34;LK&#34; /*Sri Lanka, Democratic Socialist Republic of斯里蘭卡民主社會主義共和國*/ ,
&#34;CN&#34; /*China, People&#39;s Republic of中華人民共和國*/ ,
&#34;TW&#34; /*Taiwan台灣*/ ,
&#34;CX&#34; /*Christmas Island聖誕島*/ ,
&#34;CC&#34; /*Cocos (Keeling) Islands科科斯(基林)群島*/ ,
&#34;CY&#34; /*Cyprus, Republic of塞浦路斯共和國*/ ,
&#34;GE&#34; /*Georgia格魯吉亞*/ ,
&#34;PS&#34; /*Palestinian Territory, Occupied被佔巴勒斯坦領土*/ ,
&#34;HK&#34; /*Hong Kong 香港*/ ,
&#34;IN&#34; /*India, Republic of印度共和國*/ ,
&#34;ID&#34; /*Indonesia, Republic of印度尼西亞共和國*/ ,
&#34;IR&#34; /*Iran, Islamic Republic of伊朗伊斯蘭共和國*/ ,
&#34;IQ&#34; /*Iraq, Republic of伊拉克共和國*/ ,
&#34;IL&#34; /*Israel, State of以色列*/ ,
&#34;JP&#34; /*Japan日本*/ ,
&#34;KZ&#34; /*Kazakhstan, Republic of哈薩克斯坦共和國*/ ,
&#34;JO&#34; /*Jordan, Hashemite Kingdom of約旦哈希姆王國*/ ,
&#34;KP&#34; /*Korea, Democratic People&#39;s Republic of朝鮮民主主義人民共和國*/ ,
&#34;KR&#34; /*Korea, Republic of大韓民國*/ ,
&#34;KW&#34; /*Kuwait, State of科威特國家*/ ,
&#34;KG&#34; /*Kyrgyz Republic吉爾吉斯共和國*/ ,
&#34;LA&#34; /*Lao People&#39;s Democratic Republic老撾人民民主共和國*/ ,
&#34;LB&#34; /*Lebanon, Lebanese Republic黎巴嫩*/ ,
&#34;MO&#34; /*Macao 澳門*/ ,
&#34;MY&#34; /*Malaysia馬來西亞*/ ,
&#34;MV&#34; /*Maldives, Republic of馬爾代夫共和國*/ ,
&#34;MN&#34; /*Mongolia蒙古*/ ,
&#34;OM&#34; /*Oman, Sultanate of阿曼蘇丹國*/ ,
&#34;NP&#34; /*Nepal, State of尼泊爾國家*/ ,
&#34;PK&#34; /*Pakistan, Islamic Republic of巴基斯坦伊斯蘭共和國*/ ,
&#34;PH&#34; /*Philippines, Republic of the菲律賓共和國*/ ,
&#34;TL&#34; /*Timor-Leste, Democratic Republic of東帝汶民主共和國*/ ,
&#34;QA&#34; /*Qatar, State of卡塔爾*/ ,
&#34;RU&#34; /*Russian Federation俄羅斯聯邦*/ ,
&#34;SA&#34; /*Saudi Arabia, Kingdom of沙特阿拉伯王國*/ ,
&#34;SG&#34; /*Singapore, Republic of新加坡*/ ,
&#34;VN&#34; /*Vietnam, Socialist Republic of越南社會主義共和國*/ ,
&#34;SY&#34; /*Syrian Arab Republic阿拉伯敘利亞共和國*/ ,
&#34;TJ&#34; /*Tajikistan, Republic of塔吉克斯坦共和國*/ ,
&#34;TH&#34; /*Thailand, Kingdom of 泰國*/ ,
&#34;AE&#34; /*United Arab Emirates阿拉伯聯合酋長國*/ ,
&#34;TR&#34; /*Turkey, Republic of土耳其共和國*/ ,
&#34;TM&#34; /*Turkmenistan土庫曼斯坦*/ ,
&#34;UZ&#34; /*Uzbekistan, Republic of烏茲別克斯坦共和國*/ ,
&#34;YE&#34; /*Yemen也門*/)),
array( &#39;name&#39; =&gt; &#39;Europe&#39;,&#39;iso_code_2&#39; =&gt; array(&#34;AL&#34; /*Albania, Republic of阿爾巴尼亞共和國*/ ,
&#34;AD&#34; /*Andorra, Principality of安道​​爾公國的*/ ,
&#34;AZ&#34; /*Azerbaijan, Republic of阿塞拜疆共和國*/ ,
&#34;AT&#34; /*Austria, Republic of奧地利共和國*/ ,
&#34;AM&#34; /*Armenia, Republic of亞美尼亞共和國*/ ,
&#34;BE&#34; /*Belgium, Kingdom of比利時王國*/ ,
&#34;BA&#34; /*Bosnia and Herzegovina波斯尼亞和黑塞哥維那*/ ,
&#34;BG&#34; /*Bulgaria, Republic of保加利亞共和國*/ ,
&#34;BY&#34; /*Belarus, Republic of白俄羅斯共和國*/ ,
&#34;HR&#34; /*Croatia, Republic of克羅地亞*/ ,
&#34;CY&#34; /*Cyprus, Republic of塞浦路斯共和國*/ ,
&#34;CZ&#34; /*Czech Republic捷克共和國*/ ,
&#34;DK&#34; /*Denmark, Kingdom of丹麥王國*/ ,
&#34;EE&#34; /*Estonia, Republic of愛沙尼亞共和國*/ ,
&#34;FO&#34; /*Faroe Islands法羅群島*/ ,
&#34;FI&#34; /*Finland, Republic of芬蘭共和國*/ ,
&#34;AX&#34; /*Åland Islands奧蘭群島*/ ,
&#34;FR&#34; /*France, French Republic法國*/ ,
&#34;GE&#34; /*Georgia格魯吉亞*/ ,
&#34;DE&#34; /*Germany, Federal Republic of德意志聯邦共和國*/ ,
&#34;GI&#34; /*Gibraltar直布羅陀*/ ,
&#34;GR&#34; /*Greece, Hellenic Republic希臘*/ ,
&#34;VA&#34; /*Holy See (Vatican City State)羅馬教廷(梵蒂岡城國)*/ ,
&#34;HU&#34; /*Hungary, Republic of匈牙利共和國*/ ,
&#34;IS&#34; /*Iceland, Republic of冰島共和國*/ ,
&#34;IE&#34; /*Ireland愛爾蘭*/ ,
&#34;IT&#34; /*Italy, Italian Republic意大利*/ ,
&#34;KZ&#34; /*Kazakhstan, Republic of哈薩克斯坦共和國*/ ,
&#34;LV&#34; /*Latvia, Republic of拉脫維亞共和國*/ ,
&#34;LI&#34; /*Liechtenstein, Principality of列支敦士登公國的*/ ,
&#34;LT&#34; /*Lithuania, Republic of立陶宛共和國*/ ,
&#34;LU&#34; /*Luxembourg, Grand Duchy of盧森堡大公國*/ ,
&#34;MT&#34; /*Malta, Republic of馬耳他共和國*/ ,
&#34;MC&#34; /*Monaco, Principality of摩納哥公國的*/ ,
&#34;MD&#34; /*Moldova, Republic of摩爾多瓦共和國*/ ,
&#34;ME&#34; /*Montenegro, Republic of黑山共和國*/ ,
&#34;NL&#34; /*Netherlands, Kingdom of the荷蘭王國*/ ,
&#34;NO&#34; /*Norway, Kingdom of挪威王國*/ ,
&#34;PL&#34; /*Poland, Republic of波蘭共和國*/ ,
&#34;PT&#34; /*Portugal, Portuguese Republic葡萄牙*/ ,
&#34;RO&#34; /*Romania羅馬尼亞*/ ,
&#34;RU&#34; /*Russian Federation俄羅斯聯邦*/ ,
&#34;SM&#34; /*San Marino, Republic of聖馬力諾共和國*/ ,
&#34;RS&#34; /*Serbia, Republic of塞爾維亞共和國*/ ,
&#34;SK&#34; /*Slovakia (Slovak Republic)斯洛伐克(斯洛伐克共和國)*/ ,
&#34;SI&#34; /*Slovenia, Republic of斯洛文尼亞共和國*/ ,
&#34;ES&#34; /*Spain, Kingdom of西班牙王國*/ ,
&#34;SJ&#34; /*Svalbard , Jan Mayen Islands斯瓦爾巴群島和揚馬​​延島*/ ,
&#34;SE&#34; /*Sweden, Kingdom of瑞典王國*/ ,
&#34;CH&#34; /*Switzerland, Swiss Confederation瑞士*/ ,
&#34;TR&#34; /*Turkey, Republic of土耳其共和國*/ ,
&#34;UA&#34; /*Ukraine烏克蘭*/ ,
&#34;MK&#34; /*Macedonia, Republic of馬其頓共和國*/ ,
&#34;GB&#34; /*United Kingdom of Great Britain , Northern Ireland大不列顛及北愛爾蘭聯合王國*/ ,
&#34;GG&#34; /*Guernsey, Bailiwick of根西島*/ ,
&#34;JE&#34; /*Jersey, Bailiwick of 澤西島*/ ,
&#34;IM&#34; /*Isle of Man馬恩島*/)),
array( &#39;name&#39; =&gt; &#39;North America&#39;,&#39;iso_code_2&#39; =&gt; array(&#34;AG&#34; /*Antigua and Barbuda安提瓜和巴布達*/ ,
&#34;BS&#34; /*Bahamas, Commonwealth of the巴哈馬,英聯邦*/ ,
&#34;BB&#34; /*Barbados巴巴多斯*/ ,
&#34;BM&#34; /*Bermuda百慕大*/ ,
&#34;BZ&#34; /*Belize伯利茲*/ ,
&#34;VG&#34; /*British Virgin Islands英屬維爾京群島*/ ,
&#34;CA&#34; /*Canada加拿大*/ ,
&#34;KY&#34; /*Cayman Islands開曼群島*/ ,
&#34;CR&#34; /*Costa Rica, Republic of哥斯達黎加共和國*/ ,
&#34;CU&#34; /*Cuba, Republic of古巴共和國*/ ,
&#34;DM&#34; /*Dominica, Commonwealth of多米尼加聯邦*/ ,
&#34;DO&#34; /*Dominican Republic多米尼加共和國*/ ,
&#34;SV&#34; /*El Salvador, Republic of薩爾瓦多共和國*/ ,
&#34;GL&#34; /*Greenland格陵蘭*/ ,
&#34;GD&#34; /*Grenada格林納達*/ ,
&#34;GP&#34; /*Guadeloupe瓜德羅普島*/ ,
&#34;GT&#34; /*Guatemala, Republic of危地馬拉共和國*/ ,
&#34;HT&#34; /*Haiti, Republic of海地共和國*/ ,
&#34;HN&#34; /*Honduras, Republic of洪都拉斯共和國*/ ,
&#34;JM&#34; /*Jamaica牙買加*/ ,
&#34;MQ&#34; /*Martinique馬提尼克島*/ ,
&#34;MX&#34; /*Mexico, United Mexican States墨西哥*/ ,
&#34;MS&#34; /*Montserrat蒙特塞拉特*/ ,
&#34;AN&#34; /*Netherlands Antilles荷屬安的列斯*/ ,
&#34;CW&#34; /*Curaçao庫拉索島*/ ,
&#34;AW&#34; /*Aruba阿魯巴*/ ,
&#34;SX&#34; /*Sint Maarten (Netherlands)聖馬丁島(荷蘭)*/ ,
&#34;BQ&#34; /*Bonaire, Sint Eustatius and Saba博內爾島*/ ,
&#34;NI&#34; /*Nicaragua, Republic of尼加拉瓜共和國*/ ,
&#34;UM&#34; /*United States Minor Outlying Islands美國本土外小島嶼*/ ,
&#34;PA&#34; /*Panama, Republic of巴拿馬共和國*/ ,
&#34;PR&#34; /*Puerto Rico, Commonwealth of波多黎各聯邦*/ ,
&#34;BL&#34; /*Saint Barthelemy聖巴泰勒米*/ ,
&#34;KN&#34; /*Saint Kitts and Nevis, Federation of聖基茨和尼維斯聯邦*/ ,
&#34;AI&#34; /*Anguilla安圭拉*/ ,
&#34;LC&#34; /*Saint Lucia聖盧西亞*/ ,
&#34;MF&#34; /*Saint Martin聖馬丁*/ ,
&#34;PM&#34; /*Saint Pierre and Miquelon聖皮埃爾和密克隆*/ ,
&#34;VC&#34; /*Saint Vincent and the Grenadines聖文森特和格林納丁斯*/ ,
&#34;TT&#34; /*Trinidad and Tobago, Republic of特里尼達和多巴哥共和國*/ ,
&#34;TC&#34; /*Turks and Caicos Islands特克斯和凱科斯群島*/ ,
&#34;US&#34; /*United States of America美國美國*/ ,
&#34;VI&#34; /*United States Virgin Islands美屬維爾京群島*/)),
array( &#39;name&#39; =&gt; &#39;Oceania&#39;,&#39;iso_code_2&#39; =&gt; array(&#34;AS&#34; /*American Samoa美屬薩摩亞*/ ,
&#34;AU&#34; /*Australia, Commonwealth of澳大利亞聯邦*/ ,
&#34;SB&#34; /*Solomon Islands所羅門群島*/ ,
&#34;CK&#34; /*Cook Islands庫克群島*/ ,
&#34;FJ&#34; /*Fiji, Republic of the Fiji Islands斐濟*/ ,
&#34;PF&#34; /*French Polynesia法屬波利尼西亞*/ ,
&#34;KI&#34; /*Kiribati, Republic of基里巴斯共和國*/ ,
&#34;GU&#34; /*Guam關島*/ ,
&#34;NR&#34; /*Nauru, Republic of瑙魯*/ ,
&#34;NC&#34; /*New Caledonia新喀裡多尼亞*/ ,
&#34;VU&#34; /*Vanuatu, Republic of瓦努阿圖共和國*/ ,
&#34;NZ&#34; /*New Zealand新西蘭*/ ,
&#34;NU&#34; /*Niue紐埃*/ ,
&#34;NF&#34; /*Norfolk Island諾福克島*/ ,
&#34;MP&#34; /*Northern Mariana Islands, Commonwealth of the北馬里亞納群島,英聯邦*/ ,
&#34;UM&#34; /*United States Minor Outlying Islands美國本土外小島嶼*/ ,
&#34;FM&#34; /*Micronesia, Federated States of密克羅尼西亞聯邦*/ ,
&#34;MH&#34; /*Marshall Islands, Republic of the馬紹爾群島共和國*/ ,
&#34;PW&#34; /*Palau, Republic of帕勞共和國*/ ,
&#34;PG&#34; /*Papua New Guinea, Independent State of巴布亞新幾內亞獨立國*/ ,
&#34;PN&#34; /*Pitcairn Islands皮特凱恩群島*/ ,
&#34;TK&#34; /*Tokelau托克勞*/ ,
&#34;TO&#34; /*Tonga, Kingdom of湯加王國*/ ,
&#34;TV&#34; /*Tuvalu圖瓦盧*/ ,
&#34;WF&#34; /*Wallis and Futuna瓦利斯群島和富圖納群島*/ ,
&#34;WS&#34; /*Samoa, Independent State of薩摩亞獨立國*/)),
array( &#39;name&#39; =&gt; &#39;South America&#39;,&#39;iso_code_2&#39; =&gt; array(&#34;AR&#34; /*Argentina, Argentine Republic阿根廷*/ ,
&#34;BO&#34; /*Bolivia, Republic of玻利維亞共和國*/ ,
&#34;BR&#34; /*Brazil, Federative Republic of巴西聯邦共和國*/ ,
&#34;CL&#34; /*Chile, Republic of智利共和國*/ ,
&#34;CO&#34; /*Colombia, Republic of哥倫比亞共和國*/ ,
&#34;EC&#34; /*Ecuador, Republic of厄瓜多爾共和國*/ ,
&#34;FK&#34; /*Falkland Islands (Malvinas)福克蘭群島(馬爾維納斯)*/ ,
&#34;GF&#34; /*French Guiana法屬圭亞那*/ ,
&#34;GY&#34; /*Guyana, Co-operative Republic of圭亞那合作共和國*/ ,
&#34;PY&#34; /*Paraguay, Republic of巴拉圭共和國*/ ,
&#34;PE&#34; /*Peru, Republic of秘魯共和國*/ ,
&#34;SR&#34; /*Suriname, Republic of蘇里南共和國*/ ,
&#34;UY&#34; /*Uruguay, Eastern Republic of烏拉圭東岸共和國*/ ,
&#34;VE&#34; /*Venezuela, Bolivarian Republic of委內瑞拉玻利瓦爾共和國*/ )),
array( &#39;name&#39; =&gt; &#39;Africa&#39;,&#39;iso_code_2&#39; =&gt; array(
&#34;DZ&#34; /*Algeria, People&#39;s Democratic Republic of阿爾及利亞人民民主共和國*/ ,
&#34;AO&#34; /*Angola, Republic of安哥拉共和國*/ ,
&#34;BW&#34; /*Botswana, Republic of博茨瓦納共和國*/ ,
&#34;BI&#34; /*Burundi, Republic of布隆迪共和國*/ ,
&#34;CM&#34; /*Cameroon, Republic of喀麥隆共和國*/ ,
&#34;CV&#34; /*Cape Verde, Republic of佛得角共和國*/ ,
&#34;CF&#34; /*Central African Republic中非共和國*/ ,
&#34;TD&#34; /*Chad, Republic of乍得共和國*/ ,
&#34;KM&#34; /*Comoros, Union of the科摩羅聯盟*/ ,
&#34;YT&#34; /*Mayotte馬約特島*/ ,
&#34;CG&#34; /*Congo, Republic of the剛果共和國*/ ,
&#34;CD&#34; /*Congo, Democratic Republic of the剛果民主共和國*/ ,
&#34;BJ&#34; /*Benin, Republic of貝寧共和國*/ ,
&#34;GQ&#34; /*Equatorial Guinea, Republic of赤道幾內亞共和國*/ ,
&#34;ET&#34; /*Ethiopia, Federal Democratic Republic of埃塞俄比亞聯邦民主共和國*/ ,
&#34;ER&#34; /*Eritrea, State of厄立特里亞國家*/ ,
&#34;DJ&#34; /*Djibouti, Republic of吉布提共和國*/ ,
&#34;GA&#34; /*Gabon, Gabonese Republic加蓬*/ ,
&#34;GM&#34; /*Gambia, Republic of the岡比亞共和國*/ ,
&#34;GH&#34; /*Ghana, Republic of加納共和國*/ ,
&#34;GN&#34; /*Guinea, Republic of幾內亞共和國*/ ,
&#34;CI&#34; /*Cote d&#39;Ivoire, Republic of科特迪瓦共和國*/ ,
&#34;KE&#34; /*Kenya, Republic of肯尼亞共和國*/ ,
&#34;LS&#34; /*Lesotho, Kingdom of萊索托王國*/ ,
&#34;LR&#34; /*Liberia, Republic of利比里亞共和國*/ ,
&#34;LY&#34; /*Libyan Arab Jamahiriya阿拉伯利比亞民眾國*/ ,
&#34;MG&#34; /*Madagascar, Republic of馬達加斯加共和國*/ ,
&#34;MW&#34; /*Malawi, Republic of馬拉維共和國*/ ,
&#34;ML&#34; /*Mali, Republic of馬里共和國*/ ,
&#34;MR&#34; /*Mauritania, Islamic Republic of毛里塔尼亞伊斯蘭共和國*/ ,
&#34;MU&#34; /*Mauritius, Republic of毛里求斯共和國*/ ,
&#34;MA&#34; /*Morocco, Kingdom of摩洛哥王國*/ ,
&#34;MZ&#34; /*Mozambique, Republic of莫桑比克共和國*/ ,
&#34;NA&#34; /*Namibia, Republic of納米比亞共和國*/ ,
&#34;NE&#34; /*Niger, Republic of尼日爾共和國*/ ,
&#34;NG&#34; /*Nigeria, Federal Republic of尼日利亞聯邦共和國*/ ,
&#34;GW&#34; /*Guinea-Bissau, Republic of幾內亞比紹共和國*/ ,
&#34;RE&#34; /*Reunion留尼旺島*/ ,
&#34;RW&#34; /*Rwanda, Republic of盧旺達共和國*/ ,
&#34;SH&#34; /*Saint Helena聖赫勒拿*/ ,
&#34;ST&#34; /*Sao Tome and Principe, Democratic Republic of聖多美與普林西比民主共和國*/ ,
&#34;SN&#34; /*Senegal, Republic of塞內加爾共和國*/ ,
&#34;SC&#34; /*Seychelles, Republic of塞舌爾共和國*/ ,
&#34;SL&#34; /*Sierra Leone, Republic of塞拉利昂共和國*/ ,
&#34;SO&#34; /*Somalia, Somali Republic索馬里*/ ,
&#34;ZA&#34; /*South Africa, Republic of南非共和國*/ ,
&#34;ZW&#34; /*Zimbabwe, Republic of津巴布韋共和國*/ ,
&#34;SS&#34; /*South Sudan南蘇丹*/ ,
&#34;EH&#34; /*Western Sahara西撒哈拉*/ ,
&#34;SD&#34; /*Sudan, Republic of蘇丹共和國*/ ,
&#34;SZ&#34; /*Swaziland, Kingdom of斯威士蘭王國*/ ,
&#34;TG&#34; /*Togo, Togolese Republic多哥*/ ,
&#34;TN&#34; /*Tunisia, Tunisian Republic突尼斯*/ ,
&#34;UG&#34; /*Uganda, Republic of烏干達共和國*/ ,
&#34;EG&#34; /*Egypt, Arab Republic of埃及*/ ,
&#34;TZ&#34; /*Tanzania, United Republic of坦桑尼亞聯合共和國*/ ,
&#34;BF&#34; /*Burkina Faso布基納法索*/ ,
&#34;ZM&#34; /*Zambia, Republic of贊比亞共和國*/)),
array( &#39;name&#39; =&gt; &#39;Antarctica&#39;,&#39;iso_code_2&#39; =&gt; array(
&#34;AQ&#34; /*Antarctica (the territory South of 60 deg S)南極洲*/ ,
&#34;BV&#34; /*Bouvet Island (Bouvetoya)布維島*/ ,
&#34;GS&#34; /*South Georgia and the South Sandwich Islands南喬治亞島和南桑威奇群島*/ ,
&#34;TF&#34; /*French Southern Territories法國南部領土*/ ,
&#34;HM&#34; /*Heard Island and McDonald Islands赫德島和麥當勞群島*/ )));
?&gt;
--&gt;
              &lt;?php foreach ($countries_sort_by_continent as $continent_name) {  ?&gt;
          &lt;optgroup label=&#34;&lt;?php echo $continent_name[&#39;name&#39;]; ?&gt;&#34;&gt;
          &lt;?php foreach ($countries as $country) { 
          if (in_array($country[&#39;iso_code_2&#39;],$continent_name[&#39;iso_code_2&#39;])) { ?&gt;
              &lt;option value=&#34;&lt;?php echo $country[&#39;country_id&#39;]; ?&gt;&#34;&lt;?php if ($country[&#39;country_id&#39;] == $country_id) { ?&gt; selected=&#34;selected&#34;&lt;?php } ?&gt;
              style=&#34;background: url(&#39;image/flags/&lt;?php echo strtolower($country[&#39;iso_code_2&#39;]); ?&gt;.png&#39;) center right no-repeat;&#34;&gt;&lt;?php echo $country[&#39;name&#39;]; ?&gt;&lt;/option&gt;
              &lt;?php } } ?&gt;
              &lt;/optgroup&gt;
              &lt;?php } ?&gt;
       &lt;option value=&#34;236&#34;&gt;Other Area&lt;/option&gt;
       &lt;?php if (false) { ?&gt;]]&gt;&lt;/add&gt;
  &lt;/operation&gt;
 &lt;/file&gt;
</pre>
<script type="text/javascript">
 var FilePaths = new Array(8)
FilePaths[0] = "catalog/view/theme/default/template/account/address_form.tpl";
FilePaths[1] = "catalog/view/theme/default/template/affiliate/edit.tpl";
FilePaths[2] = "catalog/view/theme/default/template/affiliate/register.tpl";
FilePaths[3] = "catalog/view/theme/default/template/checkout/address.tpl";
FilePaths[4] = "catalog/view/theme/default/template/checkout/guest.tpl";
FilePaths[5] = "catalog/view/theme/default/template/checkout/guest_shipping.tpl";
FilePaths[6] = "catalog/view/theme/default/template/checkout/register.tpl ";
FilePaths[7] = "catalog/view/theme/default/template/total/shipping.tpl";
document.write('<pre>');
      for ( var i = 0; i < FilePaths.length; i++) {
document.write(" &#60;file name=&#34;");
document.write(FilePaths[i]);
document.writeln("&#34;&#62;");
document.writeln(document.getElementById('repeat_content').innerHTML);
      }
document.writeln('</pre>');
</script>
<pre>
&lt;/modification&gt;
</pre>