Create prestashop 1.5 module

I created a new module in PrestaShop 1.5 mau file mymodule.php content

  <?php if (!defined('_PS_VERSION_'))  exit; class myModule extends Module  {  public function __construct()    {    $this->name = 'mymodule';    $this->tab = 'Test';    $this->version = 1.0;    $this->author = 'Firstname Lastname';    $this->need_instance = 0;    parent::__construct();    $this->displayName = $this->l('My module');    $this->description = $this->l('Description of my module.');    }  public function install()    {    if (parent::install() == false)      return false;    return true;    } public function uninstall() { if (!parent::uninstall()) parent::uninstall(); }  } ?> 

But I have a msg error

mymodule (erreur de syntaxe dans / modules / mymodule / mymodule.php) mymodule (classe manquante dans / modules / mymodule / mymodule.php)

Can you help me?

+4
source share
4 answers

This problem is solved when changing the page encoding (Encode in UTF-8 without specification).

+2
source

Are you creating a config.xml file for this module? and one more thing ... no The Test tab is pre-ordered. change this to a valid tab attribute. http://doc.prestashop.com/display/PS15/Creating+a+PrestaShop+module this link can help you.

+1
source

This error often appears when there is only a syntax error in your class file. Prestashop cannot load the class file and therefore cannot load the module

You can try running php -l mymodule.php on the command line to detect a possible syntax error in the php file

0
source

I would choose the class name in the same way as the module name.

  class mymodule(){ 

not myModule

Also you wrote

  if (!parent::uninstall()) parent::uninstall(); 

meaning, if there are errors when deleting that you don’t delete by force? I think better

  if(parent::uninstall()) return false; return true; 
0
source

All Articles