...
There are six main aspects of PrestaShop's Module API which received a significant overhaul for version 1.5: dynamic hooks, evolution of the override system, new file-tree and operations, multishop multistore feature, Addons webservice, and the update system. We will explore these one by one.
...
/config.xml
: Automatically created by PrestaShop when the module is loaded./mymodule.php
/mymodule.jpg
: Logo file, 16*16 pixels. For versions of PrestaShop up to v1.4./mymodule.png
: Logo file, 32*32 pixels. For PrestaShop 1.5 and later./controllers/
/controllers/front/myfile.php
: As explained above./upgrade/
: Upgrade files. See Update System./translations/
/translations/fr.php
: French language file, created automatically when you start translating the module in your back-office./translations/de.php
: German (deutsch) language file, created automatically when you start translating the module in your back-office./translations/...
: ...and so on.../views/
/views/css/
: For CSS files./views/js/
: For JavaScript files./views/templates/admin
/views/templates/admin/folder_name
: For template files used by the module's admin controllers. (e.g. "sample_data
" for the "SampleData
" admin controller)/views/templates/front/
: For template files used by the module's controllers./views/templates/hooks/
: For template files directly used by the module. For backward compatibility purposes, this type of files can also be placed in the root folder of the module.
...
Multistore Feature
One of the major features of version 1.5 is the multishop multistore feature, which enable shop owners to manage more than one shop with a single installation of PrestaShop. However, this has deep implications in the code of PrestaShop, and while all modules written for v1.4 should work as-is with v1.5, most will not work as expected in the multishop multistore context.
If your 1.4 module only stores its data using Configuration::get
and Configuration::updateValue
, it should have no problem working with multiple shops.
On the other hands, if the module stores its data within its own database tables, you will have to update these tables: add a id_shop
row in the table where you will store the shop's ID when saving data.
...
install-1.8.0.php
install-1.8.1.php
install-1.8.2.php
install-1.8.3.php
If you are updating from v1version 1.8.1 to v1version 1.8.3 of the module, PrestaShop will only load the two last files, install-1.8.2.php
and install-1.8.3.php
.
...