ZenCart阅读之产品类型结构设计

product_types表结构

CREATE TABLE IF NOT EXISTS `product_types` (
`type_id` int(11) NOT NULL auto_increment,
`type_name` varchar(255) collate latin1_general_ci NOT NULL default ”,
`type_handler` varchar(255) collate latin1_general_ci NOT NULL default ”,
`type_master_type` int(11) NOT NULL default ‘1’,
`allow_add_to_cart` char(1) collate latin1_general_ci NOT NULL default ‘Y’,
`default_image` varchar(255) collate latin1_general_ci NOT NULL default ”,
`date_added` datetime NOT NULL default ‘0001-01-01 00:00:00’,
`last_modified` datetime NOT NULL default ‘0001-01-01 00:00:00’,
PRIMARY KEY  (`type_id`),
KEY `idx_type_master_type_zen` (`type_master_type`)
)

product_types表字段说明
type_id 类型ID
type_name 类型名称
type_handler 类型标示
type_master_type 父类id默认1
allow_add_to_cart 是否使用购物车
default_image 类型图标
date_added 添加时间
last_modified 变更时间
ZenCart默认了5个产品类型
Product – General,Product – Music,Document – General,Document – Product,Product – Free Shipping
product_type_layout表结构

CREATE TABLE IF NOT EXISTS `product_type_layout` (
`configuration_id` int(11) NOT NULL auto_increment,
`configuration_title` text collate latin1_general_ci NOT NULL,
`configuration_key` varchar(255) collate latin1_general_ci NOT NULL default ”,
`configuration_value` text collate latin1_general_ci NOT NULL,
`configuration_description` text collate latin1_general_ci NOT NULL,
`product_type_id` int(11) NOT NULL default ‘0’,
`sort_order` int(5) default NULL,
`last_modified` datetime default NULL,
`date_added` datetime NOT NULL default ‘0001-01-01 00:00:00’,
`use_function` text collate latin1_general_ci,
`set_function` text collate latin1_general_ci,
PRIMARY KEY  (`configuration_id`),
UNIQUE KEY `unq_config_key_zen` (`configuration_key`),
KEY `idx_key_value_zen` (`configuration_key`,`configuration_value`(10)),
KEY `idx_type_id_sort_order_zen` (`product_type_id`,`sort_order`)
)

product_type_layout表说明同configuration
product_types_to_category表结构

CREATE TABLE IF NOT EXISTS `product_types_to_category` (
`product_type_id` int(11) NOT NULL default ‘0’,
`category_id` int(11) NOT NULL default ‘0’,
KEY `idx_category_id_zen` (`category_id`),
KEY `idx_product_type_id_zen` (`product_type_id`)
)

product_types_to_category表字段说明
product_type_id 产品类型id
category_id 产品分类id

分享到:更多 ()

抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址