Posts

Showing posts from April, 2016

How to get protected property of object in Magento (PHP)

2016-04-25T06:52:32+00:00 ALERT (1): Mage_Sales_Model_Order Object (     [_eventPrefix:protected] => sales_order     [_eventObject:protected] => order     [_addresses:protected] =>     [_items:protected] =>     [_payments:protected] =>     [_statusHistory:protected] =>     [_invoices:protected] =>     [_tracks:protected] =>     [_shipments:protected] =>     [_creditmemos:protected] =>     [_relatedObjects:protected] => Array         (         )     [_orderCurrency:protected] =>     [_baseCurrency:protected] =>     [_actionFlag:protected] => Array         (         )   ...

To find the layout name in Magento

<?php    $oRequest        = Mage::app()->getRequest();     $sModuleName     = $oRequest->getModuleName();     $sControllerName = $oRequest->getControllerName();     $sAtionName      = $oRequest->getActionName();     echo 'Current Page Layout Name:<br/>';     echo '"'.$sModuleName.'_'.$sControllerName.'_'.$sAtionName.'"';    ?> Now you can use the call the layout name on your xml file <?xml version="1.0"?>     <layout version="0.1.0">      <catalog_product_view>         <reference name="content">              ....yourcode.....          </reference>     </catalog_product_view>  ...