prestashop
PrestaShop Module Development
Overview
PrestaShop is an open-source PHP e-commerce platform that has undergone significant architectural evolution. PrestaShop 1.7+ introduced Symfony components for the back office, and PrestaShop 8.x completed the transition to a Symfony-first architecture for all admin pages. Modules remain the primary extension mechanism, built as self-contained PHP packages that integrate through a powerful hook system, ObjectModel ORM (legacy), Doctrine ORM (modern), and Symfony service containers.
A PrestaShop module is a directory inside /modules/ containing at minimum a main PHP class file and a config.xml descriptor. The main class extends Module and implements install(), uninstall(), and hook callback methods. Modules can add admin pages, modify the storefront, extend the checkout, integrate payment gateways, add shipping carriers, and interact with the PrestaShop webservices API.
PrestaShop 8.x runs on PHP 7.2.5+ (PHP 8.1 recommended), Symfony 4.4, and supports MySQL 5.6+ or MariaDB 10.x. The template engine is Smarty for the front office and Twig for the back office (Symfony controllers). Understanding both rendering engines is essential for full-stack module development.
For detailed directory structure, module lifecycle, ObjectModel, and Doctrine entity patterns, see references/module-architecture.md.
Module Structure
Every module follows a predictable directory layout. The module name must match the directory name and the main class name, using lowercase alphanumeric characters and underscores only.
Main Module File
The main file (mymodule.php) defines a class extending Module. The constructor sets metadata: