You set url for this tab as <url>customer/newtab/</url>
so, you should have controller of newtab
somewhere,
First you need to add
<routers>
part in your module's config.xml, put this in<frontend>
.<routers> <customtabs> <use>standard</use> <args> <module>Fishpig_Customtabs</module> <frontName>customtabs</frontName> </args> </customtabs> </routers>
change
<url>customer/newtab/</url>
to<url>customtabs/newtab</url>
in customtabs.xml file. also put,<customtabs_newtab_index> <update handle="customer_account"/> <reference name="my.account.wrapper"> <block type="customer/newtab_newtab" name="customer_newtab_newtab" template="customer/newtab/newtab.phtml"/> </reference> </customtabs_newtab_index>
create a controller at code/local/Fishpig/Customtabs/controllers/NewtabController.php
in that your code should be
class Fishpig_Customtabs_NewtabController extends Mage_Core_Controller_Front_Action { public function indexAction() { if(!Mage::getSingleton('customer/session')->isLoggedIn()) { Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('customer/account')); return false; } $this->loadLayout(); $this->_initLayoutMessages('customer/session'); $this->getLayout()->getBlock('head')->setTitle($this->__('My Special Products')); $this->renderLayout(); } }
Add a block file as app/code/local/Fishpig/Customtabs/Block/Customtabs.php
and put there code,
class Fishpig_Customtabs_Block_Customtabs extends Mage_Core_Block_Template
{
public function _prepareLayout()
{
return parent::_prepareLayout();
}
public function getCustomtabs()
{
if (!$this->hasData('customtabs')) {
$this->setData('customtabs', Mage::registry('customtabs'));
}
return $this->getData('customtabs');
}
}
and change your block type in your customtabs.xml file
<block type="customtabs/customtabs" name="customer_newtab_newtab" template="customer/newtab/newtab.phtml" />