0

I am working on a Magento theme, so in the product list page I have featured products block and below it a normal product listing with pagination, however what I need, that's when the user click on the page2 in the pager I want to remove the featured block and also I want to increase the default page size of the pager result.

0

Create module with observer to solve this issue, update your catalog.xml (override the original one, don't edit the original one) this is a handle

<catalog_category_pager>
    <remove name="featured"/>
</catalog_category_pager>  

observer function

public function hideFeatured(Varien_Event_Observer $observer) {
    $controller = $observer->getEvent()->getControllerAction();
    $request = $controller->getRequest();
    $pagerPage = $request->getParam('p');
    $update = Mage::getSingleton('core/layout')->getUpdate();
    //Also we may check for order and sort variables in order to hide the block also 
    if($pagerPage > 1){
       $update->addHandle('catalog_category_pager');
    }    
}

config.xml of your module Yourmodule_Pager_Model_Observer hideFeatured

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.