adampmoss / CreareSEO

A free SEO extension for Magento 1
GNU General Public License v2.0
151 stars 72 forks source link

Issue with Rel Prev/Next Links showing when no pagination is present #130

Closed josh-carter closed 5 years ago

josh-carter commented 7 years ago

Problem is that the collection loaded on the $tool variable contains all products. When filtered, the collection doesn't take the filters into consideration.

https://github.com/adampmoss/CreareSEO/blob/34bacede6c2a34b50607b032554ebd33ccff4918/app/design/frontend/base/default/template/creareseo/category/pagination.phtml#L8

Eg. You have a category of Jeans on a clothing category. Theres a couple of pages of Jeans and therefore relevant pagination. Rel next/prev links show accordingly and correctly. However, you then filter the jeans to be Blue with a certain size, so that there are only a couple of products left. A quantity which doesn't fill one page, therefore there isn't any pagination. Rel links for the next page are still showing.

Fix is to use the Block Singleton for the product list and get the loaded product collection from that Block. This collection can then be used for the toolbar block.

Pull Request to follow.