DB模式帮助,链接产品的变体 [英] DB schema help, linking variations of products

查看:124
本文介绍了DB模式帮助,链接产品的变体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

干草,我在做一个网站,产品可以有各种颜色和大小。每个项目都有不同的'item_code'。我如何将这些链接在一起?我可以有一个选项,以便当管理员添加一个新产品时,它询问该产品是否是另一个产品的变体。如果它找到所有链接的产品和所有的ID在另一个表(如'product_variations')。



任何帮助或提示将是真棒。

感谢

解决方案

一个简单的表单就像:

 产品:
--id
--name
--code
--price


Products_Variants:
--id
--id_product
--id_feature
--value

b $ b特征:
--id
--name

你会有颜色,大小等。


Hay all, I'm making a website where a product can come in a variety of colours and sizes. Each item has a different 'item_code'. How could i link these together? I could have an option, so that when an admin adds a new product, it askes if this product is a variation of another product. If it is then finds ALL the linked products and all the ID's inside another table (like 'product_variations').

Any help or tips would be awesome.

Thanks

解决方案

a simple form would be something like:

Products:
--id
--name
--code
--price


Products_Variants:
--id
--id_product
--id_feature
--value


Features:
--id
--name

In features you would have things like color, size etc.

这篇关于DB模式帮助,链接产品的变体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆