> Zencart中文手册 > Easy Populate CSV批量上传插件安装

安装方法

1.将admin改为自己后台目录名然后上传文件

2.数据库安装上有2中方式

一、

直接导入install.sql导入,但是作者写的sql掉了一项,从而导致运行bug,且作者将Configuration定值为了id31,这样如果其他插件将id31占用的话就会导致导入失败,一下是修正

1 INSERT INTO admin_pages VALUES ('easyPopulate', 'BOX_TOOLS_EASY_POPULATE','FILENAME_EASYPOPULATE', '', 'tools', 'Y', '14');
2 INSERT INTO admin_pages_to_profiles VALUES ('1', 'easyPopulate');
3 INSERT INTO configuration_group VALUES ('', 'Easy Populate', 'Config options for Easy Populate', '31', '1');
4 UPDATE configuration_group SET sort_order = last_insert_id() WHEREconfiguration_group_id = last_insert_id();
5 SET @typk4=0;
6 SELECT (@typk4:=configuration_group_id) as typk4
7 FROM configuration_group
8 WHERE configuration_group_title= 'Easy Populate';
9 INSERT INTO admin_pages VALUES ('easyPopulateConfig','BOX_CONFIGURATION_EASY_POPULATE', 'FILENAME_CONFIGURATION', CONCAT('gID=',@typk4),'configuration', 'Y', '26');
10 INSERT INTO configuration VALUES
11 ('', 'Uploads Directory', 'EASYPOPULATE_CONFIG_TEMP_DIR', 'tempEP/', 'Name of directory for your uploads (default: tempEP/).', @typk4, '0', NULL, now(), NULL,NULL),
12 ('', 'Upload File Date Format', 'EASYPOPULATE_CONFIG_FILE_DATE_FORMAT', 'm-d-y','Choose order of date values that corresponds to your uploads file, usually generated by MS excel. Raw dates in your uploads file (Eg 2005-09-26 09:00:00) are not affected, and will upload as they are.', @typk4, '1', NULL, now(), NULL,'zen_cfg_select_option(array("m-d-y", "d-m-y", "y-m-d"),'),
13 ('', 'Default Raw Time', 'EASYPOPULATE_CONFIG_DEFAULT_RAW_TIME', '09:00:00', 'If no time value stipulated in upload file, use this value. Useful for ensuring specials begin after a specific time of the day (default: 09:00:00)', @typk4, '2', NULL, now(), NULL, NULL),
14 ('', 'Split File On # Records', 'EASYPOPULATE_CONFIG_SPLIT_MAX', '300', 'Default number of records for split-file uploads. Used to avoid timeouts on large uploads (default: 300).', @typk4, '3', NULL, now(), NULL, NULL),
15 ('', 'Maximum Category Depth', 'EASYPOPULATE_CONFIG_MAX_CATEGORY_LEVELS', '7','Maximum depth of categories required for your store. Is the number of category columns in downloaded file (default: 7).', @typk4, '4', NULL, now(), NULL, NULL),
16 ('', 'Upload/Download Prices Include Tax', 'EASYPOPULATE_CONFIG_PRICE_INC_TAX','false', 'Choose to include or exclude tax, depending on how you manage prices outside of Zen Cart.', @typk4, '5', NULL, now(), NULL,'zen_cfg_select_option(array("true", "false"),'),
17 ('', 'Make Zero Qty Products Inactive', 'EASYPOPULATE_CONFIG_ZERO_QTY_INACTIVE','false', 'When uploading, make the status Inactive for products with zero qty (default: false).', @typk4, '6', NULL, now(), NULL,'zen_cfg_select_option(array("true", "false"),'),
18 ('', 'Smart Tags Replacement of Newlines', 'EASYPOPULATE_CONFIG_SMART_TAGS', 'true','Allows your description fields in your uploads file to have carriage returns and/or new-lines converted to HTML line-breaks on uploading, thus preserving some rudimentary formatting (default: true).', @typk4, '7', NULL, now(), NULL,'zen_cfg_select_option(array("true", "false"),'),
19 ('', 'Advanced Smart Tags', 'EASYPOPULATE_CONFIG_ADV_SMART_TAGS', 'false', 'Allow the use of complex regular expressions to format descriptions, making headings bold, add bullets, etc. Configuration is in ADMIN/easypopulate.php (default: false).', @typk4,'8', NULL, now(), NULL, 'zen_cfg_select_option(array("true", "false"),'),
20 ('', 'Debug Logging', 'EASYPOPULATE_CONFIG_DEBUG_LOGGING', 'true', 'Allow Easy Populate to generate an error log on errors only (default: true)', @typk4, '9', NULL, now(), NULL, 'zen_cfg_select_option(array("true", "false"),'),
21 ('', 'Custom Products Fields', 'EASYPOPULATE_CONFIG_CUSTOM_FIELDS', '', 'Enter a comma seperated list of fields to be automatically added to import/export file(ie: products_length, products_width). Please make sure field exists in PRODUCTS table.', @typk4, '10', NULL, now(), NULL, NULL);

二、

通过url安装

进入后台后,运行http://www.xxx.com/you_admin/easypopulate.php?langer=installnew(注:并不是插件说明中写的langer=instal)

作者在方式二中,又漏掉了对插件对后台的挂钩显示,

adminincludesfunctionsextra_functionseasypopulate_functions.php中查找

1 $group_id = mysql_insert_id();

在其下增加

1 $db->Execute("INSERT INTO ".TABLE_ADMIN_PAGES." VALUES ('easyPopulate', 'BOX_TOOLS_EASY_POPULATE', 'FILENAME_EASYPOPULATE', '', 'tools', 'Y', '14')");
2 $db->Execute("INSERT INTO ".TABLE_ADMIN_PAGES_TO_PROFILES." VALUES ('1', 'easyPopulate')");
3 $db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = " . $group_id. " WHERE configuration_group_id = " . $group_id);

查找

1 function remove_easypopulate() {
2 global $db, $ep_keys;

在其下增加

1 @$db->Execute("delete from " . TABLE_ADMIN_PAGES . "
2 where page_key = 'easyPopulate'");
3
4 @$db->Execute("delete from " . TABLE_ADMIN_PAGES . "
5 where page_key = 'easyPopulateConfig'");
6
7 @$db->Execute("delete from " . TABLE_ADMIN_PAGES_TO_PROFILES . "
8 where page_key = 'easyPopulate'");

卸载

后台运行http://www.xxx.com/you_admin/easypopulate.php?langer=remove,然后删除文件即可