Jump to content

Prestashop 1.5 new module help


Recommended Posts

i am trying to make a new module in prestashop 1.5 and hook it to actionCustomerAccountAdd . but it is not working. here's my code of newstore.php file

 

<?php

 

 

if (!defined('_PS_VERSION_'))

exit;

 

 

class newstore extends Module

{

public function __construct()

{

$this->name = 'newstore';

$this->tab = 'pricing_promotion';

$this->version = '1.0';

$this->author = 'Sadi';

 

 

parent::__construct();

 

$this->displayName = $this->l('Create new store');

$this->description = $this->l('Creates new store for new customer');

$this->confirmUninstall = $this->l('Are you sure you want to delete all loyalty points and customer history?');

}

 

//Module installation-method:

public function install()

{

return (parent::install()

AND $this->registerHook('actionCustomerAccountAdd')

);

}

 

/* Hook called when a new order is created */

public function hookActionCustomerAccountAdd()

{

// insert new record

$rs = mysql_query('insert into stores(name) values("mystore")');

}

}

 

?>

 

 

whats wrong in above code?

 

thanks

Link to comment
Share on other sites

×
×
  • Create New...