Prestashop - 1.4 User's Guide Page 15

  • Download
  • Add to my manuals
  • Print
  • Page
    / 36
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 14
public function install()
{
return ( parent::install() );
}
In this first and extremely simplistic incarnation, this method is useless,
since all it does is check the value returned by the Module class' install()
method. Moreover, if we hadn't created that method, the superclass'
method would have been called instead anyway, making the end result
identical.
Nevertheless, we must mention this method, because it will be very useful
once we have to perform checks and actions during the module's
installation process: creating SQL tables, copying files, creation
configuration variables, etc.
Likewise, the module should contain an uninstall() method, so as to have
a custom uninstallation process. This method could look as such:
public function uninstall()
{
if ( !parent::uninstall() )
Db::getInstance()->Execute( 'DELETE FROM `' . _DB_PREFIX_ . 'mymodule`'
);
parent::uninstall();
}
To put the finishing touch to this basic module, we can add an icon, which
will be displayed next to the module's name in the back-office modules
list.
The icon file must respect these requirements:
16*16 image.
named logo.gif.
placed on the module's main folder.
You can find an excellent set of free icons to pick from on the FamFamFam
website.
Now that all basics are in place, put the module's folder in the /modules
folder of your PrestaShop test install, open PrestaShop, and in the
"Modules" tab, under "Other Modules", you should find your module.
Install it in order to be able to manage it for the rest of this guide.
Page view 14
1 2 ... 10 11 12 13 14 15 16 17 18 19 20 ... 35 36

Comments to this Manuals

No comments