Sylius Digital Download
Sylius plugin for digital downloads: files per variant, release only after the payment is completed, links in a separate email with expiry and download limit, withdrawn on refund, guest friendly. Commercial license.
Sylius Digital Download
This documentation always describes the latest published version.
Live Demo: Try this and other plugins live, no installation, no risk: demo.markus-michalski.net
Overview
Sylius cannot deliver a file to customers out of the box. If you sell digital products alongside physical ones (for example embroidery files per hoop size), you need three things the core does not offer: one file per variant, a release that follows the payment and not the order, and a delivery that is separate from the order confirmation. This plugin adds exactly that.
In the admin, you upload one or more files in the variant form. As soon as the payment of an order is completed and the payments cover the order total, the plugin creates a download link per order item and file and sends it in a separate email.
Payment instead of order: Placing an order creates nothing. Only a completed payment releases the files, so with bank transfer or direct debit, only once you mark the payment as completed in the admin.
graph LR
A["Admin: upload file to variant"] --> B["Variant: shipping not required"]
B --> C["Customer orders and pays"]
C --> D{"Payment completed and total covered?"}
D -->|No| E["No links"]
D -->|Yes| F["Create download links"]
F --> G["Separate email with links"]
G --> H["GET /downloads/token"]
H --> I{"Link valid?"}
I -->|Yes| J["File is delivered"]
I -->|No| K["410 Gone"]
Documentation
| Page | Content |
|---|---|
| Installation | Composer, bundle, routes, setup command, update, uninstallation |
| Configuration | Settings page, YAML defaults, files on variants, storage, web server limits, practical examples |
| Storefront | Email, download link, list in the customer account, shipping step, consent |
| Shop API | The download endpoint for headless frontends and what is not available via API |
| Extending | Replaceable services, mail template, Twig functions |
| Troubleshooting and FAQ | Typical problems, known limitations, frequently asked questions |
| Technical Details | Flow, plugin structure, tables, migrations, tests |
Features
| Feature | Description |
|---|---|
| Files per variant | "Digital download" section in the variant form, several files per variant (for example one per machine format) |
| Private storage | Files are stored under a random name in a storage without a public URL, by default var/digital-downloads, replaceable by any Flysystem storage |
| Release by payment | One link per order item and file as soon as the completed payments cover the order total |
| Separate email | The email mmd_digital_download_ready contains the links, the order confirmation never mentions them |
| Limited links | 64-character random token, optionally with an expiry date and a download limit |
| Withdrawal on refund | A refund after which the order is no longer fully paid blocks its links |
| Guest-friendly | The token is the access credential, no account is needed for guest orders |
| Customer account | Logged-in customers see their downloads on the order page in their account |
| Shipping step is skipped | A variant with a file is saved without shipping required, carts with only digital items skip the shipping step |
| Settings page | Switch, validity, downloads per link, upload size and allowed file types in the admin |
| Setup command | mmd:digital-download:setup runs only the migrations of this plugin |
Requirements
| Requirement | Version | Notes |
|---|---|---|
| Sylius | ^2.2 | |
| PHP | ^8.3 | |
| Symfony | ^7.4 | |
| Database | MySQL / MariaDB | The migrations are written for MySQL/MariaDB |
| State machine adapter | Symfony Workflow | The default since Sylius 2.0. The plugin listens to the workflow events of the payment |
league/flysystem-bundle |
^3.3 | Comes in as a dependency |
| Mailer | configured | The links are sent via the Sylius mailer |
License
Commercial license: one license covers one Sylius installation (all channels plus its development and staging environments). Redistribution is not allowed, updates are included for 12 months from purchase.
Support
For license questions, technical questions or bugs, reach me at support@markus-michalski.net.