怎么加印第安州?


Answers:


22

在数据库中运行以下命令;

INSERT INTO `directory_country_region` VALUES
    (NULL , 'IN', 'AN','Andaman Nicobar'),
    (NULL , 'IN', 'AP','Andhra Pradesh'),
    (NULL , 'IN', 'AR','Arunachal Pradesh'),
    (NULL , 'IN', 'AS','Assam'),
    (NULL , 'IN', 'BH','Bihar'),
    (NULL , 'IN', 'CH','Chandigarh'),
    (NULL , 'IN', 'CG','Chhattisgarh'),
    (NULL , 'IN', 'DN','Dadra Nagar Haveli'),
    (NULL , 'IN', 'DD','Daman Diu'),
    (NULL , 'IN', 'DL','Delhi'),
    (NULL , 'IN', 'GA','Goa'),
    (NULL , 'IN', 'GJ','Gujarat'),
    (NULL , 'IN', 'HR','Haryana'),
    (NULL , 'IN', 'HP','Himachal Pradesh'),
    (NULL , 'IN', 'JK','Jammu Kashmir'),
    (NULL , 'IN', 'JH','Jharkhand'),
    (NULL , 'IN', 'KA','Karnataka'),
    (NULL , 'IN', 'KL','Kerala'),
    (NULL , 'IN', 'LD','Lakshadweep'),
    (NULL , 'IN', 'MP','Madhya Pradesh'),
    (NULL , 'IN', 'MH','Maharashtra'),
    (NULL , 'IN', 'MN','Manipur'),
    (NULL , 'IN', 'ML','Meghalaya'),
    (NULL , 'IN', 'MZ','Mizoram'),
    (NULL , 'IN', 'NL','Nagaland'),
    (NULL , 'IN', 'OR','Odisha'),
    (NULL , 'IN', 'PY','Pondicherry'),
    (NULL , 'IN', 'PB','Punjab'),
    (NULL , 'IN', 'RJ','Rajasthan'),
    (NULL , 'IN', 'SK','Sikkim'),
    (NULL , 'IN', 'TN','Tamil Nadu'),
    (NULL , 'IN', 'TG','Telangana'),
    (NULL , 'IN', 'TR','Tripura'),
    (NULL , 'IN', 'UP','Uttar Pradesh'),
    (NULL , 'IN', 'UT','Uttaranchal'),
    (NULL , 'IN', 'WB','West Bengal');

我的网站已经两岁了,刚才我结帐时会更新上述命令,对于所有询问选择状态的用户,但是我们知道客户状态,我如何为10万个客户分配状态给客户。
宝石'18年

13

Magento在其区域目录中没有为几个国家/地区提供区域。大多数国家/地区都没有自己的区域/州,例如印度,尼泊尔等。

第一步

第一个magento保存 region list at directory_country_region table:因此插入新区域list on with respective country in this tabledirectory_country_region

运行查询

   INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES
    (NULL, 'IN', 'ANDRA', 'Andra Pradesh'),
    (NULL, 'IN', 'ARUNA', 'Arunachal Pradesh'),
    (NULL, 'IN', 'ASSAM', 'Assam'),
    (NULL, 'IN', 'BIHAR', 'Bihar'),
    (NULL, 'IN', 'CHAND', 'Chandigarh'),
    (NULL, 'IN', 'CHHAT', 'Chhattisgarh'),
    (NULL, 'IN', 'DADAR', 'Dadar and Nagar Haveli'),
    (NULL, 'IN', 'DAMAN', 'Daman and Diu'),
    (NULL, 'IN', 'DELHI', 'Delhi'),
    (NULL, 'IN', 'GOA', 'Goa'),
    (NULL, 'IN', 'GUJAR', 'Gujarat'),
    (NULL, 'IN', 'HARYA', 'Haryana'),
    (NULL, 'IN', 'HP', 'Himachal Pradesh'),
    (NULL, 'IN', 'JK', 'Jammu and Kashmir'),
    (NULL, 'IN', 'JHARK', 'Jharkhand'),
    (NULL, 'IN', 'KARNA', 'Karnataka'),
    (NULL, 'IN', 'KERAL', 'Kerala'),
    (NULL, 'IN', 'LAKSH', 'Lakshadeep'),
    (NULL, 'IN', 'MP', 'Madya Pradesh'),
    (NULL, 'IN', 'MAHAR', 'Maharashtra'),
    (NULL, 'IN', 'MANIP', 'Manipur'),
    (NULL, 'IN', 'MEGHA', 'Meghalaya'),
    (NULL, 'IN', 'MIZOR', 'Mizoram'),
    (NULL, 'IN', 'NAGAL', 'Nagaland'),
    (NULL, 'IN', 'ORISS', 'Orissa'),
    (NULL, 'IN', 'PONDI', 'Pondicherry'),
    (NULL, 'IN', 'PUNJA', 'Punjab'),
    (NULL, 'IN', 'RAJAS', 'Rajasthan'),
    (NULL, 'IN', 'SIKKI', 'Sikkim'),
    (NULL, 'IN', 'TAMIL', 'Tamil Nadu'),
    (NULL, 'IN', 'TAMIL', 'Tripura'),
    (NULL, 'IN', 'UP', 'Uttar Pradesh'),
    (NULL, 'IN', 'UTTAR', 'Uttaranchal'),
    (NULL, 'IN', 'WB', 'West Bengal');

步骤2:同样,您还需要插入directory_country_region_name作为语言愿望区域名称

作为默认印度人民是用EN_US(语言代码)为默认语言

使用以下代码:

INSERT INTO directory_country_region_name( locale, region_id, name )
SELECT 'en_US' AS "language", region_id, default_name
FROM `directory_country_region`
WHERE country_id = 'IN';

如果您有多个lauguage,则最后一个插入项是import


我的网站已经两岁了,刚才我结帐时会更新上述命令,对于所有询问选择状态的用户,但是我们知道客户状态,我如何为10万个客户分配状态给客户。
宝石

是的,你可以做。但是需要一些自定义脚本来更新region_id
阿米特·贝拉

你能帮我做到吗?
宝石

首先从Mage :: getResourceModel('customer / address_collection')-> addAttributeToSelect('region_id')->-> addAttributeToSelect('region')获取客户/地址集合;$ addressObject-> getResource()-> saveAttribute($ addressObject,'attribute_Code');
阿米特·贝拉

我是核心的新手,请帮助我如何运行上面的代码并获取我的详细信息
Gem

4

更新状态列表

INSERT INTO `directory_country_region` VALUES
(NULL , 'IN', 'AN','Andaman and Nicobar'),
(NULL , 'IN', 'AP','Andhra Pradesh'),
(NULL , 'IN', 'AR','Arunachal Pradesh'),
(NULL , 'IN', 'AS','Assam'),
(NULL , 'IN', 'BH','Bihar'),
(NULL , 'IN', 'CH','Chandigarh'),
(NULL , 'IN', 'CT','Chhattisgarh'),
(NULL , 'IN', 'DN','Dadra and Nagar Haveli'),
(NULL , 'IN', 'DD','Daman and Diu'),
(NULL , 'IN', 'DL','Delhi'),
(NULL , 'IN', 'GA','Goa'),
(NULL , 'IN', 'GJ','Gujarat'),
(NULL , 'IN', 'HR','Haryana'),
(NULL , 'IN', 'HP','Himachal Pradesh'),
(NULL , 'IN', 'JK','Jammu Kashmir'),
(NULL , 'IN', 'JH','Jharkhand'),
(NULL , 'IN', 'KA','Karnataka'),
(NULL , 'IN', 'KL','Kerala'),
(NULL , 'IN', 'LD','Lakshadweep'),
(NULL , 'IN', 'MP','Madhya Pradesh'),
(NULL , 'IN', 'MH','Maharashtra'),
(NULL , 'IN', 'MN','Manipur'),
(NULL , 'IN', 'ML','Meghalaya'),
(NULL , 'IN', 'MZ','Mizoram'),
(NULL , 'IN', 'NL','Nagaland'),
(NULL , 'IN', 'OR','Odisha'),
(NULL , 'IN', 'PY','Pondicherry'),
(NULL , 'IN', 'PB','Punjab'),
(NULL , 'IN', 'RJ','Rajasthan'),
(NULL , 'IN', 'SK','Sikkim'),
(NULL , 'IN', 'TN','Tamil Nadu'),
(NULL , 'IN', 'TG','Telangana'),
(NULL , 'IN', 'TR','Tripura'),
(NULL , 'IN', 'UP','Uttar Pradesh'),
(NULL , 'IN', 'UT','Uttarakhand'),
(NULL , 'IN', 'WB','West Bengal');

4

Magento正在使用directory_country_region表存储状态名称。

您可以通过在数据库中运行查询将状态添加到表中,如下所示:

INSERT INTO `directory_country_region` (`region_id`, `country_id`,`code`, `default_name`) VALUES
(NULL, 'IN', 'ANDRA', 'Andra Pradesh'),
(NULL, 'IN', 'ARUNA', 'Arunachal Pradesh'),
(NULL, 'IN', 'ASSAM', 'Assam'),
(NULL, 'IN', 'BIHAR', 'Bihar'),
(NULL, 'IN', 'CHAND', 'Chandigarh'),
(NULL, 'IN', 'CHHAT', 'Chhattisgarh'),
(NULL, 'IN', 'DADAR', 'Dadar and Nagar Haveli'),
(NULL, 'IN', 'DAMAN', 'Daman and Diu'),
(NULL, 'IN', 'DELHI', 'Delhi'),
(NULL, 'IN', 'GOA', 'Goa'),
(NULL, 'IN', 'GUJAR', 'Gujarat'),
(NULL, 'IN', 'HARYA', 'Haryana'),
(NULL, 'IN', 'HP', 'Himachal Pradesh'),
(NULL, 'IN', 'JK', 'Jammu and Kashmir'),
(NULL, 'IN', 'JHARK', 'Jharkhand'),
(NULL, 'IN', 'KARNA', 'Karnataka'),
(NULL, 'IN', 'KERAL', 'Kerala'),
(NULL, 'IN', 'LAKSH', 'Lakshadeep'),
(NULL, 'IN', 'MP', 'Madya Pradesh'),
(NULL, 'IN', 'MAHAR', 'Maharashtra'),
(NULL, 'IN', 'MANIP', 'Manipur'),
(NULL, 'IN', 'MEGHA', 'Meghalaya'),
(NULL, 'IN', 'MIZOR', 'Mizoram'),
(NULL, 'IN', 'NAGAL', 'Nagaland'),
(NULL, 'IN', 'ORISS', 'Orissa'),
(NULL, 'IN', 'PONDI', 'Pondicherry'),
(NULL, 'IN', 'PUNJA', 'Punjab'),
(NULL, 'IN', 'RAJAS', 'Rajasthan'),
(NULL, 'IN', 'SIKKI', 'Sikkim'),
(NULL, 'IN', 'TAMIL', 'Tamil Nadu'),
(NULL, 'IN', 'TAMIL', 'Tripura'),
(NULL, 'IN', 'UP', 'Uttar Pradesh'),
(NULL, 'IN', 'UTTAR', 'Uttaranchal'),
(NULL, 'IN', 'WB', 'West Bengal');

您还可以通过添加国家代码,州代码和州名称来添加其他国家/地区的州名。


我的网站已经两岁了,刚才我结帐时会更新上述命令,对于所有询问选择状态的用户,但是我们知道客户状态,我如何为10万个客户分配状态给客户。
宝石'18年

3

截至2015年7月3日的最新状态

登录到cpanel转到数据库,然后转到directory_country_region表,然后单击SQL选项卡并添加以下代码

INSERT INTO `directory_country_region` VALUES
(NULL , 'IN', 'AN','Andaman and Nicobar Islands'),
(NULL , 'IN', 'AP','Andhra Pradesh'),
(NULL , 'IN', 'AR','Arunachal Pradesh'),
(NULL , 'IN', 'AS','Assam'),
(NULL , 'IN', 'BR','Bihar'),
(NULL , 'IN', 'CH','Chandigarh'),
(NULL , 'IN', 'CT','Chhattisgarh'),
(NULL , 'IN', 'DN','Dadra and Nagar Haveli'),
(NULL , 'IN', 'DD','Daman and Diu'),
(NULL , 'IN', 'DL','Delhi'),
(NULL , 'IN', 'GA','Goa'),
(NULL , 'IN', 'GJ','Gujarat'),
(NULL , 'IN', 'HR','Haryana'),
(NULL , 'IN', 'HP','Himachal Pradesh'),
(NULL , 'IN', 'JK','Jammu and Kashmir'),
(NULL , 'IN', 'JH','Jharkhand'),
(NULL , 'IN', 'KA','Karnataka'),
(NULL , 'IN', 'KL','Kerala'),
(NULL , 'IN', 'LD','Lakshadweep'),
(NULL , 'IN', 'MP','Madhya Pradesh'),
(NULL , 'IN', 'MH','Maharashtra'),
(NULL , 'IN', 'MN','Manipur'),
(NULL , 'IN', 'ML','Meghalaya'),
(NULL , 'IN', 'MZ','Mizoram'),
(NULL , 'IN', 'NL','Nagaland'),
(NULL , 'IN', 'OR','Odisha'),
(NULL , 'IN', 'PY','Puducherry'),
(NULL , 'IN', 'PB','Punjab'),
(NULL , 'IN', 'RJ','Rajasthan'),
(NULL , 'IN', 'SK','Sikkim'),
(NULL , 'IN', 'TN','Tamil Nadu'),
(NULL , 'IN', 'TG','Telangana'),
(NULL , 'IN', 'TR','Tripura'),
(NULL , 'IN', 'UP','Uttar Pradesh'),
(NULL , 'IN', 'UT','Uttarakhand'),
(NULL , 'IN', 'WB','West Bengal');

有关国家的最新列表,请在我的博客上检查相同的答案


在Magento中,更可取的方式作为更新sql脚本添加,因此适用于本地和远程实例。
huzefam 2015年

0

将印度的州列表添加到Magento


我已经对此进行了测试,并在服务器上为我工作。
请以管理员身份打开您的PHP并运行以下命令:
插入directory_country_region
(NULL,“ IN”,“ Andaman和Nicobar”,“ Andaman和Nicobar”),NULL “ IN” “ Andaman和Nicobar” “ Andaman和Nicobar” ),  
(NULL,“ IN”,“ Andhra Pradesh”,“ Andhra Pradesh”),NULL “ IN” “ Andhra Pradesh” “ Andhra Pradesh” ),  
(NULL,“ IN”,“阿鲁纳恰尔邦”,“阿鲁纳恰尔邦”),NULL “ IN” “ Arunachal Pradesh” “ Arunachal Pradesh” ),  
(NULL,“ IN”,“ Assam”,“ Assam”),NULL “ IN” “ Assam” “ Assam” ),  
(NULL,“ IN”,“ Bihar”,“ Bihar”),NULL “ IN” “ Bihar” “ Bihar” ),  
(NULL,“ IN”,“ Chandigarh”,“ Chandigarh”),NULL “ IN” “ Chandigarh” “ Chandigarh” ),  
(NULL,“ IN”,“ Chhattisgarh”,“ Chhattisgarh”),NULL “ IN” “ Chhattisgarh” “ Chhattisgarh” ),  
(NULL,“ IN”,“ Dadra和Nagar Haveli”,“ Dadra和Nagar Haveli”),NULL “ IN” “ Dadra和Nagar Haveli” “ Dadra和Nagar Haveli” ),  
(NULL,“ IN”,“ Daman和Diu”,“ Daman和Diu”),NULL “ IN” “ Daman和Diu” “ Daman和Diu” ),  
(NULL,“ IN”,“ Delhi”,“ Delhi”),NULL “ IN” “ Delhi” “ Delhi” ),  
(NULL,“ IN”,“ Goa”,“ Goa”),NULL “ IN” “ Goa” “ Goa” ),  
(NULL,“ IN”,“ Gujarat”,“ Gujarat”),NULL “ IN” “ Gujarat” “ Gujarat” ),  
(NULL,“ IN”,“ Haryana”,“ Haryana”),NULL “ IN” “ Haryana” “ Haryana” ),  
(NULL,“ IN”,“ Himachal Pradesh”,“ Himachal Pradesh”),NULL “ IN” “ Himachal Pradesh” “ Himachal Pradesh” ),  
(NULL,“ IN”,“ Jammu和克什米尔”,“ Jammu和克什米尔”),NULL “ IN” “ Jammu和克什米尔” “ Jammu和克什米尔” ),  
(NULL,“ IN”,“ Jharkhand”,“ Jharkhand”),NULL “ IN” “ Jharkhand” “ Jharkhand” ),  
(NULL,“ IN”,“ Karnataka”,“ Karnataka”),NULL “ IN” “ Karnataka” “ Karnataka” ),  
(NULL,“ IN”,“ Kerala”,“ Kerala”),NULL “ IN” “ Kerala” “ Kerala” ),  
(NULL,“ IN”,“ Lakshadweep”,“ Lakshadweep”),NULL “ IN” “ Lakshadweep” “ Lakshadweep” ),  
(NULL,“ IN”,“中央邦”,“中央邦”),NULL “ IN” “中央邦” “中央邦” ),  
(NULL,“ IN”,“ Maharashtra”,“ Maharashtra”),NULL “ IN” “ Maharashtra” “ Maharashtra” ),  
(NULL,“ IN”,“ Manipur”,“ Manipur”),NULL “ IN” “ Manipur” “ Manipur” ),  
(NULL,“ IN”,“ Meghalaya”,“ Meghalaya”),NULL “ IN” “ Meghalaya” “ Meghalaya” ),  
(NULL,“ IN”,“ Mizoram”,“ Mizoram”),NULL “ IN” “ Mizoram” “ Mizoram” ),  
(NULL,“ IN”,“ Nagaland”,“ Nagaland”),NULL “ IN” “ Nagaland” “ Nagaland” ),  
(NULL,“ IN”,“ Orissa”,“ Orissa”),NULL “ IN” “ Orissa” “ Orissa” ),  
(NULL,“ IN”,“ Pondicherry”,“ Pondicherry”),NULL “ IN” “ Pondicherry” “ Pondicherry” ),  
(NULL,“ IN”,“旁遮普”,“旁遮普”),NULL “ IN” “ Punjab” “ Punjab” ),  
(NULL,“ IN”,“ Rajasthan”,“ Rajasthan”),NULL “ IN” “ Rajasthan” “ Rajasthan” ),  
(NULL,“ IN”,“ Sikkim”,“ Sikkim”),NULL “ IN” “ Sikkim” “ Sikkim” ),  
(NULL,“ IN”,“ Tamil Nadu”,“ Tamil Nadu”),NULL “ IN” “ Tamil Nadu” “ Tamil Nadu” ),  
(NULL,“ IN”,“ Tripura”,“ Tripura”),NULL “ IN” “ Tripura” “ Tripura” ),  
(NULL,“ IN”,“北方邦”,“北方邦”),NULL “ IN” “北方邦” “北方邦” ),  
(NULL,“ IN”,“ Uttaranchal”,“ Uttaranchal”),NULL “ IN” “ Uttaranchal” “ Uttaranchal” ),  
(NULL,“ IN”,“西孟加拉邦”,“西孟加拉邦”);NULL “ IN” “ West Bengal” “ West Bengal” );  

INSERT INTO directory_country_region_namelocaleregion_idname SELECT'en_US',tmp.region_id,tmp.default_name FROM 'en_US' tmp region_id tmp default_name来自directory_country_region 在tmp所在的地方tmp.country_id ='IN';country_id = 'IN' ;


希望对您有帮助。http://tejabhagavan.blogspot.in/2015/12/adding-list-of-states-in-india-to.html

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.