Module demoproductform
About
This module demonstrates various ways to extend the product page form in the Back Office (PrestaShop 9.0.0+).
What it adds to the product form
Description tab
- A Demo custom field text input added after the built-in description field.
Customization tab (new tab inserted after Pricing)
- A My custom price money field stored alongside the product.
Custom tab content tab (inserted after the Customization tab)
- A second custom tab demonstrating how to add another tab using a separate form type.
Footer
- An Open supplier website link button added to the product form footer.
Modules tab (displayAdminProductsExtra hook)
- Renders a Twig template showing the stored custom product data -- demonstrates using
displayAdminProductsExtrato add read-only information to the dedicated Modules tab.
What it adds to the combination form
When a product has combinations, the module also extends the combination edit form:
- A Demo custom field text input added after the References section.
- A Customization tab with a My custom price money field, inserted after the Price impact section.
Key patterns demonstrated
actionProductFormBuilderModifier-- modifying the product form structure usingFormBuilderModifier(adding fields and full tabs).actionCombinationFormFormBuilderModifier-- same pattern applied to the combination form.ProductCommandsBuilderInterface-- usingCustomProductCommandsBuilder(tagged ascore.product_command_builder) to dispatch a CQRS command when the product form is saved. This is the recommended approach specific to the product page.actionAfterUpdateCombinationFormFormHandler-- saving combination custom data via an identifiable object hook.- Dedicated ObjectModel entities --
CustomProductandCustomCombinationpersist data in their own tables (demoproductform_custom_product,demoproductform_custom_combination) without touching core tables. - Modern translation system -- using
isUsingNewTranslationSystem().
Supported PrestaShop versions
Compatible with 9.0.0 and above versions.
Requirements
- Composer, see Composer to learn more
How to install
- Download or clone module into
modulesdirectory of your PrestaShop installation - Rename the directory to make sure that module directory is named
demoproductform* cdinto module's directory and run following commands:composer install- to download dependencies into vendor folder
- Install module:
- from Back Office in Module Manager
- using the command
php ./bin/console prestashop:module install demoproductform
* Because the name of the directory and the name of the main module file must match.