case study · PrestaShop module

Product features the customer sees only when they should

A module for PrestaShop 8 and 9 that hides selected features or individual values on the storefront. The data stays untouched in the database and in the admin panel.

Platform
PrestaShop 8.2 · 9.2
Scope
Environment, module, tests
Module
hidefeatures 1.0.0
Integration
1 front hook, 0 core overrides

01 / brief

Features as internal and public data at the same time

Stores often keep internal information in product features: a warehouse code, the wholesale supplier, the country of origin before negotiations. PrestaShop can't hide them: every feature assigned to a product ends up on the product page. Deleting the feature destroys data used by import, export, filters and integrations.

  1. 01Hide selected features in the store

    Visibility rules managed in Catalog › Feature visibility, with a list, filters and bulk actions.

  2. 02Hide whole features or single values

    A rule covers the whole feature or one value, e.g. only “Steel” within Material. Custom per-product values are hidden in the product editor.

  3. 03Managed from the admin panel

    A dedicated tab in the Catalog menu and Inherit / Hide / Show toggles in every product's editor, saved instantly.

  4. 04Globally, per category and per product

    Three scopes, categories with or without subcategories. A “Show” rule works as an exception to a more general rule.

  5. 05Hidden features stay in the database and admin

    The module deletes nothing. It only filters data passed to storefront templates.

  6. 06No side effects on other features

    No core class overrides. Search filters, import, export and the API work on full data. Rules clean themselves up when a product, category or feature is deleted.

  7. 07Compatible with PrestaShop 8 and 9

    The same code verified on 8.2.9 (Classic) and 9.2.1 (Hummingbird), running side by side.

02 / metrics

Numbers from running test stores

2
PrestaShop versions 8.2.9 and 9.2.1, two different themes, one module codebase
0
core overrides integration through a single front hook, no override
~3.5ms
overhead on the product page with 6 active rules, median of 3 × 40 requests
42/42
admin tests 21 automated checks per store version
12
rule types 3 scopes × feature or value × hide or show
1
rules query per request, then an in-process cache
75
translated strings English sources, full Polish translation in XLF
~1,200
lines of code PHP, Smarty, JS and CSS, no external dependencies
module disabledmodule enabled, 6 rulesPHP page generation time, without network and TLS
PS 9 · product page75.0
78.3 ms
PS 9 · category71.6
75.7 ms
PS 8 · product page48.3
52.2 ms
PS 8 · category60.9
58.9 ms

Scale: full width = 100 ms. The PS 8 listing result is within measurement noise (the run with the module came out faster).

03 / storefront result

Same T-shirt, same data, different product page

A demo product with internal features added. Two global rules hide the warehouse code and the wholesale supplier. Warranty and country of origin stay, because no rule covers them in this category.

PrestaShop 9.2.1 Hummingbird theme, “Technical data” accordion

PrestaShop 9 product page before: six features, including the warehouse code and wholesale supplier
Before6 features, including the warehouse code and wholesale supplier.
PrestaShop 9 product page after: four features, no internal data
After4 features. Internal data never reaches the page HTML.

PrestaShop 8.2.9 Classic theme, “Product details” tab

PrestaShop 8 product page before: feature list including the warehouse code
BeforeThe same set of features in the older theme.
PrestaShop 8 product page after: feature list without internal data
AfterIdentical result with no changes to the theme templates.

04 / solution

The most specific rule wins

Rule resolution order A product rule beats a category rule, which beats a global rule. Within a scope, a rule for a value beats a rule for the whole feature. general specific Product feature value · priority 7 whole feature · priority 6 e.g. Show Warehouse code on Laptop Pro 16 Category feature value · priority 5 whole feature · priority 4 e.g. Hide Material: Steel in Furniture + subcat. Global feature value · priority 3 whole feature · priority 2 e.g. Hide Warehouse code across the store

One rule per decision

For each feature–value pair the module picks the highest-ranked matching rule. On a tie, e.g. two product categories with opposite actions, hiding wins. The admin shows next to every feature which rule decided it.

A filter where every product passes through

The actionGetProductPropertiesAfter hook covers the product page, listings, quick view and product modules. In PS 8 the feature list is already there. In PS 9 features load lazily, so the module injects a ready, filtered list that ProductLazyArray also uses to build grouped_features.

Admin and data unchanged

The filter only runs in the front-office context. Product editing, import, export, the API and ps_facetedsearch see full data, so hiding a feature doesn't break filtering or integrations.

05 / admin panel

Rules in one place, exceptions where you edit the product

The admin is in Polish, as delivered to the client. Click a screenshot to enlarge it.

admin / catalog / feature visibility
List of feature visibility rules in the admin: feature, value, scope, target, action and status
Catalog › Feature visibility. A list with filtering, sorting and bulk actions. The “Applies to” column shows the product or category and whether the rule covers subcategories.
Rule form: feature, value, scope, category tree, action
Rule form. The value list updates after choosing a feature, and target fields after choosing a scope. Validation rejects duplicates and values outside the chosen feature.
Module tab in the product editor: every feature with its storefront status and a rule toggle
Product editor › Modules. All product features with their storefront status and the reason, e.g. “rule #3: Electronics category”. The toggle saves instantly via AJAX.

06 / delivery

From an empty server to a tested module

  1. Environment

    Two stores in Docker on a VPS: PrestaShop 9.2.1 on PHP 8.4 and PrestaShop 8.2.9 on PHP 8.1, sharing a MariaDB 11.4 database on an internal network. HTTPS and subdomains via Caddy. The module code is mounted into both stores at once, so every change works in both versions immediately.

  2. Test data

    A script creating 5 categories with subcategories, 8 bilingual features and 12 products with single- and multi-value features plus custom values. The same IDs in both stores, so results compare one to one.

  3. Core analysis

    Before writing code: a review of how PS 8 and PS 9 build the feature list. The key difference is lazy feature loading in PS 9. The common point turned out to be a hook fired for every displayed product.

  4. Testing

    Storefront scenarios checked against page HTML in both stores: global rule, category with subcategories, product exception, hiding a single value. In the admin, 21 automated checks per version: rendering of the list, form and tab, validation, saving, clean-up after deleting a feature. Plus a clean module reinstall and a performance benchmark.

  5. Post-acceptance fixes

    The “Expand all” button in the category tree lost branches. The cause was a bug in PrestaShop's core tree script that affects every single-select tree. The module form now receives the whole tree up front, so expanding works without a server round-trip.

stack

  • PHP 8.1–8.4
  • PrestaShop 8 / 9
  • ObjectModel
  • ModuleAdminController
  • HelperForm · HelperList
  • Smarty
  • Vanilla JS
  • XLIFF
  • MariaDB 11.4
  • Docker Compose
  • Caddy
  • Playwright

Storefront screenshots come from running test installations. Admin views are the real module code rendered with the original PrestaShop 9 admin stylesheets, without the admin navigation frame. Timings were measured inside the application container, without network and TLS.

next step

Facing a similar challenge?

Tell me what you want to achieve. I'll come back with a concrete proposal, a quote and a delivery plan.