당신이 실제로 좋은 일을 .. OpenCarts 데이터베이스를 살펴 할 수 있습니다 ... 기본적으로
:
를위한 테이블 만들기 : 제품 제품 옵션 (당신 ' 제품 테이블 '각각의 제품이 나열 될
)'과에서 가격 이 '제품 옵션에'사양 '테이블, 당신은 본질적으로 다른 목록'spcifications ') 제품 옵션 값 (당신의'specvalues 제품 ...
제품 옵션 값 테이블에는 실제 옵션과 기본 가격 (+/-)의 변경 사항이 나열되어 있습니다 ...
완료된 주문을 저장하려면 OpenCart가 본질적으로 동일한 테이블을 가지고 있어야합니다. 주문 id가 연관된)
Recetly 토너먼트의 플레이어 등록을 처리하기 위해 장바구니 기능을 리핑했습니다 ...$ (25) 'product_option'단순히 값이 'product_option_value'에 저장되어있는 '스펙'을 '등록 형'의 경우/"등록 유형"
가 나열 -
기본 '제품은'선수 등록입니다 테이블 ... 그들은 & 놀이로 등록 할 수 있습니다 (& 놀이는 minigames로 들어갑니다) 지불은 가격에 변화없이 단지 기본 옵션입니다 ... 유료 앤 플레이는 $ 15를 가격에 추가합니다 $ 40 합계)
쉽게 여러 개의 "Produc t_options "및"product_option_value "세트가 제품에 ... 각각의 제품을 더하거나 뺍니다 ...
스크립트 쪽에서는 제품을 사용하여 어레이를 쿼리하고 빌드하는 데 몇 개의 루프 만 걸립니다. 당신이 말한 경우 각 제품의 옵션 배열
'product_option_value'테이블의 하위 배열과 같은 제품의 하위 배열과 같은 제품 옵션을 배열, 제품 옵션 값은
--
-- Table structure for table `product`
--
CREATE TABLE IF NOT EXISTS `product` (
`product_id` int(11) NOT NULL auto_increment,
`site_id` int(11) NOT NULL,
`name` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL,
`description` text character set utf8 collate utf8_unicode_ci NOT NULL,
`price` decimal(15,2) NOT NULL default '0.00',
`date_available` date NOT NULL,
`date_unavailable` date NOT NULL,
`status` int(1) NOT NULL default '0',
`date_added` datetime NOT NULL default '0000-00-00 00:00:00',
`date_modified` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`product_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ;
--
-- Dumping data for table `product`
--
INSERT INTO `product` (`product_id`, `site_id`, `name`, `description`, `price`, `date_available`, `date_unavailable`, `status`, `date_added`, `date_modified`) VALUES
(1, 2, 'Player Registration', 'This year we have two options: Pay or Pay & Play.<br />Pay & Play allows you to enroll in the Flights Minigames for the weekend (Master''s Marks and Flights Doubles) and gives you twenty dollars worth of prize raffles. <br />Pay & Play is a $60.00 value and is only avalible during pre-registration.', 25.00, '2011-03-01', '2011-03-31', 1, '2011-03-01 00:00:00', '2011-03-01 00:00:00');
-- --------------------------------------------------------
--
-- Table structure for table `product_option`
--
CREATE TABLE IF NOT EXISTS `product_option` (
`product_option_id` int(11) NOT NULL auto_increment,
`product_id` int(11) NOT NULL,
`sort_order` int(3) NOT NULL default '0',
`name` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`product_option_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ;
--
-- Dumping data for table `product_option`
--
INSERT INTO `product_option` (`product_option_id`, `product_id`, `sort_order`, `name`) VALUES
(1, 1, 1, 'Registration Type');
-- --------------------------------------------------------
--
-- Table structure for table `product_option_value`
--
CREATE TABLE IF NOT EXISTS `product_option_value` (
`product_option_value_id` int(11) NOT NULL auto_increment,
`product_option_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`price` decimal(15,2) NOT NULL,
`prefix` char(1) collate utf8_bin NOT NULL,
`sort_order` int(3) NOT NULL,
`name` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`product_option_value_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=3 ;
--
-- Dumping data for table `product_option_value`
--
INSERT INTO `product_option_value` (`product_option_value_id`, `product_option_id`, `product_id`, `price`, `prefix`, `sort_order`, `name`) VALUES
(1, 1, 1, 15.00, '+', 1, 'Pay & Play'),
(2, 1, 1, 0.00, '', 2, 'Pay');