Magento - How to find if you are on homepage - getIsHomePage

Posted by Damodar Bashyal on July 31, 2012

 

Today I needed to exclude hot products and recently viewed products block from homepage, so I needed to find if the current page is homepage. The first block of code worked on header.phtml template but not in main page template, so I ended up using 2nd option.

If you need to check this on header.phtml template then use this code:

More»

QR Code: Magento - How to find if you are on homepage - getIsHomePage