✅ e-commerce app
Hello, Can you help me with e-commerce product attributes concept, please? I want to build pet project and utilize this feature. But I don't know how to design database the right way, I've checked open source project - nopCommerce, but it's overwhelmed with other features that I won't have in my project. Maybe you have a simple database design with fields that I can start with. Basically I want to have variations of product and categories
8 Replies
Well, what would an e-shop need?
At bare minimum
product can have attributes like color, size (I want to add then dynamically) and options (color: red, green, blue, size l, m, xl) and product can have a category, for example category clothes -> summer -> products
Yeah
So we already have three tables: product, attribute, category
Product has a category and a list of attributes
Category can have child categories
Options could be enums, or two more tables: colors and sizes
Yes, but I need dynamic attributes, I know that it can be done by creating tables attributes(name) attribute_options (attr id, value) and product variant(product id, attribute options). but i don't understand it all would work , should I create all variants of products and store them in database, and how can I display product data on the product page, if I have 3 color * 3 size = 9 products to fetch
would be more or less the structure
By fetching a single product, say one with ID 781, you would also fetch all of its attributes, sizes, and the category
You don't save individual permutations in the database
So I add (color,red), (color,blue), (color, green) to the attribute list?
Because nopCommerce concept is to create product variations (color red, size l), (color green, size xl)
for example yes
And then you have the "output" product, that has just a single of each
For example, not a list of sizes but a single size
A list of attributes, but only one with a given name
Etc
Okay, I understand, thank you