Search

Digital/Downloadable Product Handling

This tutorial builds upon Managing Products but explains downloadable products specifically.

Settings ↑ Back to Top

WooCommerce > Settings contains several downloadable product options. The most important option is the file download method:

Downloadable Product Options

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.

Finally, “

Setting up downloadable products ↑ Back to Top

Downloadable Simple Products

Create a simple product the regular way, but check the ‘downloadable’ box:

Creating A Digital Download Product

After checking this box some extra options will appear:

Digital Product File

Product options in 2.0

WooCommerce 2.0 supports multiple files per product!

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.

Downloadable Variations

Variable products can also have downloadable variations. When adding a variation check the ‘downloadable’ box to see the options:

Variation Downloads

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:

  1. User adds product to their cart
  2. Users checks out and pays
  3. 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
  4. 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:

Manually Add Digital Download

By editing this panel you can modify a users permissions, or revoke access to files. You can also grant access to new downloads.

FAQ ↑ Back to Top

Why does WooCommerce link to the URL of the file?

When setting up your downloadable product, be sure that the downloadable file settings use the absolute path and not the URL.

An example of absolute path is: var/www/vhosts/domain.com/httpdocs/path/to/file.mp3

Screenshot on 10.21.2014 at 12.53.14 PM

Back to the top