magento getcollection get first

Solutions on MaxInterview for magento getcollection get first by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "magento getcollection get first"
Allan
05 Mar 2017
1// this gets all the products
2$productCollection = Mage::getResourceModel('catalog/products_collection');
3// this line gets just the first product
4$firstItem = $productCollection->getFirstItem();