Settings ↑ Back to Top
WooCommerce > Settings contains several downloadable product options. The most important option is the file download method:
You have 3 choices:
- Redirect only – When users download a file, their link redirects to the file.
- Force download – File downloads are forced using PHP.
- X-Sendfile – Downloads are served by Apache. Requires the X-Sendfile module (not all servers have this).
To ensure files are protected from direct linking, Force Download can be used. Files will be served by PHP. However, if your files are large, or server is underpowered, you may experience timeouts during download – in this case you would need to either look at your server or use the redirect method.
If your server supports it, use X-Sendfile; its the most reliable method. Apache serves the download giving you the best performance. Files are also protected by a .htaccess file making this method secure.
The next option is “Must be logged in to download files“. This will only allow logged in users to download – non logged in users will need to login. Its important to disable guest checkout if this option is enabled, as guests cannot download.
Setting up downloadable products ↑ Back to Top
Downloadable Simple Products
Create a simple product the regular way, but check the ‘downloadable’ box:
After checking this box some extra options will appear:
Product options in 2.0
Upload a file and click ‘insert’ to set up each downloadable file URL. In 2.0 you can enter 1 per line, but in versions prior to that you can only set up 1 file per product. If you need to add multiple files in older version you may want to ‘zip’ the files into 1 package.
For the download limit you can optionally set a limit of downloads; once the user hits this limit they will no longer be able to download the file.
Download expiry works in the same way; if you define a number of days, after that many days the download links will expire.
Please note that as soon as you change an uploaded file or upload a new file, this download expiry and limit will reset as it’s technically a new file. This is intended behaviour.
The options work the same as with regular products; set the file path, optionally choose a limit and expiry and your done.
Combining downloadable and virtual products
If you simply check the downloadable boxes, the products can have stock and will be treated as physical products – this lets you do things such as sell downloads and real products together.
If you want a downloadable product which is not physical, also enable the ‘virtual’ option.
The order process ↑ Back to Top
The order process for downloadable products is as follows:
- User adds product to their cart
- Users checks out and pays
- After payment several things can happen depending on your setup:
- If the items in the order are all downloadable + virtual the order will complete
- Otherwise, 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 will:
- Be granted download permissions
- See the download links on the order received page
- See the download links in their email notification
- See the download links on their ‘My Account’ page if logged in
Users can then download their files.
Managing orders with downloadable line items
If you edit/view an order with downloadable products within it you will notice the downloadable products meta box contains the users permissions:
By editing this panel you can modify a users permissions, or revoke access to files. You can also grant access to new downloads.