按类别列出视图
我可以在我正在工作的网站上查看所有类别(http://www.thetradinghouse.co.nz/view-all)。正如您所看到的,产品不是按类别排序的,我如何更改它,因为我也想对管理产品列表执行此操作。
五:1.5.1.3
I have a view all category on the website I am working on (http://www.thetradinghouse.co.nz/view-all). As you can see the products are not in order by category how could I change this as I also would like to do this with the admin product listings too.
V: 1.5.1.3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这种事情需要在相应的 model/catalog/product.php 文件中进行大量编辑。这就是目录方面的事情。管理员应该要求类似的东西。首先,您需要将类别附加到 SQL,就像使用类别过滤器时一样
然后将变得只是
因为您希望它可用而不管 filter_category_id
那么您需要将类别 id 添加为排序选项
需要添加 p2c.category_id
并且如果没有提供则设置默认排序,更改
为
最后您需要编辑所述页面的控制器并找到排序值的默认值,并将其更改为
p2c.category_id
This kind of thing requires quite a bit of editing in the respective
model/catalog/product.php
files. This is how for the catalog side of things. The admin should require something similar. To start with, you're going to need to attach the category to the SQL like it does when the category filter is usedWould then become just
Since you want it to be available regardless of the filter_category_id
Then you need to add the category id as a sort option
will need p2c.category_id adding to it
And also set the default sort if none is supplied, changing
To
Finally you'll need to edit the controller for the said pages and find the default of the sort value, and change it to
p2c.category_id