# Module Basics

# Getting Started

In this guide, we follow PrestaShop's Chapter 4 - PrestaShop modules / Getting started (opens new window) steps to create the module structure.

The Hello PrestaShop Products Module is based on the Friends of Presta/products (opens new window) module. It demonstrates all the available customizations in product pages (i.e., adding a new "alternative description" field in the catalog), thanks to Friends of Presta/Mickaël Andrieu (opens new window).

The source code of the module can be found in this repository: https://github.com/PHP-Prefixer/hello-prestashop-world (opens new window)

# The Composer Schema of the PrestaShop Module

In this version of the Hello PrestaShop Products module, the module adds a new "alternative description" field in the catalog. In the process, the module uses the tightenco/collect (opens new window) library to integrate the Illuminate Collections library.

The module has the following composer.json to declare the project, the tightenco/collect library, and the prefixer service configuration:

    "name": "php-prefixer/hello-prestashop-products",
    "description": "Hello PrestaShop Products module. A module to showcase the PHP-Prefixer service. Install any library freely. PHP-Prefixer will manage your namespaces.",
    "type": "prestashop-module",
    "license": "MIT",
    "require": {
        "php": "^7.1",
        "tightenco/collect": "^5.6"
    "autoload": {
        "psr-4": {
            "PsProducts\\": "src/"
        "exclude-from-classmap": []
    "config": {
        "preferred-install": "dist"
    "extra": {
        "php-prefixer": {
            "project-name": "Hello PrestaShop Products",
            "namespaces-prefix":: "PPP",
            "global-scope-prefix": "PPP_",

            "exclude-paths": [

In particular, this schema has the attribute excludePaths to help package the module for distribution. The excludePaths remove folders that should not be included in the target prefixed module (commands, unit tests, library documentation, etc.).

The prefixed project ZIP file will be installed on PrestaShop once it is processed and available for download.

::: Tip NOTE: Remember that the module name is helloprestashopproducts. The ZIP to be installed on PrestaShop should contain a folder helloprestashopproducts. Please, prepare the installation ZIP file. Alternatively, you can manually create helloprestashopproducts folder inside the modules folder of the site and copy all the module files into the folder. :::