Magento 工具栏(排序/分页)在自定义页面上不起作用

发布于 2024-12-16 01:43:14 字数 491 浏览 3 评论 0原文

我正在继承一个项目,该项目允许客户查看基于制造商的产品列表。产品列表是通过每个产品的制造商属性生成的,并通过标题中的下拉列表访问。这些不是 CMS 页面(有数百家制造商,因此使用 CMS 页面不切实际)。

我不确定这是否实际上在某个时候起作用并停止了,或者它是否从一开始就不起作用并且现在才被客户注意到。

无论哪种方式,当您到达“制造商”页面时,第一页都会正确显示,并且用于选择显示多少产品的下拉菜单也可以正常工作;但是,“排序依据”和分页不起作用。无论这些选项设置为何,列表始终以相同的方式显示。

我将custom-template.phtml 文件与catalog/product/list.phtml 进行了比较,它们基本上是相同的(在显示品牌徽标、标题等方面略有变化)。

我们的brands.xml 也以与category.xml 完全相同的方式加载工具栏。

此外,每个页面的 url 都正确显示为 /brand/view/id/940/?p=4。

有什么想法吗?

I'm inheriting a project that allows the customer to view a product list based on manufacturer. The product list is being generated via the Manufacturer attribute for each product and accessed via a dropdown in the header. These are NOT CMS pages (there are hundreds of manufacturers so it's not practical to use CMS pages).

I am not sure if this was actually working at some point and stopped, or if it was never working to begin with and is only now being noticed by the client.

Either way, when you arrive on the 'manufacturer' page, the first page is displayed properly, and the dropdown to choose how many products are displayed works properly; however, the 'sort by' and pagination does not work. No matter what these options are set to, the list is always displayed the same way.

I have compared the custom-template.phtml file with catalog/product/list.phtml and they are basically the same (with minor changes for displaying a brand's logo, title, etc.).

Our brands.xml is loading the toolbar in exactly the same fashion as category.xml as well.

Also, the url displays properly as /brand/view/id/940/?p=4 for each page.

Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长安忆 2024-12-23 01:43:14

本质上,我需要添加

 getCollection()->setCurPage($curPage)

Or,或者,看起来

 getCollection()->setPage($curPage,$pageSize)

做同样的事情,同时还设置每页显示的产品数量。

Essentially, I needed to add

 getCollection()->setCurPage($curPage)

Or, alternatively, it appears that

 getCollection()->setPage($curPage,$pageSize)

Does the same thing while also setting the number of products shown per page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文