T
T
trevoga_su2015-08-19 18:16:48
MySQL
trevoga_su, 2015-08-19 18:16:48

How to make an IM with bundled goods?

I am writing a kind of nonsense. I am expanding the old site.
In addition to the goods, the store will also have sets of goods.
Initially, he planned that the kit is the same product, only with the help of the link table he knows about his components of the kit (the same products). Well, it also stores a discount that would be given on the amount of the components of the kit.
Those. in fact, the difference between a product and a kit is only that the kit is a grouping link of several products:

# любой товар может стать комплектом
create table item (
id int unsigned not null primary key auto_increment,
title varchar(255) not null,
description text not null,
price smallint unsigned not null,
count smallint unsigned not null,
is_package tinyint unsigned not null default 0,
);

# компоненты комплекта
create table item_component (
item_id int unsigned not null primary key auto_increment, # ссылка на главный товар-комплект
component_id int unsigned not null primary key auto_increment, # ссылка на компонент комплекта
discount tinyint unsigned not null default 0 
);

And then the customer himself does not know what he wants ... - does it make sense to break up a set of goods as I described above, or not?
You can stupidly call the product a set and sell it, i.e. at the DBMS level, it will be a common commodity.
Does it make sense to do the same for kits as I described above, or is it limited to just the name of the product "Kit"?
Well, I'll listen to the arguments for / against.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Kovalsky, 2015-08-19
@dmitryKovalskiy

If you just have a catalog, then you can have such a product as a bundle, you can even create such a category. But if you have a record of the number of goods, you need to create a separate entity.
upd: There is still a question about the number of such kits. I don’t want to produce entities and join requests for the sake of 5-10 lines

S
Sergey, 2015-08-19
@gangstarcj

To make kits, you can add any number of any products to the kit and indicate a discount on these products (you can price each product separately or the full cost of the entire kit). When a person buys a set, these goods fall into the cart, they are also displayed as a set in the cart, but the goods are substituted in the code by the product ID.

N
Noob_001, 2015-08-20
@Noob_001

[item] - [prices in dates] - [discount group] (terms, quantity, total price, date from, date to) - [set options] (through a set of discounts + price taking into account the discount in the group) + [additional bonuses. .. yes/no. or additional goods as a bonus]
somewhere else ... regular customers, network discount cards, storage location, delivery time (sets or goods), etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question