Pour créer un module dans Prestashop, il faut respecter une certaine arboréscence. Premierement il faut créer un répertoire qui porte le nom du module ex : »MonModule »
- Répertoire
- controllers
- override
- themes
- translations
- upgrade
- views
- Fichier
- monModule
- logo.png
myModule.php
<?php
if (!defined('_PS_VERSION_'))
exit;
class localaddict_marketplace extends Module {
public function _-_construct() {
$this->name = 'localaddict_marketplace';
$this->tab = 'back_office_features';
$this->version = '0.0.1';
$this->author = 'Benoit MOTTIN';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Localaddict Marketplace');
$this->description = $this->l('Ajout de fonctionnalité pour le multivendeur');
$this->confirmUninstall = $this->l('Are you sure you want to uninstall?');
if (!Configuration::get('MYMODULE_NAME')) {
$this->warning = $this->l('No name provided');
}
}
Ceci est le strict minimum pour la déclaration d’un module.