Invalid method Mage_Catalog_Block_Product_List_Toolbar::isLastPage

Article ID #1066
Revision: 1.4
Last update: 2010-12-27

The following error message is shown in browser or logged in PHP error log or in Magento error report under var/report directory:

 

Invalid method Mage_Catalog_Block_Product_List_Toolbar::isLastPage

 

 

The error message indicates that the theme/template/module is trying to use isLastPage() function deprecated in Magento 1.4 version.

To solve the error message you can add this function yourself into app/code/core/Mage/Core/Block/Template.php file:

--- app/code/core/Mage/Core/Block/Template.php.orig
+++ app/code/core/Mage/Core/Block/Template.php
@@ -311,2 +311,8 @@
     }
+
+    public function isLastPage()
+    {
+        return $this->getCollection()->getCurPage() >= $this->getLastPageNum();
+    }
 }
Did this article help you solve your issue?


Average rating: 4 (10 votes)

completely useless 1 2 3 4 5 most valuable

Tags: ,