YOu want to know if you are on either the product or category page? The following code might help:
|
1 2 3 4 5 |
$controllerName = $this->getRequest()->getControllerName(); $isCategoryPage = $controllerName == 'category' ? true : false; $isProductPage = $controllerName == 'product' ? true : false; if(...) |
How to know if you are on the product or category page
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.