[ic] loading products into Foundation store

Jonathan Clark jonc at webmaint.com
Sun Oct 19 10:12:23 EDT 2003

> I'm entering all of our store products into a MySQL database,
> in advance of setting up an Interchange store.
> At that point we expect to use paid expertise,
> but for now I've got to take a lot of photographs and key in
> hundreds of items,
> so I want to make sure that the data ends up in a useable format.
> Some questions:
> For economy, I'd like my products table to match field-for-field
> the table
> created by
> products.sql , however, I need to store some additional product
> details and
> vendor info for each product, maybe five more fields.
> Where in Interchange would that info be stored?
> Would it require modifying the Foundation store?

the file <catalog root>/dbconf/mysql/products.mysql stores the table
definition for that table. That said, when a new Interchange catalog is
started, it looks at the header of the products.txt file to deside what
fields are in the table, any not in the products.mysql file are given a
default data type in Interchange - varchar(128).

On loading the catalog, Interchange looks for a products/.products.sql file
(ic4.9.x) or products/products.sql (previous versions). If this file is not
present then Interchange will attempt to drop the products table and
recreate the SQL table using the field list and data from the
products/products.txt file so beware! To override this behaviour use:

  NoImport products

in the products.mysql file.

Interchange would then just do a SELECT on the products table to decide that
fields there are, referring to your products.mysql file for field types and
falling back to a default type if the type is not defined in there.


Jonathan Clark
Webmaint.com - Building Clever Websites   http://www.webmaint.com/
Webmaint.net - Business Web Hosting       http://www.webmaint.net/

> Here's my database structure, would this easily import into Interchange
> Foundation?
> CREATE TABLE `products` (
>    `sku` varchar(64) NOT NULL default '',
>    `description` varchar(128) NOT NULL default 'NEW',
>    `title` varchar(128) NOT NULL default 'NEW',
>    `template_page` varchar(64) default NULL,
>    `comment` text,
>    `thumb` varchar(128) default NULL,
>    `image` varchar(64) default NULL,
>    `price` decimal(12,2) NOT NULL default '0.00',
>    `category` varchar(64) NOT NULL default '',
>    `prod_group` varchar(64) NOT NULL default '',
>    `nontaxable` char(3) default NULL,
>    `weight` varchar(12) NOT NULL default '0',
>    `size` varchar(96) default NULL,
>    `color` varchar(96) default NULL,
>    `gift_cert` char(3) default '0',
>    `related` text,
>    `featured` varchar(32) default NULL,
>    `extra_field_1`  varchar(50) default '0',
>    `extra_field_2` varchar(50) default '0',
>    `extra_field_3` varchar(50) default '0',
>    `extra_field_4` varchar(50) default '0',
>    `extra_field_5`  varchar(50) default '0',
>    PRIMARY KEY  (`sku`),
>    KEY `idx_cat` (`category`),
>    KEY `title` (`title`),
>    KEY `price` (`price`),
>    KEY `prod_group` (`prod_group`)
> Thanks for your consideration,
> John
> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users

More information about the interchange-users mailing list