fixstacks / module-zero-product-attachments
Zero for Magento Open Source: files on product pages (manuals, data sheets, certificates): attached by SKU in the admin, a Downloads section with kind and size.
Package info
github.com/Fixstacks/module-zero-product-attachments
Type:magento2-module
pkg:composer/fixstacks/module-zero-product-attachments
Requires
- php: ~8.2.0||~8.3.0||~8.4.0
- fixstacks/module-zero-core: ^1.3
- magento/framework: 103.0.*
- magento/module-backend: *
- magento/module-catalog: *
- magento/module-config: *
- magento/module-store: *
- magento/module-ui: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Files on product pages: manuals, data sheets, certificates, size drawings. A "Downloads" section in the product page's details lists them with their kind and size; each opens in a new tab.
Install
Requires Magento Open Source 2.4.7–2.4.9 and PHP 8.2–8.4 with the GD extension built with WebP (php -r 'var_dump(function_exists("imagewebp"));' says true; Magento's own PHP requirements cover the rest). Without WebP in GD, Zero skips its WebP image copies and serves the originals.
composer require fixstacks/module-zero-product-attachments bin/magento setup:upgrade bin/magento setup:di:compile # production mode bin/magento setup:static-content:deploy # production mode bin/magento cache:flush
Composer installs fixstacks/module-zero-core with it.
Part of fixstacks/zero, which installs the Zero theme and every Zero module at once.
Setting it up
Stores > Configuration > Zero > Product Attachments: Enabled (off by default, per store view), the section's title (Downloads), the largest file (20 MB).
Admin
Catalog > Product Attachments (resource Zero_ProductAttachments::attachments):
attach a file to a product by its SKU, with a title (empty: the file's
name), a store view (or all) and a sort order; below, the files of every
product or of one SKU, each with its title, store view and order to change,
and Remove. A product's form has an Attachments button that opens its
files.
Files
Allowed: PDF, JPEG, PNG, WebP, ZIP, TXT, CSV, Word, Excel, PowerPoint, OpenDocument text and spreadsheet. Each is checked by its extension and by its content (an HTML page named .pdf is refused). Nothing a browser would run from the store's domain: no HTML, SVG or scripts.
Stored under pub/media/zero/attachments/<random>/<clean-name>, served as
media. Removing an attachment removes its file; deleting the product removes
its attachments' rows. Adding, changing or removing a file cleans the
product's page from the page cache (built-in or Varnish).
Table: zero_product_attachment.
License
OSL-3.0 or AFL-3.0, your choice: see NOTICE.md.
Zero is made by Fixstacks in partnership with Vilmate, a software development company. Documentation: https://fixstacks.com/zero/docs. Demo store: https://zero.fixstacks.com.