Child pages
  • Creating a PrestaShop module

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Main file: name_of_the_module.php. This PHP file should have the same name as its root folder.
  • Cache configuration file (generated by PrestaShop): config.xml.
  • View files: JavaScript, images, CSS files, template files, etc. They can be placed in folders within the module's main folder:
    • /views/templates/css folder for CSS files. If the module needs to work with PrestaShop 1.4, the CSS files should be placed in a /css folder at the root of the module's folder.
    • /views/templates/img folder for image files. If the module needs to work with PrestaShop 1.4, the CSS images files should be placed in an /img folder at the root of the module's folder.
    • /views/templates/js folder for JavaScript files. If the module needs to work with PrestaShop 1.4, the CSS JS files should be placed in a /js folder at the root of the module's folder.
    • /views/templates/admin sub-folder for files used by the module's admin controller.
    • /views/templates/front sub-folder for files used by the module's front controller.
    • /views/templates/hook sub-folder for files used by the module's hooks.
  • Module-specific controllers, all in the /controllers sub-folder.
  • Class-overriding code, all in the /override sub-folder (automatic install/uninstall using copy or merge).
  • Two icon files representing this module in the back-office.
    • One file for PrestaShop 1.4: logo.gif or logo.jpg, 16*16 pixels.
    • One file for PrestaShop 1.5: logo.png, 32*32 pixels.
  • Translation files: fr.php, en.php, es.php, etc. From v1.5 onward, all these files can be placed in the /translations sub-folder.
  • Optional: in a /themes/[theme name]/modules folder, a folder with the same name as the module, containing .tpl and language files if necessary. This last folder is essential during modifications of existing module, so that you can adapt it without having to touch its original files. Notably, it enables you to handle the module's display in various ways, according to the current theme.

...