Ecommerce Templates > General Help > Digital downloads

Digital downloads Ecommerce Template plug-in

Digital downloads

The digital download plug-in allows you to offer products for sale that are available as an immediate download following purchase. This might be useful when selling e-books, software, music etc where you want to provide the customer with immediate access to your products. It is possible to have both standard products and downloadable ones on the same store.

The way it works is that once somebody has purchased from your store they are sent on to the thanks page in the normal manner. On that page they will see a box with a download link that allows them to get a copy of the downloadable product. They will also receive an email regarding the purchase. This can be configured to allow the number of days following purchase that the item will be available for along with an URL and password for making the late download.

We have set up our User Manual as an example of how the digital download process works. This can be "purchased" from our demo store. Please note that the digital download plug-in is only available for the Ecommerce Templates shopping cart.

Requirements

  • Digital download plug-in - NOW INCLUDED AS STANDARD
  • Ecommerce Template
  • ASP Upload installed on the server (Optional and for the ASP version only, for secure downloads)

Set up details

ASP Version

On the admin products page Quick Entry and when editing a product the “Download”, will allow you to enter the location of the digital download.

digidownloadpattern="\downloads\%pid%.zip"

If required, you can set a pattern for the download filename, and base it on the product id. This parameter is optional. If you use this parameter, to show which products have a download attached enter an “A”, (meaning “Automatic”), on the products admin page for the download setting.

Download

To get the path to your downloads folder you can use the same test.asp file used for setting the database in db_conn_open.asp and changing the resulting string so it points to the correct location on your server.

digidownloadsecret="fe2ls2pl2jJbIONowk234ksdf"

This should always be set and should be set to random alpha-numeric text. It’s just a way of generating a code to make it difficult for hackers to steal your downloads.

digidownloadwarn=TRUE

Setting this parameter to TRUE will mean that if someone does attempt to download with incorrect parameters then you will be sent an email with the subject “Failed Download” and the IP address of the person making the attempt. This could be useful for debugging or spotting fraud attempts.

digidownloadmethod="aspupload"

If the component ASP Upload is installed on your server then set the above to “aspupload”. This will mean that you can place your downloads below the web root where they can only be accessed via the download script. If ASP Upload is not installed then you can still provide digital downloads securely by using the following

digidownloadmethod="filesystem"

You will of course need to run through a test order to make sure eveything is working correctly

digidownloademail="Your email message here if any downloadable products"

This can be used to send your customers an email informing them of how to download their products
in case they missed the original download. Instances of %orderid% and %password% will be replaced
by the order id and password necessary to download their products. You must have v4.8.6 or above
of Ecommerce Plus for this feature to work.
An example of it's use would be . . .

digidownloademail="Your products can be downloaded for the next 3 days by going to the URL%nl%http://www.yoursite.com/latedownload.asp?ordid=%orderid%&pass=%password%%nl%Or alternatively, go to the URL%nl%http://www.yoursite.com/latedownload.asp%nl%. . . and enter the order ID %orderid% and password %password%%nl%%nl%"

Please note how newlines are added to the email by simply adding %nl% meaning you don't have to
worry about different email formats.

digidownloaddays=10

Setting this will make downloads available for the number of days specified. The default is 3 days
and the example above would set it to 10.

How to set up latedownload.asp
You can make your own late download page by opening thanks.asp and saving it as latedownload.asp
In the HTML change:

<!--#include file="vsadmin/inc/incthanks.asp"-->

to

<!--#include file="vsadmin/inc/inclatedownload.asp"-->

... and save the file as latedownload.asp. (Make sure that you don't save the changes to thanks.asp)

If when testing your downloads, clicking on the download link results in a page saying "Connection Error" then it's more than likely you need this parameter in vsadmin/includes.asp

iswin2008r2=TRUE

This is only for ASP users and Windows2008 R2 servers.

PHP Version

On the admin products page Quick Entry and when editing a product the “Download”, will allow you to enter the location of the digital download.

$digidownloadpattern="\downloads\%pid%.zip";

If required, you can set a pattern for the download filename, and base it on the product id. This parameter is optional. If you use this parameter, to show which products have a download attached enter an “A”, (meaning “Automatic”), on the products admin page for the download setting.

Download

$digidownloadsecret="fe2ls2pl2jJbIONowk234ksdf";

This should always be set and should be set to random alpha-numeric text. It’s just a way of generating a code to make it difficult for hackers to steal your downloads.

$digidownloadwarn=TRUE;

Setting this parameter to TRUE will mean that if someone does attempt to download with incorrect parameters then you will be sent an email with the subject “Failed Download” and the IP address of the person making the attempt. This could be useful for debugging or spotting fraud attempts.

$digidownloadmethod="filesystem";

To use the operating systems filesystem set the above parameter. This will allow you to specify for instance files outside your web root for instance . . .
/your/path/to/yourfile.zip

To get the path to your downloads folder make a file called t.php in a text editor with the following code

<html><body><?php
echo getcwd();
?></body></html>

...upload that to your web root and open it in your browser. That will give you the path to the web root from which you should be able to work out the path to your downloads folder you've set up. Paste the path into $digidownloadpattern

Otherwise by default the system will use http for the file location, allowing you to specify for instance
http://www.yoursite.com/yourdirectory/yourfile.zip

$digidownloademail="Your email message here if any downloadable products";

This can be used to send your customers an email informing them of how to download their products
in case they missed the original download. Instances of %orderid% and %password% will be replaced
by the order id and password necessary to download their products. You must have v4.8.6 or above
of Ecommerce Plus for this feature to work.
An example of its use would be . . .

$digidownloademail="Your products can be downloaded for the next 3 days by going to the URL%nl%http://www.yoursite.com/latedownload.php?ordid=%orderid%&pass=%password%%nl%Or alternatively, go to the URL%nl%http://www.yoursite.com/latedownload.php%nl%. . . and enter the order ID %orderid% and password %password%%nl%%nl%";

Please note how newlines are added to the email by simply adding %nl% meaning you don't have to
worry about different email formats.

$digidownloaddays=10;

Setting this will make downloads available for the number of days specified. The default is 3 days
and the example above would set it to 10.

How to set up latedownload.php
You can make your own late download page by opening thanks.php and saving it as latedownload.php
In the HTML change:

<?php include "vsadmin/inc/incthanks.php" ?>

to

<?php include "vsadmin/inc/inclatedownload.php" ?>

... and save the file as latedownload.php. (Make sure that you don't save the changes to thanks.php).

WordPress Version

The instructions for the WordPress version are the same as for the PHP with these additions.

  • All parameters in the includes.php file need to be set as "GLOBALS" as are all other WordPress parameters. For instance, the $digidownloads=TRUE; parameter would be $GLOBALS["digidownloads"]=TRUE;
  • To create a Late Download page just use the WordPress shortcode, "ect_latedownload" as detailed here.

Download files as product options

If you want to offer products which can be shipped or downloaded and you need to offer your clients that choice then you will need to use the ALT ID feature for product options outlined here.

You will need to set the Alt Pro ID to two exclamation marks like this
!!
. . . for any product option which does NOT have a download associated with it.

Make sure it is the resulting product for the alt prod id that has the "a" for "automatic" or download path in the download field, not the main product.

Also, anything you add for the Alt Prod ID can be preceded with an exclamation mark to show that it is only to alter the download filename not the product id. For instance this would alter an occurence of XXX in the product id to ABC
XXX ABC
This will do it for the download filename only
!XXX ABC

You can also use the following construction to quickly add a file extension to a download filename.
!%s.zip
!%s.sit
These will add ".zip" and ".sit" extensions to the download filename respectively.

Multiple file downloads

This is a new feature introduced for v7.3.2 so you may need to install the latest version of the Digital Downloads plugin. To allow multiple file downloads you need to set the following parameter in your includes.asp/php file...

digidownloadpath="d:\wwwroot\yoursite.com\digidownloads\"
$digidownloadpath="/wwwroot/yoursite.com/digidownloads/";

Once you have done this you can set a comma separated list of files in the ECT Admin Products page, for instance...

file1.zip,file2.pdf,file3.png