Jump to content

Module impossible à charger


Recommended Posts

Bonjour,

 

Je suis en cours de création d'un module. Je me suis basé sur le module existant mailalerts.

 

Je n'arrive pas à charger mon module dans prestashop, alors que les fichiers ressemblent comme deux gouttes d'eau à ceux de mailalerts.

 

J'ai défini mymodule.php :

 

 

<?php
if (!defined('_CAN_LOAD_FILES_'))
exit;

class MyModule extends Module
{
public function __construct()
{
$this->name = 'mymodule';
$this->tab = 'administration';
$this->version = '1.0';
$this->author = 'IchabOd';

parent::__construct();

$this->displayName = $this->l('My Module');
$this->description = $this->l('My description');
}

public function install()
{
if (!parent::install() OR
!$this->registerHook('customerAccount') OR
!$this->registerHook('productActions') OR
!$this->registerHook('updateProduct')
)
return false;

if (!Db::getInstance()->Execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'mymodule` (
`id_customer` int(10) unsigned NOT NULL,
`customer_email` varchar(128) NOT NULL,
`id_product` int(10) unsigned NOT NULL,
`id_product_attribute` int(10) unsigned NOT NULL,
PRIMARY KEY  (`id_customer`,`customer_email`,`id_product`,`id_product_attribute`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci')
)
return false;

/* This hook is optional */
$this->registerHook('myAccountBlock');
return true;
}

public function uninstall()
{
if (!Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'mymodule'))
return false;
return parent::uninstall();
}
}

 

et je ne le vois nulle part dans mes modules dans le B.O.

 

Idem si j'essaye de filtrer.

 

Idem si j'essaye d'ajouter le module depuis mon ordinateur, ça me dit module chargé mais pas de module.

 

Connaissez-vous une astuce qui pourrait empêcher de voir certains modules ??

 

(à part need_instance = 0)

Link to comment
Share on other sites

  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...