5,7c5,7 < * @file < * Implements products definitions on behalf of ubercart/uc_product/uc_product.module. < */ --- > * @file > * Implements products definitions on behalf o ubercart/uc_product/uc_product.module. > */ 9,42c9,19 < // db_query("CREATE TABLE {uc_product_classes} ( < // `pcid` varchar(32) NOT NULL, < // `name` varchar(255) NOT NULL, < // `description` text, < // PRIMARY KEY (`pcid`) < // ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ;"); < // db_query("CREATE TABLE {uc_product_features} ( < // `pfid` mediumint(9) NOT NULL default 0, < // `nid` mediumint(9) NOT NULL default 0, < // `fid` varchar(32) NOT NULL, < // `description` text, < // PRIMARY KEY (`pfid`), < // KEY nid (nid) < // ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ;"); < // db_query("CREATE TABLE {uc_products} ( < // `vid` mediumint(9) NOT NULL default 0, < // `nid` mediumint(9) NOT NULL default 0, < // `model` varchar(255) NOT NULL default '', < // `list_price` decimal(10,2) NOT NULL default 0.00, < // `cost` decimal(10,2) NOT NULL default 0.00, < // `sell_price` decimal(10,2) NOT NULL default 0.00, < // `weight` float NOT NULL default 0, < // `weight_units` varchar(255) NOT NULL default 'lb', < // `length` float unsigned NOT NULL default 0, < // `width` float unsigned NOT NULL default 0, < // `height` float unsigned NOT NULL default 0, < // `length_units` varchar(255) NOT NULL default 'in', < // `pkg_qty` smallint unsigned NOT NULL default 1, < // `default_qty` smallint(5) unsigned NOT NULL default 1, < // `unique_hash` varchar(32) NOT NULL, < // `ordering` tinyint(2) NOT NULL default 0, < // `shippable` tinyint(2) NOT NULL default 1, < // PRIMARY KEY (`vid`) < // ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ;"); --- > # mysql CREATE definition: > #CREATE TABLE {uc_products} ( > # `nid` mediumint(9) NOT NULL, > # `model` varchar(255) NOT NULL, > # `list_price` decimal(10,2) NOT NULL default '0.00', > # `cost` decimal(10,2) NOT NULL default '0.00', > # `sell_price` decimal(10,2) NOT NULL default '0.00', > # `weight` float NOT NULL default '0', > # `units` varchar(255) NOT NULL default 'lbs', > # `unique_hash` varchar(32) NOT NULL, > # PRIMARY KEY (`nid`) 45,46c22,23 < * Implementation of hook_def(). < */ --- > * Implementation of hook_def(). > */ 50,73d26 < // Product class definitions. < $def = array( < '#type' => 'entity', < '#title' => t('Product class'), < '#db_default_table' => 'uc_product_classes', < '#xml_plural' => 'product-classes', < '#csv_plural' => 'product-classes', < ); < $def['pcid'] = array( < '#title' => t('Product class ID'), < '#reference_entity' => 'node_type', < '#reference_field' => array('node_type', 'type'), < '#key' => TRUE, < ); < $def['name'] = array( < '#title' => t('Name'), < ); < $def['description'] = array( < '#title' => t('Description'), < ); < < $defs['product_class'] = $def; < < // Just one Product definition? 81,87d33 < $def['vid'] = array( < '#type' => 'int', < '#title' => t('Revision ID'), < '#reference_entity' => 'product', < '#reference_field' => array('revisions', 'vid'), < '#key' => TRUE, < ); 91a38 > '#key' => TRUE 97c44 < '#title' => t('List price') --- > '#title' => t('List Price') 103c50 < '#title' => t('Sell price') --- > '#title' => t('Sell Price') 108,115c55,56 < $def['weight_units'] = array( < '#title' => t('Weight units') < ); < $def['length'] = array( < '#title' => t('Length'), < ); < $def['width'] = array( < '#title' => t('Width'), --- > $def['units'] = array( > '#title' => t('Units') 117,128d57 < $def['height'] = array( < '#title' => t('Height'), < ); < $def['length_units'] = array( < '#title' => t('Length units'), < ); < $def['pkg_qty'] = array( < '#title' => t('Package quantity'), < ); < $def['default_qty'] = array( < '#title' => t('Default quantity'), < ); 130,133c59 < '#title' => t('Unique hash') < ); < $def['ordering'] = array( < '#title' => t('Ordering'), --- > '#title' => t('Unique Hash') 135,141d60 < $def['shippable'] = array( < '#title' => t('Shippable'), < ); < < $defs['product'] = $def; < < return $defs; 149,150c68 < < $tables['uc_product_classes'] = 'uc_pc'; --- >