EnablingTo start selling files, you need to make sure you have enabled the File Downloads module. The File Downloads module makes use of Ubercart's product feature system that lets you attach additional features to products (e.g. file download or discount). You can enable the module under Administer â€º Site building > Modules. Check the box next to File downloads and press the "Save settings" button.
PermissionsAfter enabling the module, you'll want to set the permissions on who can access what parts of the module. You can do this by browsing to Administer â€º User management > Access control. This form will show you all the roles on your Drupal configuration and what permissions they have. You will want to scroll down to the permissions for the uc_file module. There are 2 permissions, "download file" & "view all downloads". The "download file" permission will allow a user to download files from the store. More than likely, you'll want to enable this permission for everyone (you might not want to check the permission for anonymous user if you want customers to be logged in before they can download files) The "view all downloads" permission will let a user view any files a customer has purchased by looking at their user page. You will only want to grant this role for a site or store administrator role.
SettingsYou will also need to set up the file downloads directory that will be used to store all the digital products you will be selling for your store. If you haven't set it (or Ubercart can't find the directory you have specified), you will see a warning on the Store administration page (Administer > Store administration).
If you're perhaps wondering why you should have to specify a file download directory instead of using Drupal's files directory, a separate directory is needed for security reasons; specifying a directory outside of your web root prevents the possibility of someone figuring out where your files are stored and downloading them directly off your web server instead of paying for them.
The file downloads directory is set up under Administer â€º Store administration â€º Configuration > Product settings > Product features. You should see a link that says File download settings, after clicking the link it should open up a form to specify settings for file downloads. It's here where you'll see the following settings:
Adding FilesOnce your file download directory has been setup you're ready to start adding files to the directory so that they can be used for file downloads. There are two ways to do this. One is through the built in file manager located in Administer â€º Store administration â€º Products > View file downloads, this file manager shows all files located in your file directory (with products or SKUs are associated with them) and allows you to delete them or upload new files. Depending on your website's configuration, you might want to upload files that are too big for Ubercart to upload. In which case, you will have to use the second method, upload the files directly through a FTP/SFTP/SSH client to your file downloads directory. After uploading the files directly, they should appear in file manager.
Adding Files to ProductsFrom here you must associate your Ubecart products with file downloads. This tutorial assumes the reader already knows how create an Ubercart product. If you do not you can reference ubercart product creation. Once your product is created you should see a "Features" tab on the product edit page. After clicking the "Features" link, you'll see a empty list of product features. Select "File download" from the Add a new feature select box and click "Add".
The next step is to fill out the feature form with the following details:
- The Model/SKU of the product that grants the download. If the product you are selling is solely a download you'll want to keep this to "Any". If however the product you're selling has different SKU adjustments you might only want to grant a download on a specific SKU (e.g. a music album product might have 2 SKUs: one for the CD & for the album download).
- File download
- The name of the file (located in the file download directory) that can be downloaded upon purchase. Upon typing the file name, an auto complete box should appear showing the available files that start with the text typed. If there are any subdirectories in the file download directory, specifying a subdirectory here will grant all files within that subdirectory.
- A description of the file product. This text will be displayed alongside the file name on a customer's file download page.
- Shippable product
- This checkbox specifies whether the product associated with the download is shippable or not (if there are no shippable items in a customers order he won't be asked for a shipping address at checkout). If there is a shippable product included with this file download you will need to check this box, otherwise leave it blank.
Upon typing "Tes", the file download module recognizes there is a file called "Test.txt"
Customer DownloadAt this point, any customers that purchase the product should have a file download granted once their order goes into the status you have specified. From here it is up to you to set up a workflow configuration that will move the order into the correct status once a customer has paid, and then to notify the customer where they can go to download the file they've purchased. Once a customer is granted a download they can go to My account > Files to download the file. If you wish to send the customer an email with the file download link, you can do so with the built in notification support. To do this make sure you enable the Notify module in the same place where you enabled the File Downloads module. After the Notify module is enabled, you can browse to Administer â€º Store administration â€º Configuration > Notification settings > File download where you can set up the email template that will get set out to the customer once they complete the sale. Checking the "Send email to customer with file download link(s)" box will send out the notification message once the customer is granted the file download. The token [file-downloads] will contain the file download links that the customer can use to download the file. Other tokens will let you customize the message further (a link in the notification form will describe each token you can use).
From this point, you should know everything there is to create file products for your Ubercart store.