...
- "Bootstrap" file:
name_of_the_module.php
- Cache configuration file:
config.xml
- 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) - View files: JavaScript, Models, CSS files, etc. From v1.5 onward, these files can be placed in sub-folders:
/views/css
sub-folder for CSS files/views/js
sub-folder for JavaScript files/views/templates/front
sub-folder for files used by the module controller/views/templates/hooks
sub-folder for files used by the module's hooks
- 16x16 module logo:
name_of_the_module.jpg
(JPG format) - 32x32 module logo:
name_of_the_module.png
(PNG format) - Translation files:
fr.php
,en.php
,es.php
, etc. From v1.5 onward, all these files can be placed in the/translations
sub-folder.
Creating a first module
Let's create a simple first module; this will enable us to better describe its structure. We will call it "My module".
...
- 'name' attribute. This attributes serves as an internal identifier, so try your best to make it unique, without special characters or spaces, and keep it lower-case. In effect, the value MUST be the name of the module's folder.
- 'tab' attribute. The title for the section that shall contain this module in PrestaShop's back-office modules list. You may use an existing name, such as
seo
,front_office_features
oranalytics_stats
, or a custom one. In this last case, a new section will be created with your identifier. We chose "front_office_features
" because this first module will mostly have an impact on the front-end.Here is the list of available "Tab" attributes, and their corresponding section in the "Modules" page:
"Tab" attribute Module section administration
Administration advertising_marketing
Advertising & Marketing analytics_stats
Analytics & Stats billing_invoicing
Billing & Invoices checkout
Checkout content_management
Content Management emailing
E-mailing export
Export front_office_features
Front Office Features i18n_localization
I18n & Localization market_place
Market Place merchandizing
Merchandizing migration_tools
Migration Tools mobile
Mobile others
Other Modules payments_gateways
Payments & Gateways payment_security
Payment Security pricing_promotion
Pricing & Promotion quick_bulk_update
Quick / Bulk update search_filter
Search & Filter seo
SEO shipping_logistics
Shipping & Logistics slideshows
Slideshows smart_shopping
Smart Shopping social_networks
Social Networks - 'version' attribute. The version number for the module, displayed in the modules list. It is a string, so that you may use such variation as "1.0b", "3.07 beta 3" or "0.94 (not for production use)".
- 'author' attribute. This is displayed as is in the PrestaShop modules list.
...