php - Add Pagination To Custom Magento catalog -
i have code, , need add pagination code.
function __construct() { $category = mage::getmodel('catalog/category'); $products = mage::getresourcemodel('catalog/product_collection') ->addattributetoselect('name') ->addattributetoselect('price') ->addfinalprice() ->addattributetoselect('small_image') ->addattributetoselect('image') ->addattributetoselect('thumbnail') ->addurlrewrite() ->addcategoryfilter($category); mage::getsingleton('catalog/product_visibility')->addvisibleincatalogfiltertocollection($products); $currencycode = mage::app()->getstore()->getbasecurrencycode(); foreach($products $product){ echo $product->getid()."<br>"; echo $product->getname()."<br>"; echo mage::helper('core')->currency($product->getprice(), true, false)."<br>"; //." ".$currencycode, echo $product->getproducturl()."<br>"; echo "<img src='".(string)mage::helper('catalog/image')->init($product, 'thumbnail')."' alt='product'><br><hr>"; } }
how can add pagination ? )
Comments
Post a Comment