Using Workflow-ng with Ubercart for membership process

Posts: 3
Joined: 02/07/2008

torgosPizza, thanks very much for your ideas, much appreciated. I'm still on the steep part of the learning curve for coding in Drupal, so I won't be taking that tack just yet! Instead I've adjusted my requirements so that I can use Ubercart out of the box. I've noticed that it handles role expiry perfectly, so that when I add another "1-month membership", it adds the expiry dates. So it's OK to be able to add more than one membership.

Mike, sorry it's taken me so long to get back. You've probably figured out your own way of doing it by now but, for what it's worth, here is my "recipe".

Firstly, I use the nodeprofile and usernode modules to allow users to create detailed user profiles. Then I create a "Full Membership" role.

In Ubercart, I create several different product nodes - 1-month, 3-month, 6-month, and 12-month membership, e.g., "Full Membership (1 month)". After creating each node, I edit the node and go into the Features tab and create a role and expiry period.

For testing Ubercart's role assignment feature, I set it up so that users gain their new role as soon as the order status is set to "Pending" when users place their order. To do this I go to Store Administration -> Product Settings -> Product Features -> Role assignment settings and change Order Status to Pending. So the role will be assigned as soon as the user clicks on the "Submit Order" button. When testing is finished, it can easily be changed to assign the role when order status is set to "Complete".

I use Workflow-ng instead of Pageroute because it seems a lot more powerful, flexible, and easier to use. I set up Workflow-ng to intercept users during their registration process and take them to the user profile page, then after that, taking them to the Ubercart "Products" page so they can purchase a membership.

The following workflow configuration assumes that the nodeprofile module is installed and enabled, and that a node type "User Profile" has been defined. My workflow depends on whether "Require e-mail verification when a visitor creates an account" is checked in the "User Settings" page. If email verification is turned off, I use the following workflow:

Set up action called "Redirect to user profile after user registered" or something like that.
Invoked on event: User has registered
Conditions: None
Actions: Page redirect
To: user/[account:uid]/edit/userprofile
Options checked: Override another path redirect by setting the destination parameter

If email verification is required, I configure the following workflow instead:

Set up action called "Redirect to user profile after user account updated" or something like that.
Invoked on event: User has updated his account details
Conditions:
NOT User has nodeprofile (check the Negate box for this option)
Arguments configuration:
User: updated user
Node Profile Content Type: User Profile
Actions: Page redirect
To: user/[account:uid]/edit/userprofile
Options checked: Override another path redirect by setting the destination parameter

Once the user has entered their user profile, I want them to be presented with the option of choosing a membership level to purchase. The following workflow will redirect the user to the Ubercart "Products" page after they have created a "User Profile" node.

Set up action called "Redirect to products after user profile created" or something like that.
Invoked on event: Content has been created
Conditions:
Content has type
Arguments configuration:
Content: created content
Content types: User Profile
Actions: Page redirect
To: /products
Options checked: Force redirecting to the given path, even if a destination parameter is given

This seems to work nicely. Hope it's been of help!

Cheers,
Peter.

uc_roles is now in ubercart core By: Shawn Conn (62 replies) Mon, 10/08/2007 - 11:25