Magento Functions

       To Get controller, action, module, route information

1  >  Get controller name

Mage::app()->getRequest()->getControllerName();

2 >  Get action name

Mage::app()->getRequest()->getActionName();

3 > Get route name

Mage::app()->getRequest()->getRouteName();

4 > Get module name

Mage::app()->getRequest()->getModuleName();

       Other functions

1 > Get the path of your magento page

 $this->getUrl('mypage')

2 > . Get Image url of current category

 $this->getCurrentCategory()->getImageUrl();

3 >  Check whether the current category is Top category

 $this->IsTopCategory();

4 >  Get description of current category.

$this->getCurrentCategory()->getDescription();

5 >  Get current store id.

    $storeId = Mage::app()->getStore()->getId();

6> Get current store name.

    $storeName = Mage::app()->getStore()->getName();

7 > Get current store code.

     $storeCode = Mage::app()->getStore()->getCode();

8 > Get website name.

     $websiteName = Mage::app()->getWebsite()->getName();

9 >  Get session id.

     $sessionId = Mage::getModel('core/session')->getSessionId();

10 > Get customer id.

$customerId = Mage::getModel('customer/session')->getCustomerId();

11 >  Get guest id.

         $vistitorId = Mage::getModel('core/session')->getVisitorId();
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s