The sort by price function no longer produces a properly “paged” layout.
The official Magento demo store exhibits the same behaviour as can be seen at this link: http://demo.magentocommerce.com/bed-and-bath/living-room?order=price&dir;=asc
The sorting itself works but notice how it only says “1 item” on the top left. In my case it no longer pagenates my list of products.
I’m very new to this Magento thing, so take this all with a grain of salt. I quickly ran across this sorting bug. There seems to be a quick fix, although it did require changing the Magento core, so there could be consequences now or with an upgrade.
In this class Mage_Catalog_Block_Product_List aka \app\code\core\Mage\Catalog\Block\Product\List.php I’ve changed this:
if ($sortField = $this->getSortBy()) { $sortOrder = 'asc'; if (strtolower($this->getSortOrder()) == 'desc') {
to this:
$toolbar = $this->getToolbarBlock(); if ($sortField = $toolbar->getCurrentOrder()) { $sortOrder = 'asc'; if (strtolower($toolbar->getCurrentDirection()) == 'desc') {
Obviously this solution is not well tested, but it’s worked for me so far…
Hi, there is a way to implement the bugfix without compromising future updates : create you own module , example below
I now have one question for magento gurus : the subclass below works fine but the add to cart button returned from the product collection is now in english instead of french (default language). Why is this language information lost ?
1.
create a new class here, with the new _getProductCollection function
app\code\local\PoleOuest\Catalog\Block\Product\List.php
class PoleOuest_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
2. declare the new class app\code\local\PoleOuest\Catalog\etc\config.xml
Can anyone advise a fix? I would rather not have to
upgrade as the rest of the site is working as expected
and an upgrade is sure to break something else.
It may sound strange but while trying to debug this problem over 1.2.0.2 I add call to getSize() to the end of _getProductCollection() function in code\core\Mage\Catalog\Block\Product\List.php and the problem was solved!
Just changed in code from