Digital/Downloadable Product Handling

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

Settings ↑ Back to Top

WooCommerce > Settings >Products> Downloadable Products 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-Accel-Redirect/X-Sendfile – Downloads are served by the server (nginx/apache). This method requires the X-Accel-Redirect/X-Sendfile module be installed and enabled on the server. Please confirm with your web host that one of these modules is installed before using this download method for your store.

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-Accel-Redirect/X-Sendfile; it’s the most reliable method, as the file is served directly to the customer, giving you the best performance. Files are also protected by an .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:

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. Make sure that you match the URL of the product to the URL of your site. (i.e., if you have a www in your site URL, then make sure that is in the 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 same URL formatting that your site does. Make sure that it matches the site URL in your WordPress settings. (i.e., if you have a www in your site URL, then make sure that is in the file URL.)

Why don’t I see a file link on the order received page?

If you are using PayPal, there is a delay when using the IPN to track payments. You can instead enable PDT by going to gateway settings and selecting it as the PayPal Identity Token.

Back to the top