[Drupal] How to create a time based subscription using ubercart
In Drupal we can create a time based subscription for a user for a given role. The user will be assigned to that role for a certain limit of time, after that the role will expire. The subscription will be based on Ubercart product. When a user purchases the product, account of user is upgraded to a specified role for a given time limit. The user can also renew for the role by purchasing the product after end of subscription.
The following the steps to upgrade an ubercart product and to set role per product subscriptions.
- Create a new role to be assigned after product purchase.
- Enable Roles module from module list(admin/build/modules/list).
- Go to Admin->User Management->Roles(admin/user/roles).
- Set permissions for that role by going to Admin->User Management->Roles
- Now configure the product module
- Go to Store Administration->Configurations->Product Settings (admin/store/settings/products/overview).
- Under Product features->Role Assignment Settings, set the role that you have created as the default role.
- In product role check, grant the role to the users whom you want to purchase the product.
- Set the expiration date for the product.
- In the product feature settings.Add new product feature for role assignment.
- Set the appropriate SKU and uncheck the Shippable product checkbox.
- 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.
- If you want to override the default expiration period check the Override Default expiration period checkbox(Go to admin/user/roles/edit).
- Checking on the conditional actions assigned for product renewal
- checking on the conditional actions at admin/store/ca/uc_role_renewal/edit/conditions.
- Under conditions order status set to completed.
Hope the above helps to set time based role to a user with ubercart product subscriptions.