PS PrestaShop Beginner

DF Download Center — Documentation

Install, configure and use the product download center: product tab, indexable central page, document types, file security.

Updated Module version 1.0.0

Overview

DF Download Center attaches your manuals, user guides, datasheets and CE certificates directly to your products. Every product page gains a “Documents & downloads” tab listing the files grouped by type. Alongside it, an indexable central page gathers your whole document catalog, with search, type filters and JSON-LD structured data.

The module is compatible with PrestaShop 8.0 to 9.x, multistore, available in five languages, and depends on neither Composer nor any external framework.

Installation

  1. In the back office, go to Modules then Module Manager.
  2. Click Upload a module and drop the dfdownloadcenter-1.0.0.zip file.
  3. Click Install.

Installation creates the module tables, four default document types, an admin tab under the Catalog menu, and registers the required hooks.

Clear the cache after installing, from Advanced parameters then Performance. The central page route is declared through the routing hook and only becomes active once the cache is regenerated.

Permissions

The modules/dfdownloadcenter/uploads/ folder must be writable by the web server. It contains an htaccess file that blocks all direct HTTP access: files only come out through the download controller.

Configuration

Open the module from Modules then Module Manager, and click Configure.

Central page

  • Enable the central page — when disabled, the page returns a 404 and the link from the product tab disappears.
  • URL slug — the URL segment of the page, for example downloads or telechargements. Clear the cache after any change.
  • Documents per page — 20 by default.
  • Meta title and Meta description — configurable per language, used in the page title tag and meta description.

Document types

Four types are installed by default, translated into all five catalog languages:

  • Manuals & user guides
  • Datasheets
  • CE certificates
  • Other documents

From the configuration screen you can create, rename and reorder the types. The position determines the display order of the groups in the product tab and on the central page.

A type used by at least one document cannot be deleted. The module shows the number of documents involved and asks you to reassign them to another type first.

Managing documents

Documents are managed from Catalog then Download center. The list shows each document’s title, type, file name, size, download count and active status.

Creating a document

  1. Click Add new.
  2. Enter the title in each language. The title is required in the default language.
  3. Add an optional description, also per language. It appears under the title in the product tab and on the central page.
  4. Choose the document type.
  5. Select the file to upload.
  6. Attach the associated products by typing their name or reference into the search field: suggestions appear after two characters, and each selected product becomes a chip you can remove in one click.
  7. Set the document position within its type, and its active status.
  8. Save.

File formats and size

Accepted extensions are: PDF, DOC, DOCX, ODT, XLS, XLSX, ODS, CSV, TXT, RTF, ZIP, PNG, JPG, JPEG, WEBP, SVG, DWG, DXF, STEP and STP. Maximum size per file is 50 MB.

If a file under 50 MB is rejected, check the upload_max_filesize and post_max_size directives in your PHP configuration: the module cannot receive a file that PHP refuses upstream.

Replacing a file

Open the document for editing and select a new file. The old file is automatically removed from the server once the update succeeds. The download counter is preserved.

One document, several products

The document-product association is many-to-many. A CE certificate covering three references is attached to all three in a single step, and then appears in the tab of each of them. Conversely, a product can carry as many documents as needed.

A document with no attached product is still valid: it appears in no product tab, but remains visible on the central page. That is the pattern to use for a quality charter, a general catalog or any company document.

The product tab

On the product page, the “Documents & downloads” tab appears next to the description, through PrestaShop’s native extra content hook. No theme file is overridden.

Documents are grouped by type, in the order defined by the type positions. Each row shows a colored extension chip, the title, the optional description, the file size and a download button. A link to the central page closes the tab when that page is enabled.

If a product has no active attached document, the tab does not appear at all.

The central page

The central page is served at the URL defined by the slug, for example /downloads, or /fr/downloads in other languages depending on your store’s multilingual configuration.

Search and filters

The search field queries the document title, its description, the original file name, and the name and reference of the associated products at the same time. A customer typing a product reference therefore finds the matching manual.

Type filters are displayed as pills, each showing the number of active documents. Pagination is configurable from the settings.

SEO

The page is built to be indexed:

  • meta title and meta description configurable per language;
  • robots directive set to index follow;
  • clean canonical URL — only the page number is kept, filters and search are excluded to avoid duplication;
  • breadcrumb;
  • JSON-LD ItemList structured data block, describing each file as a DigitalDocument;
  • internal links to the related products, under each document.

Download and security

Files are never directly reachable. They are written under a hashed name in the module’s uploads/ folder, locked down by an htaccess file.

Downloads always go through a front controller which, before serving the file:

  • checks that the document exists and is active;
  • checks that it is attached to the current shop;
  • increments the download counter;
  • returns the file under its original name.

PDFs and images open in the browser; other formats trigger a download. Any invalid request is redirected to the store’s 404 page.

Multistore

Documents are associated with shops natively, through PrestaShop’s standard table association. In a multistore context, a document created in one shop only appears there, and the download controller refuses to serve a file attached to another shop.

The central page settings — slug, meta, pagination — are also managed per shop.

Uninstalling

Uninstalling removes the module tables, its configuration values, its admin tab, and deletes every file in the uploads/ folder.

Back up your files before uninstalling the module: uploaded documents cannot be recovered afterwards.

Troubleshooting

The central page URL returns a 404

Clear the cache from Advanced parameters then Performance. Routes declared through the routing hook are cached by PrestaShop and are only taken into account once regenerated.

Also check that friendly URLs are enabled in Shop parameters then Traffic & SEO, and that the central page is enabled in the module configuration.

The tab does not appear on the product page

Check that the product has at least one active attached document, and that the extra content hook is properly registered for the module in the Positions page of the back office. On a heavily customized theme, make sure the product page template renders extra content blocks.

The download returns a 404

Three possible causes: the document is disabled, it is not attached to the current shop, or the physical file is missing from the uploads/ folder. Edit the document again and re-upload the file.

Upload fails without a clear message

Check write permissions on modules/dfdownloadcenter/uploads/, then the PHP directives upload_max_filesize, post_max_size and max_file_uploads.

Technical compatibility

  • PrestaShop 8.0 to 9.x
  • PHP 7.4 to 8.3
  • Hooks used: displayProductExtraContent, moduleRoutes, displayHeader, actionObjectProductDeleteAfter
  • No core override, no Composer dependency
  • Vanilla JavaScript autocomplete interface, no jQuery
  • Multistore and multilingual: EN, FR, ES, DE, IT
Was this page helpful?

Still stuck? Contact support