A production-ready boilerplate for PrestaShop module development, supporting versions 1.7 to 9.
- Multi-version compatibility: PrestaShop 1.7, 8, and 9
- Multilingual support: Full i18n with
_langtables and translation helpers - Multi-shop ready: Shop-specific data and configurations
- PS9 Symfony architecture: Grid, Form, and Controller components (auto-enabled on PS9)
- Database migrations: Safe schema upgrades between module versions
- Admin interface: CRUD with drag-and-drop positioning, bulk actions, filters
- Security: Input validation, output escaping, CSRF protection
- Build script: One-command ZIP generation for distribution
- PHP 7.4+
- PrestaShop 1.7.0 - 9.x
- Run
./install.sh --zipto generate the module ZIP - Go to PrestaShop Back Office > Modules > Module Manager
- Click "Upload a module" and select the ZIP file
- Configure
install.shwith your PrestaShop path and Docker container name - Run
./install.shand select "Installer / Réinstaller"
.
├── install.sh # Installation & build script
├── publikomoduleboilerplate/ # Module source files
│ ├── publikomoduleboilerplate.php # Main module class
│ ├── classes/
│ │ └── BoilerplateItem.php # ObjectModel entity
│ ├── controllers/
│ │ ├── admin/ # Legacy admin controller (PS 1.7-8)
│ │ └── front/ # Front-office controllers
│ ├── config/
│ │ ├── services.yml # Symfony services (PS8 minimal)
│ │ ├── services.yml.ps9 # Full Symfony services (PS9)
│ │ └── routes.yml.ps9 # Symfony routes (PS9)
│ ├── src/
│ │ ├── Controller/Admin/ # Symfony controller (PS9)
│ │ ├── Grid/ # Grid definition & query builder
│ │ ├── Form/ # Symfony form types
│ │ └── Database/
│ │ └── MigrationManager.php # DB migration system
│ ├── sql/
│ │ ├── install.sql
│ │ ├── uninstall.sql
│ │ └── migrations/ # Version upgrade scripts
│ └── views/
│ └── templates/
│ ├── admin/ # Admin templates
│ ├── front/ # Front-office templates
│ └── hook/ # Hook templates
├── CLAUDE.md # Development guidelines
└── README.md
- Rename
publikomoduleboilerplate.phptoyourmodulename.php - Rename the class
PublikomoduleboilerplatetoYourmodulename - Replace all occurrences of:
publikomoduleboilerplate→yourmodulenamePublikoModuleBoilerplate→YourModuleNameBoilerplateItem→YourEntityboilerplate_item→your_entity
When releasing updates with schema changes:
- Create
sql/migrations/{version}.php:
<?php
return [
"ALTER TABLE `PREFIX_yourmodule_item`
ADD COLUMN IF NOT EXISTS `new_field` VARCHAR(255)",
];-
Optionally create
sql/migrations/{version}.rollback.phpfor reversibility -
Increment version in main module file - migrations run automatically on upgrade
On PrestaShop 9+, the module automatically enables:
- Symfony admin controller with Grid
- Form types with translatable fields
- Modern routing
Files services.yml.ps9 and routes.yml.ps9 are copied to active config during installation.
The install.sh script (v1.1.0) provides an interactive menu with arrow key navigation for development tasks:
chmod +x install.sh
./install.sh| Option | CLI Flag | Description |
|---|---|---|
| Installer / Réinstaller | --install |
Backup + copy files to PrestaShop + install() + clear cache |
| Désinstaller | --uninstall |
Run uninstall() + clear cache |
| Désinstaller puis Réinstaller | --reinstall |
Uninstall + backup + copy files + install + clear cache |
| Supprimer | --delete |
Uninstall + delete all files + clear cache |
| Supprimer puis Réinstaller | --reset |
Uninstall + delete + backup + fresh copy + install |
| Restaurer un backup | --restore |
Interactive backup selection + restore + clear cache |
| Vider le cache | --cache |
Clear PrestaShop cache only |
| Restart Docker | --restart |
Run docker compose down && up -d |
| Build ZIP | --zip |
Generate distribution ZIP file |
- Automatic backup before each sync operation
- Stored in
.backups/folder (project source directory) - Rotation: keeps only the 5 most recent backups
- Restore: interactive selection with arrow key navigation
Edit the top of install.sh to match your environment:
PRESTASHOP_PATH="/path/to/your/prestashop"
DOCKER_CONTAINER="your_container_name"
MODULE_NAME="yourmodulename"See CLAUDE.md for comprehensive development guidelines including:
- Coding standards and conventions
- Security best practices
- Multilingual implementation
- Hook usage (avoid overrides)
- Testing checklist
| Feature | PS 1.7 | PS 8 | PS 9 |
|---|---|---|---|
| Legacy Admin Controller | ✅ | ✅ | ✅ |
| Symfony Controller | ❌ | ❌ | ✅ |
| Grid Component | ❌ | ❌ | ✅ |
| Symfony Forms | ❌ | ❌ | ✅ |
| ObjectModel | ✅ | ✅ | ✅ |
| Hooks | ✅ | ✅ | ✅ |
| Multilingual | ✅ | ✅ | ✅ |
Commercial - Publiko