Main Content

Connect Site Users to Premium Content with Commerce License

Intro to Commerce License

Commerce License is a module that grants users access to premium digital resources by either a remote or local license.

This module is good for granting users a license to resources that live behind a paywall, such as training materials or videos. 

Commerce License comes in handy for selling access to this kind of premium content while breaking free of the restrictive workflows of using only Drupal commerce. It can be used to sell access to files or node types, or it can be used to grant access to remote sites. The local license gives resources to local content within Drupal while a remote license connects to third-party services such as ZenDesk. This means that association websites don’t need to conduct transactions each time that a user wants to access premium content.

As of January 20, 2016, Commerce License has been downloaded from Drupal.org 19,500 times. It is maintained by Commerce Guys.

commerce_license_code.png

Looking for more tips on Drupal sites with commerce? Check out these stories on the blog:


Let's start out by reviewing the old way of setting up commerce on Drupal sites.

The old way of giving access to commerce

  • - Commerce
  • - Rules
  • - Flags
  • - Roles
  • - Content Access Modules
  • - Custom cron jobs

This is a restrictive and very manual process if you want to add another subscription. There are many administrative steps and code modifications just to add another subscription.

New way (using Commerce License)

  • - Commerce 
  • - Commerce License
    • - ships with Roles and Files
    • - integrates with advancedqueue to keep updated

By using Commerce License, site owners can create billing cycles for purchases. Pre-paid, post-paid, and metered billing are all possible to set up. Admins can also set up license dunning to resend billing if payment isn’t received on the first billing attempt.

If commerce cron goes and tries to do a payment or renewal, and the card is expired or doesn’t go through, dunning will automatically retry the payment and communicate via email that there was a failure in payment.

Commerce license schematic


Our Experience with Commerce License

Modules used:

  • - Node Option Premium (nopremium) sets a flag on the node to indicate if it’s premium content
  • - Role Field (role_field) client specifies different roles that can have access to a field
  • - A custom module to set the view display so that it shows if the files are available to download or to say “Subscribe/Login” 

commerce_license_custom_view_display.png

Site owners can set custom expiration dates for licenses and can even allow users to access multiple licenses which expire at different times. For example, a user may start out by purchasing a Basic Subscription and then purchase an Advanced Subscription at a later date. 

Licenses are tied into a product. Create the product as you normally would in commerce and once you enable the license module it adds an additional field where you can specify any reference to which license it applies to. This workflow would apply to authenticated users, not anonymous users.

Documentation on drupal.org


Subscribe to our newsletter to get more updates on modules, Drupal and open source news!