首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Magento中国地区运费表设立

2012-12-25 
Magento中国地区运费表设置转自:http://www.earthplayer.com/bbs/viewthread.php?tid478在Magento 里面除

Magento中国地区运费表设置
转自:http://www.earthplayer.com/bbs/viewthread.php?tid=478

在Magento 里面除了固定运费,另外一个适合简单配置的就是表运费的设置(table rate)
在汉化的时候注意要先加上国内的地区,才能使用到表运费此项功能,但在magento的英文文档说得不清不楚的。
可以参考原文:http://www.magentocommerce.com/w ... r_s_guide/chapter_4

这里进行一下补充说明,首先是表运费需要用到的csv文件,就是运费表,需要自定义然后在magento商店后台的website级别进行配置导入

"国家","省份/地区","邮编","重量 (及以上)","配送价格"
"CHN","GD","*","0",200
"CHN","*","*","50",400
"CHN","*","*","0",800

国家 --> 定义在“directory_country”表, 使用样例数据时,已经导入了,中国的标识符号是“CN”以及"CHN"
省份和地区 --> 定义在“directory_country_region”表,需要自己进行导入

INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'GD', '广东');


另外还可以根据locale定义不同语言下面显示的名
INSERT INTO `magento`.`directory_country_region_name` (`locale` ,`region_id` ,`name` )VALUES ('zh_CN', '182', '广东');INSERT INTO `magento`.`directory_country_region_name` (`locale` ,`region_id` ,`name` )VALUES ('en_US', '182', 'Canton');

这样就可以定义地区和地区运输费率了

成功导入之后可以在‘shipping_tablerate’表看见导入的数据内容

全国34个地区参考SQL
INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'GD', '广东');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'BJ', '北京');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'SH', '上海');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'TJ', '天津');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HE', '河北');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'SX', '山西');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'NM', '内蒙古');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'LN', '辽宁');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'JL', '吉林');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HL', '黑龙江');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'JS', '江苏');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'ZJ', '浙江');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'AH', '安徽');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'FJ', '福建');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'JX', '江西');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'SD', '山东');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HA', '河南');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HB', '湖北');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HN', '湖南');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'GX', '广西');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HI', '海南');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'CQ', '重庆');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'SC', '四川');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'GZ', '贵州');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'YN', '云南');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'XZ', '西藏');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'SN', '陕西');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'GS', '甘肃');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'QH', '青海');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'NX', '宁夏');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'XJ', '新疆');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HK', '香港');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'AM', '澳门');INSERT INTO `magento`.`directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'TW', '台湾');

热点排行