<?php $obj = new Mage_Catalog_Block_Navigation(); $store_cats = $obj->getStoreCategories(); $current_cat = $obj->getCurrentCategory(); $current_cat = (is_object($current_cat) ? $current_cat->getName() : ''); foreach ($store_cats as $cat) { if ($cat->getName() == $current_cat) { echo '<li><a href="'.$this->getCategoryUrl($cat).'">'.$cat->getName()."</a>\n<ul>\n"; foreach ($obj->getCurrentChildCategories() as $subcat) { echo '<li><a href="'.$this->getCategoryUrl($subcat).'">'.$subcat->getName()."</a></li>\n"; } echo "</ul>\n</li>\n"; } else { echo '<li><a href="'.$this->getCategoryUrl($cat).'">'.$cat->getName()."</a></li>\n"; } } ?>
Step 1) Override the file /app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php, Inside _beforeToHtml() method, add the following code: $ this -> addTab ( 'Custom' , array ( 'label' = > Mage :: helper ( 'customer' ) -> __ ( 'Custom' ) , 'class' = > 'ajax' , 'url' = > $ this -> getUrl ( '*/*/custom' , array ( '_current' = > true ) ) , ) ) ; Step 2) Override the file /app/code/core/Mage/Adminhtml/controllers/CustomerController.php, Add the following code: public function customAction() { $this->_initCustomer(); $this->getResponse()->setBody( Mage::app()->getLayout()->createBlock('core/template')->setTemplate('custom/customer/tab/custom.phtml')->setCustomerId(Mage::registry('current_customer')->getId()) ->setUseAjax(true)-...
Comments
Post a Comment