如何确定多品类产品的面包屑?
我设计了一个电子商务系统,其中我拥有可以属于多个类别的产品。这非常适合搜索和浏览,让用户更轻松地找到产品。
但是,我还在产品页面上实现了面包屑,并且我不知道如何确定产品应显示在哪个类别中,因为它可能是产品所在的任何类别。理想情况下,我会不希望只是随机选择一个类别。
有人有什么想法吗?只要有帮助,我将不胜感激!
谢谢,尼科
I have designed an e-commerce system whereby I have products which can belong to multiple categories. This works well for searching and browsing and allows users to find products more easily.
However, I have also implemented breadcrumbs on the product page, and I don't know how to determine which category the product should be shown as being in, seeing as it could be any of the categories that the product is in. Ideally I would prefer not to just select a category randomly.
Does anyone have any ideas? I would be grateful for only help!
Thanks, Nico
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是否可以根据您目前最想推广的产品设置全局加权类别,或者根据更适用的产品类别对产品进行“本地”权重。无论哪种情况,如果出现冲突,他们的权重都可以解决。
我会选择第二个。总有一种方法可以选择更适合产品的类别。
How about having globally weighted categories based on what you want to promote the most at this time, or "local" weights on the product's categories based on what's more applicable to it. In either case if there's a conflict their weights can resolve it.
I'd go for the 2nd one. There will always be a way to choose a category that's more appropriate for a product.
因为您的类别是分层的,所以我建议如果特定产品属于多个类别,那么其面包屑应首先包含根类别,然后是子类别,用户缩小导航范围的次数越多,面包屑中附加的子类别就越多。
Because your categories are hierachical so I'd suggest that if a specific product belongs to several categories then its breadcrumb should contains root category first then sub-categories, the more user narrow down the navigation the more sub-catetories are appended into the breadcrumb.
您应该制作几条面包屑线(路径)。每个路径将代表产品所属的类别之一。您应该显示与产品类别数量一样多的路径。这会给客户一个很好的选择。
You should make several breadcrumb lines (paths). Each path will represent one of the categories the product is in. You should show as many paths as the number of product's categories. This will give the customer a good choice.
您可以使用闭包表来表示多对多关系。在该闭合表中,您可以包含路径长度和面包屑列。因此,每个产品将拥有与分层祖先一样多的面包屑。
您可以从 Bill Karwin 找到有关回复和资源的更多信息,最值得注意的是 MySQL Closure Table 分层数据库 - 如何以正确的顺序提取信息 和 http://www.slideshare.net/billkarwin/models-for-hierarchical-data(转到幻灯片 40)。
You can use a closure table to represent your many to many relationships. In that closure table you can include a path length and a breadcrumb column. Therefore, each product will have as many breadcrumbs as it as hierarchical ancestors.
You can find more info on responses and resources from Bill Karwin, most notably MySQL Closure Table hierarchical database - How to pull information out in the correct order and http://www.slideshare.net/billkarwin/models-for-hierarchical-data (go to slide 40).