Skip to content

Instantly share code, notes, and snippets.

@devjosh12
Created February 16, 2015 19:25
Show Gist options
  • Save devjosh12/c5d5bffa8e0ea1471c89 to your computer and use it in GitHub Desktop.
Save devjosh12/c5d5bffa8e0ea1471c89 to your computer and use it in GitHub Desktop.
load products with ajax by catid
$catid=Mage::registry('category_id');
$pageno = Mage::registry('page_no');
$catagory_model = Mage::getModel('catalog/category')->load($catid);
$_productCollection = Mage::getResourceModel('catalog/product_collection');
$_productCollection->addCategoryFilter($catagory_model);
$_productCollection->addAttributeToSelect('*');
$_productCollection->addAttributeToSelect('name');
$_productCollection->setPage($pageno, 3);
$_productCollection->load();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment