Product Attachment

v1.1.2 Updated 23 aug. 2026

Product Attachment

Attach files (PDF, Office documents, images, archives) to any Magento 2 product from the admin product form.
Magento 2.4.4 Magento 2.4.5 Magento 2.4.6 Magento 2.4.7 Mage-OS 2.0 Mage-OS 2.1
€ 49,00
Probeer de live demo
  • Updates and support included for 12 months
  • License key delivered immediately by email
  • 30-day money-back guarantee
  • Full documentation included
  • Composer-ready installation

Product Attachments

Koppel documenten aan uw producten en bepaal per bestand wie ze mag downloaden. Datasheets, montagehandleidingen, certificaten, garantievoorwaarden, CAD-tekeningen, prijslijsten — upload ze rechtstreeks vanuit het productformulier, herschik ze met drag-and-drop, en laat de storefront ze onder het product tonen.

Elk bestand is ofwel publiek, ofwel voorbehouden aan ingelogde klanten. Die tweede modus is de reden waarom deze module bestaat: voorbehouden bestanden staan buiten de web root en worden uitsluitend geserveerd door een controller die eerst de bezoeker controleert. Een gast die de URL raadt, of toegestuurd krijgt, krijgt een 404 en niet het bestand. Modules die hun uploads in de media-map bewaren, kunnen alleen de link verbergen — het bestand zelf blijft één directe URL verwijderd.

Voor wie

  • B2B-handelaars die technische documentatie, certificaten of prijslijsten publiceren die voorbehouden zijn aan hun zakelijke klanten
  • Fabrikanten en distributeurs die handleidingen, veiligheidsbladen of CAD-bestanden bij elk product leveren
  • Handelaars die bepaalde documenten om contractuele, regelgevende of commerciële redenen achter een login moeten houden
  • Iedereen die het beu is om product-PDF's te onderhouden als CMS-blokken of hard-coded links in een template

Belangrijkste voordelen

  • Werkelijk afgeschermde bestanden — klant-only bijlagen staan buiten de web root en worden gestreamd door een controller die de bezoeker controleert. De URL delen levert niets op, en dat is de enige manier waarop "voorbehouden aan klanten" iets waard is.
  • Zichtbaarheid per bestand — publieke en afgeschermde documenten staan samen op hetzelfde product. Publiceer de datasheet, reserveer de prijslijst.
  • Beheerd vanuit het productformulier — een inklapbare Attachments-sectie op elk producttype. Uploaden, titelen, herschikken met drag-and-drop, verwijderen. Geen apart admin-scherm om te leren.
  • Niets lekt naar gasten — het storefront-block toont helemaal niets wanneer de bezoeker geen enkele bijlage mag zien, zodat een gast niet eens te weten komt dat er afgeschermde documenten bestaan.
  • Full Page Cache-vriendelijk — het block leest de ingelogde status uit de HTTP context van Magento, waarop de cache al varieert, en draagt de product cache tag zodat het opslaan van een product het ververst.
  • Thema-onafhankelijk — de module levert een block en een template maar plaatst geen van beide, waardoor hij past in een Luma-layout, een Hyvä-thema of een tab-extensie zoals Swissup Easytabs zonder uw design in de weg te zitten.

Compatibiliteit

  • Magento 2.4.x / Mage-OS equivalent
  • PHP 8.1, 8.2, 8.3, 8.4
  • Geen afhankelijkheid van andere Wimakeit-modules
  • Werkt met Hyvä- en Luma-frontends
  • Compatibel met Varnish Full Page Cache
  • Toegestane bestandstypen: PDF, DOC, DOCX, XLS, XLSX, CSV, TXT, ZIP, JPG, JPEG, PNG

Installeer deze module via Composer. Zorg ervoor dat uw auth.json is geconfigureerd met uw Wimakeit-inloggegevens.

Terminal
$ composer require wimakeit/module-product-attachment:^1.1.2
$ bin/magento setup:upgrade
$ bin/magento setup:di:compile

Installation notes

The standard composer require + setup:upgrade + setup:di:compile flow applies. The points below cover what's specific to this module.

Required dependencies

No Wimakeit dependency — this module stands alone. It requires only Magento's own Catalog, Customer, Backend, MediaStorage, Store and Ui modules, which every installation already has.

No admin configuration

The module ships no configuration section. There is nothing to set under Stores → Configuration after installing it: allowed file types and storage location are fixed by design, and visibility is chosen per file on the product itself.

ACL permissions

The module creates no new ACL resource. Uploading attachments is gated on the existing Catalog → Products permission, so any admin role that can already edit products can manage attachments. No role changes are needed after installation.

Where the files are stored

Attachments are written to var/wimakeit/product_attachments/, deliberately outside the web root. This is what makes the "logged-in customers only" setting real: those files have no URL of their own and are streamed by the module's download controller, which checks the visitor first. Storing them under pub/media would leave them reachable by direct URL and reduce the restriction to hiding a link.

Two consequences for your infrastructure:

  • Deployment scripts that wipe var/ will delete uploaded attachments. Exclude var/wimakeit/product_attachments/ from any cleanup step.
  • var/ is not shared between web nodes. On a multi-node setup, mount var/wimakeit/product_attachments/ on shared persistent storage.

Make sure the directory is writable by the PHP user:

mkdir -p var/wimakeit/product_attachments
chown -R www-data:www-data var/wimakeit

The storefront block

Since 1.1.0, nothing to do: the module places itself in product.info.details, group detailed_info — the stock Magento contract for product tabs, honoured by Luma and Hyvä alike. The block is named wimakeit.product.attachments.

Do not add a <referenceBlock> for it. Up to 1.0.x the module shipped unplaced and this page told you to. Doing it now gives you the Documents tab twice.

To move it elsewhere, remove the shipped one first:

<referenceBlock name="wimakeit.product.attachments" remove="true"/>

Same with Swissup Easytabs: remove the shipped block, then create a tab in Content → Easytabs of type Custom Block using the same class and template. One tab per store view if you need a localised title.

The block renders nothing when the visitor may see no attachment, so tab extensions that drop empty tabs will hide the tab by themselves.

The tab does not show up? Your theme decides how detailed_info is rendered, and one that picks its sections positionally will drop this one silently — the module sorts at 20. Check the theme's product-sections template before suspecting the module.

Allowed file types

pdf, doc, docx, xls, xlsx, csv, txt, zip, jpg, jpeg, png. Executable and script types are refused. Uploading is admin-only; there is no frontend upload.

Store scope

Attachments are not store-scoped: one list per product, shown on every store view. If you need per-language documents, that requires adding a store_id column to the wimakeit_product_attachment table.

Versie
v1.1.2
Ondersteuning
12 maanden
Last updated
23 aug. 2026
Magento
Magento 2.4.4 Magento 2.4.5 Magento 2.4.6 Magento 2.4.7 Mage-OS 2.0 Mage-OS 2.1
PHP
PHP 8.1 PHP 8.2 PHP 8.3
Hyvä
Niet compatibel
Pakket
wimakeit/module-product-attachment

Compatibility checker

Pick your stack to see if this module fits.

Changelog

Categories: Security, Feature, Fix, Perf, Admin, Deps.

[1.1.2] - 2026-08-18

Fix

  • L'onglet « Documents » et six autres libellés s'affichaient en anglais sur les vitrines néerlandaise et espagnole.
  • Une vignette qui échoue est désormais tracée dans les journaux, au lieu de disparaître sans explication.
  • Le message d'erreur d'un envoi de fichier ne révèle plus de chemins techniques du serveur.

Doc

  • Le guide d'installation décrivait encore une pose manuelle du bloc, ce qui aboutissait à deux onglets « Documents » identiques.

[1.1.1] - 2026-08-18

Fix

  • Les vignettes des images jointes s'affichaient comme une image cassée dans la fiche produit en admin.

[1.1.0] - 2026-08-18

Feature

  • Documents visible sur la fiche produit. Un onglet dédié liste les documents du produit, chacun avec son titre, sa description et son poids — jusqu'ici rien ne s'affichait côté boutique.
  • Aperçu visuel. Les images ont une vraie miniature, les autres formats un badge coloré indiquant le type — en back-office comme en vitrine.
  • Compteur de téléchargements, avec la date du dernier, visible dans la fiche produit en back-office.
  • Visibilité « masqué », pour retirer un document de la vitrine sans le supprimer.
  • Description par document, affichée sous son titre.

Fix

  • Les documents enregistrés n'apparaissaient plus dans le formulaire produit après rechargement, et étaient perdus à l'enregistrement suivant.
  • La table des documents n'était pas créée à l'installation, ce qui rendait l'écran inutilisable.

Security

  • Un document masqué reste téléchargeable pour qui connaît son identifiant : corrigé, ainsi que son affichage aux clients connectés.

[1.0.4] - 2026-08-17

Fix

  • Packaging. The module no longer ships the development dependencies used to run its own test suite, which could collide with the project's own copies and break code compilation on install.

[1.0.3] - 2026-08-17

Perf

  • Unchanged attachments no longer trigger a database write on every product save. Editing a product's price or name issued one pointless UPDATE per attached file; on catalogues with several documents per product this quietly added write load to the most common admin action.

[1.0.2] - 2026-08-17

Security

  • Restricted documents could be pointed at arbitrary files on the server. An admin holding only the Catalog > Products permission could make an attachment reference any file under var/ — database backups, logs, customer exports — mark it public, and have it downloaded by anonymous visitors. Attachment paths are now validated and can no longer leave the attachments directory.
  • Documents of disabled or off-website products stayed downloadable. Attachment ids are sequential, so a document remained reachable by trial and error after its product was taken offline. The download now requires the product to exist, be enabled and belong to the current website.

Fix

  • An attachment could be destroyed when replacing its file failed. If storing the new file failed (full disk, permissions), the existing attachment was deleted along with its file instead of being left untouched. A row that cannot be processed is now always preserved.
  • Attachment files are removed when a product is deleted. Only the database rows were cleaned up before, leaving the files on disk permanently with nothing left to identify them.
  • A failed attachment write no longer interrupts the rest of the save. An error on one row aborted the whole synchronisation and left the product's attachments half-updated.

Perf

  • The storefront attachment list is cached again. The block was re-querying the database on every render instead of using its cache entry.

[1.0.1] - 2026-06-08

Fix

  • File uploads made reliable across admin form layouts. The uploader failed to pick up the file when the product form posted it under its nested field name, so an upload could silently produce no attachment.

[1.0.0] - 2026-06-08

Feature

  • Attach files to any product from the admin product form — PDF, Office documents, images and archives, on every product type, reorderable by drag-and-drop.
  • Per-file visibility: public or logged-in customers only. Restricted files are stored outside the web root and served only after the visitor is checked, so sharing the URL gains nothing.
  • Storefront listing that reveals nothing to guests — the block renders nothing at all when the visitor may see no attachment, so the existence of restricted documents is never disclosed.
  • Full Page Cache compatible — the list varies on the logged-in state Magento already caches on, and refreshes when the product is saved.
  • Available in English, French, Dutch and Spanish.

Een bug gevonden? Laat het ons weten.

Een kort formulier opent in een nieuw tabblad — de modulenaam en uw taal zijn al ingevuld. Beschrijf wat u probeerde, wat misging, en wij komen binnen één werkdag bij u terug.

Een bug melden voor Product Attachment
Module SKU: wimakeit-module-product-attachment · Taal: nl_NL

Hulp nodig?

Ons team helpt u graag met de integratie.

Neem contact op
Planifier un appel