Settings >Products> Downloadable Products contains several downloadable product options. The most important option is the file download method:
You have three choices:
- Redirect only – When users download a file, their link redirects to the file.
- Force download – File downloads are forced, using PHP.
- X-Accel-Redirect/X-Sendfile – Downloads are handled by the server. This method requires the X-Accel-Redirect/X-Sendfile module be installed and enabled on the server. Confirm with your web host that one of these modules is installed before using this method for your store.
Force Download can be used to ensure files are protected from direct linking. Files will be served by PHP. However, if your files are large, or the server is underpowered, you may experience timeouts during download. In this case, you need to either look at your server or use the redirect method.
If your server supports it, use X-Accel-Redirect/X-Sendfile; it’s the most reliable method because the file is served directly to the customer, and gives you the best performance. Files are also protected by an .htaccess file, making it secure.
The next option is Must be logged in to download files. This only allows logged-in users to download. Guest checkout would need to be disabled.
Setting up downloadable products
Downloadable Simple Products
To get started:
- Create a simple product the regular way but tick the Downloadable checkbox:
After ticking this box, extra options appear:
2. Upload a file and click Insert to set up each downloadable file URL. Match the URL of the product to the URL of your site.
3. Enter the Download Limit (optional). Once the user hits this limit, they can no longer download the file.
4. Enter the Download Expiry. If you define a number of days, download links expire after that.
5. Select the Download Type from the dropdown.
As soon as you change an uploaded file or upload a new file, the Download Expiry and Download Limit are reset because it’s technically a new file. This is the intended behavior.
Variable products can also have downloadable variations. When adding a variation tick the Downloadable checkbox and more options appear.
Set the file path and optionally choose a download limit and expiry, and save.
Combining downloadable and virtual products
If you tick the Downloadable checkboxes, products can have stock and are treated as physical products. This allows you to sell downloads and real products together.
If you want to add/sell a downloadable product that is not physical, also enable the Virtual option.
The order process
The order process for downloadable products is:
- User adds product to their cart.
- Users checks out and pays.
- After payment, several things can happen depending on your setup:
- If items in the order are all downloadable + virtual, the order will complete.
- If items are physical and downloadable/virtual, the order will be processing until you change it.
- Once complete, or if the option “Grant access to downloadable products after payment” is enabled, the user can:
- Be granted download permission
- See download links on the order received page
- See download links in their email notification
- See download links on their ‘My Account’ page if logged in
Users can then download files.
Managing orders with downloadable line items
If you edit/view an order with downloadable products, the downloadable products meta box contains user permissions.
By editing this panel, you can modify a user permissions or revoke access to files. You can also grant access to new downloads.