<?php
class createConnection //create a class for make connection
{
var $host="localhost";
var $username="username"; // specify the sever details for mysql
Var $password="password";
var $database="database name";
var $myconn;
function connectToDatabase() // create a function for connect database
{
$conn= mysql_connect($this->host,$this->username,$this->password);
if(!$conn)// testing the connection
{
die ("Cannot connect to the database");
}
else
{
$this->myconn = $conn;
echo "Connection established";
}
return $this->myconn;
}
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