How to show product variation in detail page in ASP.NET

a 夏天 提交于 2019-12-12 00:44:36

问题


I am totally stuck in product variation in my upcoming e-commerce website. Like I have multiple variations for single product. For example Product is available in different Color and Size Variation but this is not fixed that variation is only available in Color and Size it may be more or less.

If you have any solution for this problem then please give me some hint.I am developing website in ASP.NET and I want to make my own e-commerce application so I'm not using any CMS.


回答1:


Usually this is managed by the hierarchy of creating attributes, product types and then products, in that order bottom up.

Attributes are at the discrete level. So you have numeric, string, list or Boolean kind of attributes. E.g. Size is an attribute, that is a list of String values (S,M,L,XL etc). Same with Color. Age can be a numeric attribute.

Now you can build product types, that represent what kind of product it is. E.g. a product type can be "T-Shirt". Now you can associate attributes with this product type. Say size and color.

When you want to create product, let admin choose product type. Using that, show them and let them configure the attributes they will have on the product. So if they choose T shirt product type, they will be able to choose values for Color and Size (since those are lists).

So if you want to update the product type and add age attribute to it, you can do so easily. And then all products that use that product type will start showing Age as another attribute. And Age being numeric, you can show text box to customers for accepting value for that field.

Hope this helps!



来源:https://stackoverflow.com/questions/31021240/how-to-show-product-variation-in-detail-page-in-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!