Custom Drupal Module: Ubercart File URL

In this project the client (a fellow Drupal website builder) knew exactly what he wanted. He even suggested how it is to be implemented.

The Background

The client had a Drupal website that uses the Ubercart eCommerce platform. The website is to sell downloadable files to customers.

That function is easily realized with one of the core Ubercart system extension module, UC File. This module enables the Ubercart products items to be linked to downloadable files.

This enables the associated file to be downloadable by customers once they complete the payment through the Ubercart payment system.

The Challenges

The client needed a twist on this flow. He wanted the files to be hosted elsewhere outside of the website server (in this case on a Dropbox account).

So that instead of adding downloadable files to Ubercart products, URLs to files uploaded elsewhere (Dropbox) are added. Then when users buy files through the system the download links are URLs to the files hosted somewhere else.

The UC File module could not do this and it can not be extended in the standard Drupal way to do it either (see this).

The Solution And Outcome

In order to achieve this use case, we studied the UC File module thoroughly. We then 'borrowed' its codes and tweaked it to handle file URLs instead of files.

Thus we called the resultant custom module Ubercart File URL.

Client's problem solved.

Drupal Module Development