【问题标题】:How to create product specification table in database for ecommerce site如何在电子商务网站的数据库中创建产品规格表
【发布时间】:2020-01-03 20:28:09
【问题描述】:

我正在从事电子商务项目,我对在数据库上创建表没有什么困惑。

现在我正在电子商务中创建多种产品,例如 flikart。 对于服装,我需要不同的规格(颜色,尺寸),对于移动设备,我需要不同的规格(内存,存储),并且每种产品都有不同的规格。

如果我在前端查看页面(如果我选择手机意味着它应该只显示基于手机的规范)。

如何为此目的创建表。

【问题讨论】:

标签: php codeigniter


【解决方案1】:

您需要学习EAV 概念,即实体属性值。

您的表格可能是:

categories (id, title, parent_id, status) ; here parent_id is to handle child categories
products (id, title, description, price, status, quantity)
attributes (id, title, status) ; attribute can have colors, sizes
attributevalues (id, attribute_id, value, status) ; it contains colors's attribute_id and values can be green, red, yellow etc
attributes_products (id, product_id, attribute_id, attributevalue_id, price, sign) ; it will be attaching attribute title with options to a product also how much price add or minus in case of products attributes

如有疑问,请多问

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-11-10
    • 2017-12-16
    • 1970-01-01
    • 2018-03-15
    • 1970-01-01
    • 1970-01-01
    • 2012-05-06
    • 1970-01-01
    相关资源
    最近更新 更多