Child pages
  • Creating a first module

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

At this stage, if you place the module's folder on the /modules folder, the module can already be seen in the "Modules" page in the back - office, in the "Other modules" section – albeit with no real name nor thumbnail.

...

  • 'name' attribute. This attributes serves as an internal identifier. The value MUST be the name of the module's folder. Do not use special characters or spaces, and keep it lower-case.
  • 'tab' attribute. The title for the section that shall contain this module in PrestaShop's back - office modules list. You may use an existing name, such as seo, front_office_features or analytics_stats, or a custom one. In this last case, a new section will be created with your identifier. We chose "front_office_features" because this first module will mostly have an impact on the front-end.

    Here is the list of available "Tab" attributes, and their corresponding section in the "Modules" page:

    "Tab" attributeModule section
    administrationAdministration
    advertising_marketingAdvertising & Marketing
    analytics_statsAnalytics & Stats
    billing_invoicingBilling & Invoices
    checkoutCheckout
    content_managementContent Management
    dashboardDashboard
    emailingE-mailing
    exportExport
    front_office_featuresFront Office Features
    i18n_localizationI18n & Localization
    market_placeMarket Place
    merchandizingMerchandizing
    migration_toolsMigration Tools
    mobileMobile
    othersOther Modules
    payments_gatewaysPayments & Gateways
    payment_securityPayment Security
    pricing_promotionPricing & Promotion
    quick_bulk_updateQuick / Bulk update
    search_filterSearch & Filter
    seoSEO
    shipping_logisticsShipping & Logistics
    slideshowsSlideshows
    smart_shoppingSmart Shopping
    social_networksSocial Networks
  • 'version' attribute. The version number for the module, displayed in the modules list. It is a string, so that you may use such variation as "1.0b", "3.07 beta 3" or "0.94 (not for production use)".
  • 'author' attribute. This is displayed as-is in the PrestaShop modules list.

...

  • A name for the module, which will be displayed in the back - office's modules list.
  • A description for the module, which will be displayed in the back - office's modules list.
  • A message, asking the administrator if he really does want to uninstall the module. To be used in the installation code.
  • A warning that the module doesn't have its MYMODULE_NAME database value set yet (this last point being specific to our example, as we will see later).

The constructor method is now complete. You are free to add more to it later if necessary, but this the bare minimum for a working module.

Now go to your back - office, in the Modules page: the module is visible in the modules list, with its information displayed – and no icon for now.

...