Simple. In the admin/controller/module/xxx.php file of your custom extension (could be any module, payment, shipping, total, etc), simply create a function called install() and put some additional code that needs to be executed during install of the module. For example, if your module uses its own database table or column, this is where you could programmatically add it.Hildebrando wrote:Hi:
There is a sample code or simple explanation to work with the new install/uninstall hook?
Qphforia thanx for your work!!
best,
Hilde
Example:
Code: Select all
private function install() {
$sql = "
CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "table` (
`product_id` int(11) NOT NULL default '0',
`unit_id` int(11) NOT NULL default '0',
PRIMARY KEY (`product_id`,`unit_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8";
$this->db->query($sql);
}