Jump to content

[solved] First prestashop module mymodule, shows error


Recommended Posts

Hi

I am trying to develop a module "mymodule" from the prestashop developer guide tutorial.The code is below:( /modules/mymodule/mymodule.php)

 

<?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 = 'Nitish D';

$this->need_instance = 0;

 

parent::__construct();

 

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

$this->description = $this->l('Demo Decription');

 

public function install()

{

if(parent::install == false)

return false;

return true;

}

 

public function uninstall()

{

if(!parent::uninstall())

Db::getInstance->Execute('DELETE FROM ''._DB_PREFIX_.'mymodule'');

parent::uninstall();

}

}

}

 

?>

 

But it shows

 

The following module(s) could not be loaded:

  1. mymodule (parse error in /modules/mymodule/mymodule.php)
  2. mymodule (class missing in /modules/mymodule/mymodule.php

when I open modules from admin panel. I even converted the file to ASCII ( following the question http://www.prestasho...-class-missing/) but it still shows the error.

Link to comment
Share on other sites

  • 2 years later...
×
×
  • Create New...