questions

2 Answers

DEFAULT NUMBER OF PRODUCTS TO APPEAR ON A CUSTOMERS BROWSER PAGE

Asked by: paul dodsworth 1706 views Questions

Within Magento Admin how do you set the number of products (in our case ‘cartoons’) to appear on a browser page – It currently defaults to 30 on our site ; www.businesscartoonshop.com The other options for the customer to change it to are 9, 15, 30 or ALL. We want to set the default to ’15′.

 

Thanks

2 Answers



  1. Magento Expert on Feb 15, 2013

    Extend the class Mage_Catalog_Block_Product_List and override the function _getProductCollection() .
    app\code\core\Mage\Catalog\Block\Product\List.php

    Use the code below:

    // only retrieve 15 products
    $this->_productCollection = Mage::getModel(‘catalog/product’)->getCollection()
    ->addAttributeToSort(‘entity_id’, ‘desc’)
    ->addStoreFilter()
    ->setPage(0, 15);

    Good luck!

    +4 Votes Thumb up 4 Votes Thumb down 0 Votes


Answer Question