An open-source starting point for PrestaShop modules, released under the MIT license by Nice Code (Modules4Presta). It gives you the module skeleton, a rename script, coding-standard configs and a CI/release pipeline, so a new module starts with the boring parts already done.
Works with PrestaShop 1.7.6+, 8.x and 9.x. Requires PHP 7.2.5+.
-
Click Use this template on GitHub and create your repository.
-
Clone it and rename the module:
./scripts/rename-module.sh m4p_yourmodule
The script renames files, the main class,
config.xml,config_pl.xmland every reference in the code. Module names must be lowercase and may containa-z,0-9and_. -
Set your own name in
composer.json, in the module header and in$this->author, then replace this README. -
Copy the folder to
<prestashop>/modules/and install the module from the back office.
.
├── .github/
│ ├── ISSUE_TEMPLATE/ # bug report, feature request
│ └── workflows/ # CI + gated auto-release
├── classes/ # ObjectModel and helper classes
├── controllers/
│ ├── admin/ # back-office controllers
│ └── front/ # front-office controllers
├── mails/ # mail templates (en, pl)
├── override/ # core overrides
├── sql/ # install.php, uninstall.php
├── translations/
├── upgrade/ # upgrade-X.Y.Z.php scripts
├── views/{css,js,img,templates}
├── config.xml # module manifest (EN)
├── config_pl.xml # module manifest (PL)
└── m4pmodulestarter.php # main module file
Every directory has an index.php guard, the way PrestaShop expects.
composer install
composer phpcs # PrestaShop ruleset report
composer phpcbf # auto-fix what PHPCS can fix
composer cs-check # PHP-CS-Fixer dry run
composer cs-fix # apply PHP-CS-Fixerci.yml runs on every push and pull request: php -l on PHP 7.4 / 8.1 / 8.2, PHPCS with the
PrestaShop ruleset, PHP-CS-Fixer in dry-run mode, and a check that $this->version matches
config.xml.
release.yml starts only after CI succeeds on main. It reads $this->version, and if the tag
does not exist yet it creates vX.Y.Z, builds an installable ZIP and publishes a GitHub release.
So releasing a version means: bump $this->version and both config*.xml, merge to main.
MIT — see LICENSE. Use it commercially, fork it, rename it; just keep the copyright notice. Modules built from this starter can carry any license you choose.
Bug reports and pull requests are welcome — see CONTRIBUTING.md. For security issues, please follow SECURITY.md instead of opening a public issue.