This blog is about how to create a time based subscription using uc_roles.
Requirements: Drupal 6.x, Ubercart module, uc_roles module.
We can create a time based subscription for a user for a given role. The user will be subscribed to that role for a given period of time, after which the role will expire. The subscription will be an Ubercart product. When a user purchases that product the user's account is upgraded to a given role for a given time period. The user can also re-apply for the role by purchasing the product after end of subscription.
Prerequisites for this are an up and running Drupal installation.
1. Create a new role for a subscription.
2. Go to Admin->User Management->Roles(admin/user/roles)
1. Create a new role.
2. Set appropriate permissions for that role by going to Admin->User Management->Roles
(admin/user/permissions)
3. Go to Site Building->Modules (admin/build/modules/list)
1. Enable Ubercart core modules.
2. In Ubercart core (Optional) enable Roles module.
4. Go to Store Administration->Configurations->Product Settings (admin/store/settings/products/overview)
1. Under Product features->Role Assignment Settings, set the role that you have created in step 2.1 as the default role.
2. Under Product Roles check all the roles that you want Ubercart to grant to customers who purchase specified products. If you leave all roles unchecked, they will all be eligible for adding to a product.
3. Set the Expiration Period and other files as appropriate.
4. Save configurations to take effects.
5. Go to Content management->Create Content->Product (node/add/product)
1. Create the product by filling the form.
1. Make sure to give an appropriate SKU value.
2. Set the appropriate prize for the product.
3. Remember to un-check Product and its derivatives are shippable.
4. Save the product.
2. After saving the product, edit the product by clicking the edit tab on the product view page. Or simply by going to Content management->Content->List (admin/content/node/overview) and editing the product.
3. Go to the Feature tab on the product edit page.
1. Click the add button against Add a new feature and selecting Role assignment in the select box.
2. Select the appropriate SKU of the product. Also the Role that has to be assigned to the product after purchase of this product.
3. Make sure to un-check the Shippable product checkbox.
4. If you want to override the default expiration period check the Override Default expiration period checkbox. Leave it as it is if you want the default expiration period to take effect.
1. Select the end date as appropriate
2. Select multiply by quantity if u want user to be able to purchase the product more than once and multiply the expiration date by number of time the product is purchased.
3. Save feature.
4. You can test the feature by logging and purchasing a product as an authenticated user. After purchasing the product the user will receive a conformation email that the user role has been upgraded for a given time period.
This is a very easy and useful way to create a time based subscription for a user.
“The team at Blisstering took personal pride in their development work, even to the point of augmenting the product with improvements and enhancements in order to deliver the best solution possible.”
Gale Wilson-Steele
Founder and CEO
CareSeek
“It was my first time using a website development company, and as much as I apprehended the whole process, it could not have been easier. At Blisstering, they made the whole process much less threatening than it seemed by being pleasant, cooperative, helpful, creative. They were quick to start work on our CRM solution, and to get it to completion -- on-time and on-budget. I love the final result! I strongly recommend Blisstering Solutions, and with pleasure.”
R. R. Shah
International Marketing Corporation