Difference between revisions of "importing data into ZenCart"
(documenting actual patches; am I done? Hopefully.) |
|||
Line 3: | Line 3: | ||
==Overview== | ==Overview== | ||
[[ZenCart]], as of this writing, has no facility for importing business data for other applications. Due to ZenCart's [[open source]] nature, however, it is not difficult to write such a routine and add it to the menu of available functions in the Administration section. The necessary particulars are not very well documented yet, so this page will be a collection point for that information. | [[ZenCart]], as of this writing, has no facility for importing business data for other applications. Due to ZenCart's [[open source]] nature, however, it is not difficult to write such a routine and add it to the menu of available functions in the Administration section. The necessary particulars are not very well documented yet, so this page will be a collection point for that information. | ||
− | == | + | ==Patches== |
− | I | + | * '''new file''': admin/includes/boxes/custom_dhtml.php |
+ | <php><?php | ||
+ | /* | ||
+ | 2006-09-17 (wzl) custom menu loader based on reports.dhtml and others | ||
+ | |||
+ | REQUIRES: | ||
+ | admin/custom_menu.php | ||
+ | single-line modification to admin/includes/header_navigation.php | ||
+ | */ | ||
+ | if (!defined('IS_ADMIN_FLAG')) { | ||
+ | die('Illegal Access'); | ||
+ | } | ||
+ | |||
+ | define('CUSTOM_MENU_MODULE', 'custom_menu'); | ||
+ | |||
+ | $za_contents = array(); | ||
+ | $za_heading = array(); | ||
+ | // 2006-09-17 (Wzl) this could ultimately use language defines, but for now I am hard-coding the text | ||
+ | $za_heading = array('text' => 'Jubilee Custom Functions', 'link' => zen_href_link(CUSTOM_MENU_MODULE, '', 'NONSSL')); | ||
+ | $za_contents[] = array('text' => 'Bulk product entry', 'link' => zen_href_link(CUSTOM_MENU_MODULE, 'set=prod_entry', 'NONSSL')); | ||
+ | ?> | ||
+ | <!-- drop-down //--> | ||
+ | <?php | ||
+ | echo zen_draw_admin_box($za_heading, $za_contents); | ||
+ | ?> | ||
+ | <!-- end of drop-down //--></php> | ||
+ | "Jubilee Custom Functions" can be replaced by whatever text seems appropriate; "Jubilee" was part of the name of the store I was setting up, and I wanted to make it clear to the owner that this was the menu entry I had written for him. | ||
+ | |||
+ | * '''new file''': [[ZenCart data import - admin/custom_menu.php]] | ||
+ | * '''file edit''': admin/includes/header_navigation.php | ||
+ | <php>// require(DIR_WS_BOXES . 'extras_dhtml.php'); | ||
+ | require(DIR_WS_BOXES . 'custom_dhtml.php');</php> | ||
+ | Removing extras_dhtml.php is optional; the store I was setting up had no use for it. | ||
+ | |||
+ | So far, I haven't needed to use the new table names in more than one file; if I do, I'll need to move the defines from '''admin/custom_menu.php''' to '''includes/database_tables.php''' | ||
==Reference== | ==Reference== | ||
* ZenCart wiki: [[zencartwiki:DB - Importing products|DB - Importing products]] | * ZenCart wiki: [[zencartwiki:DB - Importing products|DB - Importing products]] |
Revision as of 17:33, 10 March 2007
computing: software: ZenCart: importing data
Overview
ZenCart, as of this writing, has no facility for importing business data for other applications. Due to ZenCart's open source nature, however, it is not difficult to write such a routine and add it to the menu of available functions in the Administration section. The necessary particulars are not very well documented yet, so this page will be a collection point for that information.
Patches
- new file: admin/includes/boxes/custom_dhtml.php
<php><?php /*
2006-09-17 (wzl) custom menu loader based on reports.dhtml and others
REQUIRES:
admin/custom_menu.php single-line modification to admin/includes/header_navigation.php
- /
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
define('CUSTOM_MENU_MODULE', 'custom_menu');
$za_contents = array(); $za_heading = array();
// 2006-09-17 (Wzl) this could ultimately use language defines, but for now I am hard-coding the text
$za_heading = array('text' => 'Jubilee Custom Functions', 'link' => zen_href_link(CUSTOM_MENU_MODULE, , 'NONSSL')); $za_contents[] = array('text' => 'Bulk product entry', 'link' => zen_href_link(CUSTOM_MENU_MODULE, 'set=prod_entry', 'NONSSL'));
?> <?php echo zen_draw_admin_box($za_heading, $za_contents); ?> </php> "Jubilee Custom Functions" can be replaced by whatever text seems appropriate; "Jubilee" was part of the name of the store I was setting up, and I wanted to make it clear to the owner that this was the menu entry I had written for him.
- new file: ZenCart data import - admin/custom_menu.php
- file edit: admin/includes/header_navigation.php
<php>// require(DIR_WS_BOXES . 'extras_dhtml.php');
require(DIR_WS_BOXES . 'custom_dhtml.php');</php>
Removing extras_dhtml.php is optional; the store I was setting up had no use for it.
So far, I haven't needed to use the new table names in more than one file; if I do, I'll need to move the defines from admin/custom_menu.php to includes/database_tables.php
Reference
- ZenCart wiki: DB - Importing products