Technical article · Adanora

PrestaShop shops: child theme, custom module and versioning

Published on , updated on

Two PrestaShop shops make up this project: the first, which sells a monthly box by subscription, is in service; the second, an online grocery, was not published.

Role
Sole author
Period
June and September 2025
Status
In service. One shop in service, a second stopped before publication
Technologies
PrestaShop 8, PHP, MySQL, Docker Compose
Repositories
Two
Child theme and module of the shopThe child theme inherits from PrestaShop's Classic theme, a few of whose templates it overrides, and declares a custom module that displays the subscription plans on the home page.Classic themeprovided, unchangedChild themeoverridden templatesstyles and fontsModulesubscriptionplansinherited bydeclares
Figure 1. What was written for the shop in service: a child theme and a module, with no modification of the PrestaShop core.

Context

These are two modest pieces of work: a standard PrestaShop, a child theme and a small module for each. The first shop presents three subscription plans for a monthly box. The second was to offer a grocery catalogue divided into three families, and its development stopped after two days.

The shop in service is Adanora (opens in a new tab); the name of the second one does not appear in this article.

Home page of adanora.ch: the menu of boxes on a green band, then a photograph of a towel, a bottle and a candle with the motto “Le beau et le bon, réunis dans un même geste”.
Figure 2. Home page of Adanora, the shop in service.

Problem

PrestaShop updates itself by replacing its files, so that any modification made to the core or to the provided theme is lost at the next update. The home page of the first shop also required a block that no standard module provides, namely three variants of one product presented as three plans. Finally, it had to be decided what gets versioned when the repository contains the entire tree of a CMS.

Answer

A child theme, no modification of the core

The child theme inherits the assets of the Classic theme and copies only the templates it modifies: the header, the footer, the product page, the product list and a few blocks of the home page. The templates of the modules are overridden from the theme’s directory, so that an update of a module does not erase them.

A module where the theme was not enough

The plans block is a module of about a hundred lines, which queries the database to obtain the three variants of the product and passes them to a template, which the theme in turn overrides to present them as three cards. The theme declares this module as a dependency, so that it is installed with it.

Knowing what to version

The first shop began by versioning the entire tree, that is more than thirty thousand files added in one commit, which then had to be removed by listing one by one the core directories to ignore. The second starts from the opposite rule: ignore everything, then bring back the themes and the module. This rule is safer, since a directory added by an update stays ignored, but getting it right still took four commits.

All the articlesSee the project