Magento 数据库查询以获取某个价格范围内的产品数量
我通过超链接静态添加了价格范围:
- $0 - $500
- $500 - $1,000
- $1,000 - $2,500
- $2,500 - $5,000
- $5,000 - $10,000
- $10,000 - $15,000
- $15,000 及以上
例如,当我单击链接 $1000-$2500 时,网址为 http://localhost/magento/index.php/catalogsearch/advanced/result/?price[from]=1000&price[to]=2500&category=9
。这工作正常。我只想通过检查表中的价格字段来显示每个价格范围的产品数量。可能会问什么?
I have statically added price range with hyperlinks:
- $0 - $500
- $500 - $1,000
- $1,000 - $2,500
- $2,500 - $5,000
- $5,000 - $10,000
- $10,000 - $15,000
- $15,000 and up
For example, when I click the link $1000-$2500, the url ishttp://localhost/magento/index.php/catalogsearch/advanced/result/?price[from]=1000&price[to]=2500&category=9
. This is working fine. I want to display the number of products for each price range only by checking the price field in the table. What might be the query?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您知道可以使用分层导航来实现此目的吗?这是一种导航,它将在您类别的产品列表页面的左栏中显示产品集合的过滤器(在默认主题中)。默认的过滤器类型是价格。要启用分层导航,您应该转到类别属性,并在
显示设置
中将Is Anchor
设置为true
。您可以手动指定过滤器的步骤。第一种方法是在管理后端菜单System ->配置
,还有目录->目录->分层导航
。第二种方法是在类别的属性中更改它:Display Settings ->分层导航价格步骤
Do you know that you can use Layered Navigation for this purposes? This is kind of navigation which will show filters on product collection in the left column of you category's products list page (in default theme). Default kind of filter is price. To enable layered navigation you should go to properties of category and there in
Display Settings
setIs Anchor
totrue
. You could manually specify step for filters. The first way to do this is in admin backend menuSystem -> Configuration
, and thereCatalog->Catalog->Layered Navigation
. The second way is to change it in the properties of category:Display Settings -> Layered Navigation Price Step