Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //$cateinstance is the instance of MagentoCatalogModelCategoryFactory
- $collection = $cateinstance->create()->load($cateid)->getProductCollection()->addAttributeToSelect('*')
- $collection->addAttributeToSort('price', 'ASC');
- $collection
- ->setPageSize(1) // only get 10 products
- ->setCurPage(1);
- $lowest_price_product = $collection->getFirstItem();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement