Skip to content
Tutorials Center
My learning

Topics

PrestaShop Module Development Tutorial

Learn PrestaShop Module Development step by step: 30 lessons in 10 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What PrestaShop Is and How It Is Built Learn what PrestaShop is, how modules and themes differ, how the legacy ObjectModel and Symfony layers fit together, and what PrestaShop 8 and 9 change.
  2. 2 Setting Up a Development Environment Set up a local PrestaShop with Docker or a classic stack, turn on dev mode and debugging, clear caches and use the console. Includes a requirements checker.

Module Basics

  1. 3 Anatomy of a Module Learn the folder layout of a PrestaShop module, the main class, config.xml, logo, naming rules, install and uninstall, and composer autoloading with a mini loader.
  2. 4 Your First Module Build a minimal PrestaShop module step by step: constructor properties, version compatibility, display name, a hook, installing it in the back office, plus a registry stand-in.
  3. 5 A Module Configuration Page Build a settings page for a PrestaShop module with getContent(), HelperForm, Configuration::get and updateValue, validation and flash messages, with a runnable stand-in.

Hooks

  1. 6 Hooks: How Modules Plug In Understand PrestaShop hooks: display and action hooks, registerHook, hookDisplay and hookAction methods, execution order and positions, discovery, with a dispatcher you can run.
  2. 7 Common Front Office Hooks Learn the PrestaShop hooks you use most on the storefront: displayHeader, actionFrontControllerSetMedia, displayProductAdditionalInfo and displayShoppingCart.
  3. 8 Creating and Dispatching Your Own Hooks Add your own extension points to a PrestaShop module with Hook::exec: naming, registering hooks in the database, aliases, collecting results and versioning parameters.
  4. 9 Overrides vs Hooks Understand PrestaShop class and controller overrides, why they conflict between modules, and which safer alternatives (hooks, service decoration) to use instead.

Front Office

  1. 10 Module Front Controllers Build your own storefront pages and AJAX endpoints with ModuleFrontController: file layout, friendly URLs, initContent, JSON responses, redirects and tokens.
  2. 11 Smarty Templates and Theme Integration Learn Smarty basics for PrestaShop modules: assign and fetch, escaping, template resolution, theme overrides of module templates, hooks in themes and child themes.

ObjectModel and Data

  1. 12 ObjectModel and Entities Define your own database entities with PrestaShop's ObjectModel: the $definition array, field types, validation, multilingual fields, CRUD methods, Db and pSQL.
  2. 13 Tables, Installers and Upgrades Create tables when a PrestaShop module installs, ship upgrade-x.y.z.php files, handle the table prefix and clean up on uninstall, with a runnable migration stand-in.
  3. 14 Working with Products, Carts and Orders Read and change products, carts, orders, customers and addresses from a PrestaShop module: price and tax helpers, order states and safe practices, with stand-ins.

Back Office with Symfony

  1. 15 The Symfony Back Office Add modern back office pages to a PrestaShop module: Symfony controllers, routes.yml, services, admin security and the difference from legacy admin controllers.
  2. 16 Twig, Forms and Grids Build back office screens in a PrestaShop module: Twig templates, Symfony forms with data providers and handlers, and the Grid component with filters and bulk actions.

APIs and Integrations

  1. 17 The Webservice API Use the PrestaShop Webservice: enable it, create keys with permissions, query resources in XML or JSON with filters and display, and add a custom resource from a module.
  2. 18 The Admin API in PrestaShop 9 Understand the PrestaShop 9 Admin API: OAuth2 client credentials, scopes, API Platform resources and custom endpoints, with a runnable token and scope stand-in.
  3. 19 Payment Modules Build a PrestaShop payment module the right way: PaymentModule, hookPaymentOptions, PaymentOption, validateOrder, return pages and idempotent webhooks, with a runnable stand-in.

Quality and Security

  1. 20 Translations and Multilingual Modules Make a PrestaShop module speak every language: trans() domains, Smarty and Twig translation, XLIFF catalogs, multilingual fields and currency formatting, with a runnable translator.
  2. 21 Security in Modules Secure your PrestaShop modules: pSQL and casting for SQL, sanitizing input, CSRF tokens, output escaping in Smarty and Twig, safe uploads and access checks, with vulnerable-versus-safe demos.
  3. 22 Performance and Caching Keep PrestaShop modules fast: Smarty template caching with cache ids, in-request caching, avoiding N+1 queries in hooks, loading assets only where needed and profiling, with runnable query counters.
  4. 23 Testing Modules Test PrestaShop modules with PHPUnit: keep logic out of core classes, wrap Configuration and Context behind interfaces, run integration tests in Docker, and use static analysis. Includes a runnable mini test harness.

Projects

  1. 24 Project: Delivery Estimate Module Build a complete PrestaShop module that shows an estimated delivery window on the product page, with a cutoff time, business days, holidays, a config page, a template and tests.
  2. 25 Project: Wishlist Lite Module Build a small PrestaShop wishlist module: a table, an ajax front controller, customer context, a product page button and a clean uninstall, with runnable SQLite stand-ins.
  3. 26 Project: Order Export to CSV Add an Export CSV bulk action to the PrestaShop orders grid: a Symfony route, permission checks, a streamed CSV and safe cell values, with runnable stand-ins.
  4. 27 Project: A Simple Payment Gateway Module Build a redirect-style PrestaShop payment module: a payment option, redirect and return, signed webhook verification and safe order creation, with runnable stand-ins.

Practice and Review

  1. 28 Practice Exercises with Solutions Ten hands-on PrestaShop module exercises on hooks, configuration, ObjectModel, upgrades, controllers, templates and security, each with a runnable plain-PHP solution.
  2. 29 PrestaShop Interview Questions Prepare for a PrestaShop developer interview: clear answers on architecture, hooks vs overrides, ObjectModel, the Symfony migration, security and performance.
  3. 30 PrestaShop Module Cheat Sheet A quick PrestaShop module reference: skeleton, naming rules, common hooks, Configuration/Db/Tools calls, console commands, routing YAML and an upgrade checklist.