I want to insert tracking codes on all of the pages of a Magento site, and need to use a different syntax if the page is a CMS page, a category browsing page, or a product v
The easest answer is the following:
getRequest()->getControllerName();
if($this->getRequest()->getControllerName()=='product') //do something
if($this->getRequest()->getControllerName()=='category') //do others
?>
this is 100% the right way to do according to the MVC model, please look into the core code really understand it, and do not give the method with loading or depends on the registry method. Support mytraining.net even though I am not there.