After much requesting by users, we finally have a support for roles in Ubercart. The uc_roles module uses our new & spiffy product feature system to create role assignment as a feature to products. When you add a role assignment feature to a product you can specify the role it grants and, optionally, the amount of time until the role expires. Upon completing payment of their order, customers will then be granted the specified role. Users can be notified of changes in roles (adding roles, losing roles, upcoming expiring roles...) and can see the expiration date on their user page if permitted by admins. Admins can change the default settings under the product feature settings (admin/store/settings/products/edit/features), change what notifications users receive regarding role status (admin/store/settings/notify/edit/role), and view and edit current role expirations for users (admin/user/user/expiration). Pick it up via bazaar per usual.
uc_roles is now in ubercart core
|
|
Awesome! Will update to bazaar code now.
this sounds great in relations to file products, user will have access to their files only if they are of a particular role.
Hi Shawn, Andy, and everyone in Ubercartland,
This is really great news! In our applications, we are granting roles on virtually every product purchase so it's awesome that support for role granting will now be included as part of Ubercart core.
Just one question: Is there any chance that the "file product" contrib module (which enables electronic downloads as products) could be included as part of Ubercart core?
I view support for electronic products as essential to almost all of our potential stores and even when we are shipping physical products, we often make electronic bonus files, Adobe PDF instruction manuals, etc. part of the of specific product offering.
It's also yet another great application of the new product feature system.
I also think including the file product contrib module as part of core would lower the barrier of entry to new Ubercart users (helping us grow the community) since a lot of emerging web stores sell only electronic products and might be scared by having to add-on a contrib module that may or may not be updated/compatible on a regular basis.
Including file products as part of Ubercart core would also encourage internationalization as some companies (such as us) sell physical products within the U.S. only, but will sell downloadable electronic products anywhere throughout the world.
Would be interested to hear the thoughts of others....
Thanks,
Ben
I've asked Shawn to tackle that next... these two things were the most requested features on the forums and at Drupalcon. We should be able to turn out some very cool install profiles in the near future for restricted access sites and download sites. 
I'm testing the roles module out now, and I'm not sure when exactly Shawn will get on the file downloads bit... hopefully we'll be able to work in conjunction w/ CpILL to get it done before Alpha 8.
I'm beginning preliminary work on the bringing the digital downloads to core. Right now I'm trying to build a list of most needed features and how to implement them. I'm also going over cPill's implementation to see how his solution works. As far as time, I've never been good at estimating time to complete coding projects. It took me a week to hammer out the uc_roles module, but I know this module is going to be more work than uc_roles. How about we say the release is..."when its finished" 
I would also like to hear other people's thoughts on what is needed for a file download product feature.
+1 for file products in core!
I just wanted to give a huge thanks to Cpill and Aymerick for contributing roles and file downloads, the two most "coreworthy" modules yet released for Ubercart!
Peace,
Andy
i'll double the thanks on what andy said and then add some thanks to shawn for rolling this in to core.
regarding features, i can't be too specific but can generalize. questions always seem to popup surrounding:
1) anonymous versus private files and the need for things somewhere in between (i know that sounds like an oxymoron and probably impossible but that seems to be the case).
one issue that comes up and this might be an area where uc breaks from drupal and develops their own solution is the ability to have "real" digital file mgt the backend "by user" and or "product". Meaning that instead of just lumping all digital downloads into one single server directory in the filesystem, a permissions based system is enforced on subdirectories so that the digital downloads can be better organized on the backend. It also would allow for individual user files on a community site to be isolated from eachother. often drupal is either an all or nothing proposition. either all anonymous users have access to EVERY FILE or all LOGGED IN USERS Have access toe every body ELSES files. Not sure that statement is 100% accurate but i believe i've run into similar scenarios.
i think your uc role module will probably restrict some of the access to files even if all in the same directory but i'm not sure a directory based permission system wouldn't be more beneficial.
2) anything that implements this in a way that is secure as possible and discourages pilfering.
the biggest thing i see in this regard is a way to allow customers to sample the final product BEFORE purchase without giving away the entire goods. to my knowledge there are no real 100% proof ways to do this unless you own a streaming (and very expensive) server. and even that's not 100% because you can stream record in real time. However, i've seen a variety of discussions about disabling download caching via php and other php techniques, etc that help prevent local download caching, etc.
3) methods of access: either the ability to download locally versus accessing directly on a store website. again this is somewhat of an oxymoron in the sense that that anything you display in your browser is going to be "downloaded" to your cache. however, there *is* a difference between logging in to a site and being able to view content "on" the site (e.g. browsing it) versus gaining access to a link 1 or some limited amt of time and downloading the object "outright" to your local pc.
i think i've seen discussions where php is used to generate random number "ids" for direct site product access or download links that expire (much as the user roles you just developed). this means that after a purchase, the product link itself expires as well and could possibly generated and unique for each customer that purchases a digital product.
This might be overkill for "role based" purchases but it actually might help enforce some "limitation and security" on anonymous downloads. e.g. the sample download links automatically timeout and are always changing to prevent having them up all the time.
ok, i'm mostly shooting from the hip and some of the above could be wrong but i've done some surfing on this issue in the past and never got down to writing my own module. generally the two most common issues are "how do i prevent soemone from stealing my stuff" and "how can i manage the files on my server's file system optimally and then make them available in a useful and secure way via apache/php/mysql".
you asked for any input. so i gave it
.
good job on the rules and the upcoming file products.
Here are my 2 cents:
first, I don't really like the way that the my files works now in drupal, seems more of a user storage thing than a file download.
The process that I think is needed is:
any one can purchase a file product: anonymous and logged in users.
once the file is purchased it is copied out of the directory (under the root) into a dir over the root.
a mail is sent to the user with a link to download the files.
this link should expire after X amount of time and/or Y number of completed downloads.
there should be an ability for the admin to set these up, preferably different for each product + defaults.
the links can be displayed in a some sort of node like the my files in order to double up on the email link.
once a product is purchased by an anonymous user, the user should/should not be automatically registered with email/name/random/inputed field as user name and random pass.
it should be important to organize the files, maybe according to categories in the directory.
there should be some support for multiple formats to choose from - mp3/wav/wmv.
some kind of support for images as file products maybe with watermark.
come to think of it...if it could be possible to keep the format handling/sample the goods out of the core module, and create something like the shipping methods so other modules can plug into that and handle each format according to the module.
That's what I got...I really think that if this will be done, and really done right and fully it will make ubercart the must have sollution for digital e-commerce sites.
Idan
+ Flexible price, to let the customer set or change the price of the product. Like How Radiohead is doing with their mp3 downloads.
Hey all, I just posted a new topic devoted to integrating downloadable products (File Product) into core. Check it out here: http://www.ubercart.org/forum/development/1296/file_products_downloadabl...
My initial belief was that I could assign a role and its expiration on a by-node basis (so as to create several different time lengths), but after some headscratching, I'm only only able to set a global setting at /admin/store/settings/products/edit/features, does Role Assignment not work on a node-by-node basis? I was expecting an option in the 'edit' tab of my product node.
I guess I'm just wanting more than there is?
You're close... the settings you mentioned are just for some global things, like what's available to add to products. In the product edit form, there's a "features" tab where you can add features to products like expirable role promotions. You should find what you're looking for there. 
A Features tab like the 'View' and 'Edit' tabs? If so, I'm not seeing it. Other than enabling the Roles module and editing the global role settings, am I missing something with regards to configuration?
I'm on a fresh 5.2 install with the latest ubercart version via bazaar.
It's actually a subset of the "Edit" tab. So, click on edit and a second row of tabs will show up... if not, it could always be your theme isn't displaying them properly. To see what I mean, browse to node/##/edit/features where ## is the nid of one of your products.
You're right, it was a theming issue preventing the subset from displaying. Thanks for the help.
Another issue I've got now -- after adding a role assignment and submitting it, I get 2 errors returned:
user warning: Unknown column 'duration' in 'field list' query: UPDATE uc_roles_products SET duration = 1, granularity = 'year' WHERE pfid = 4 in C:\www\xampp\htdocs\testdru\includes\database.mysql.inc on line 172.
user warning: Unknown column 'shippable' in 'field list' query: UPDATE uc_roles_products SET shippable = 0 WHERE pfid = 4 in C:\www\xampp\htdocs\testdru\includes\database.mysql.inc on line 172.
Re-editing reveals that the expiration date is not set.
Oof.. that was a bug with the install file/update functions. Look in there and you'll see the queries where a couple table columns were renamed. Make them manually for now, and I'll double check the file to make sure it's correct. 
Great to see management of roles in core, and now I don't have to maintain uc_role contrib anymore 
The new uc_roles module is great, with a lot of improvements, good job guys !
Your modules were a good help when the job was getting done. It's great that others have been contributing while we work on core so it's easier to get some of these features in core. 
Hi there,
The role purchasing sounds great. Is it possible to assign a role a certain amount of pre paid credit. Ie. when a user purchases a role they receive prepaid credit to their account, that expires after a certain amount of time?
thanks
No, that would be need to be implemented through some other module. uc_roles only enables temporary/permanent roles to customers, it doesn't act upon those roles. We've talked about bringing discounts, gift certificates, coupons into core but so far its just been talk. There's a discount module in our contrib section though I haven't tested it out yet. You should give it out a try to see if implements what you're looking to do.
Do i need to configure something for the roles to work? I have i enabled the module but when i try to add it as a feature on a product the role droplist is empty.
Yeah, go to the product settings form and check out the features tab. You need to enable certain roles as valid options for the product feature.
A pretty cool addition, but one with some issues.
From /admin/store/settings/checkout/edit/panes under Customer Information settings, I check Allow anonymous customers to specify a new user acount name and Allow anonymous customers to specify a new user acount password. (BTW account spelled wrong in both lines). Actually, it does not matter whether I check these or not, the option still shows up.
The main problem is that when an anonymous user signs up and specifies an account and password, but uc_roles ignores both. It sets the user name to the user email (very ugly) and sets the password to a Drupal default. Any recommendations for either how to fix this, or for how to hide this option from the users? Any help would be appreciated.
Spelling typo fixed. Thanks.
To get to your problem. This wouldn't have anything to do with uc_roles, BTW. The code that sets up new accounts is in uc_cart What version of Ubercart are you running? The latest bazaar release I'm working with, the behavior or these options work as expected. If you know how to troubleshoot by editing PHP files you can find the code that displays the new account form fields in the function uc_checkout_pane_customer in uc_cart/uc_cart_checkout_pane.inc.
I posted this again at http://www.ubercart.org/forum/support/2450/problem_anonymous_customers_a... because I was told posting it here was a mistake - but you replied anyway. Thanks and apologies both.
My version is 5.x-1.0-alpha8. I enabled all of Ubercart core, as well as notify payment and roles in core optional, and paypal, credit cards and authorize.net in payments. Am I possibly missing something vital? Could user node/node profile cause conflicts?
I checked out the code you referred to and I can see that if I need to I can prevent those form fields showing up. However, I'd prefer to have them work. Any pointer to where the code that actually adds the user is?
I should also add that I'm using Ubercart to sell roles and nothing else.
Reply above. Not sure if I replied correctly.
Can you upgrade your installation to the latest bazaar release? Right now, my test installation working off of the latest code exhibits neither problem of the displaying the Username/Password pane or creating the account with the Username/Password that the anonymous user specified.
Thanks for that, but I had no luck I'm afraid. Same problem with the latest version (which was vastly different to what I had before). I'll have to go into the code since I see uc_cart_complete_sale defaults to the email when $_SESSION['new_user']['name'] is blank (uc_cart.module). Not sure why or if I can get the data elsewhere, but I'm going to give it a go, or otherwise I'll have to force a two-step process (sign up and then subscribe).
Plus I see that orders now remain in pending status, so PayPal and my site don't seem to be talking any more. I do believe I've gone backwards the past few days, with less working than before.
EDIT: I'm going to try this functionality with a clean install of Drupal. I'll let you know how it works out.
I just wanted to let you know that using a fresh install (from the Drupal release, not the zip file you posted) with only the modules loaded that Ubercart needs I got the user portion to work. I'll continue to tweak the new version and see if some other module conflicts with the settings again. Just for your information, on my main site these are all the modules I had loaded, even though many had been disabled and uninstalled if possible. I'm guessing one of them stepped on your $_SESSION variables, or on the conditions under which they are set.
bbcode, bio, captcha, captcha_pack, cck, cck_address, cck_address_extensions, cck_button, devel, devel_forminspect, dhtml_menu, email, filter_default, forum_access, imce, link, lm_paypal, nf_registration_mod, nodefamily, nodeprofile, pageroute, pathauto, phorum, quicktags, retease, site_map, smileys, subform_element, tapir, tinymce, token, ubercart, ubrowser, usernode, views, views_bonus, views_fusion, workflow_ng
Please let me know if any of those concern you or are known issues. My money is on lm_paypal, which I had deactivated (had no uninstall) and will not be reinstalling, just because it too was also doing role purchases and seems a likely target because much of what it does doesn't conform to Drupal standards. I'll keep you informed if I find out more. Thanks for your time and help and for your overall efforts on ubercart.
Got a question about multiple roles that may or may not be an issue.
Is this supposed to allow assigning MULTIPLE roles by purchasing one product? Or must an individual product be purchased for every individual role?
I have an Ubercart Alpha 8 install on my site and I have products that assign roles. One product is a Background Check with Registration Fee that is supposed to assign 3 roles when purchased (created and listed in this order under Features):
Role 5 for 6 months
Role 10 for 6 months
Role 6 for 12 months
It seems that only the last role, Role 6, is assigned properly to the user. At first I thought this might be a bug in the Product Kits module, so I blew away the Product Kit (that did the same thing during testing, only assigned the last role, Role 6) and just created a new product to assign all three roles. This new product when tested did the same thing, only assigned Role 6, the final role.
Any ideas? Any special pitfalls when using multiple roles? Thanks much! 
Yes, uc_roles should grant multiple roles if you've added multiple role assignment features. Have you checked that all the roles have had their SKU set to "Any" or the SKU of the product?
Initially, I had the different product features set to allow only that particular SKU to access the role feature. On your comment here, I went back and set them all to allow Any SKU, but the problem persists. Although 3 roles are set up to be assigned on purchase, only the final role in the setup is delivered to the user account.
All roles of course are also set up to be used by Ubercart in the Store Configuration.
The option to purchase roles for others.
If the uc_roles module allowed users to purchase roles for other users, we would have the equivalent of a gift cert.
I know this has been discussed already, but I'm wondering if this type of functionality could become part of uc_roles.
E.g. you would set up a product called '$50 gift cert', then you would add the 'feature' called 'role assignment', and then 'roll assignment' would have an additional option to enable a form for users to add the email address of the person to whom they want to assign the purchased role. If the recipient does not have an account, an account and temporary password would be created for them.
None of the contributed discount modules offer this type of functionality, and I wonder if it may be something that could come from the uc_roles end of things.
We have started a discussion regarding discounts, coupons and gift certs that you may find useful. Here is the link:
http://www.ubercart.org/forum/general_discussion/2549/battle_plan_uc_dis...
Cheers.
A few more questions:
What version of Ubercart are you using?
Have you made sure the user account doesn't have any of the roles specified before making the purchase.
What order status have you set uc_roles to assign the roles on?
- Cart Build: Ubercart Alpha8 (out of box, no hacking or mods)
- Before I run a test, I go in and clear those roles.
- The roles are set to be delivered on order Completion.
And I noticed something as I just went and performed yet another test.
First off, in the Store Order View, all of the tests confirm that the desired roles are being assigned to the appropriate user. Yet looking at that user file under Administer > User Mgmt > Users does not show the roles, and simple tests to confirm the role being present fail. So the role really isn't there.
Each time with this test user and this triple role product, it's the Approved Employer role that's being assigned, while Approved BGC and Approved Employee do not get assigned. So of course, at the end of the test, I remove the Approved Employer role (the one that actually was given) and then run the test again. But here's what shows up in the Order View for the test.
Date__________________ Comment__________________________________________
01/14/2008 10:37:16 AM Credit card charged: $1.00
01/14/2008 10:37:19 AM User has had the approved employee role renewed.
01/14/2008 10:37:19 AM User has been granted the approved employer role.
01/14/2008 10:37:19 AM User has had the approved bgc role renewed.
The system is registering that the user already had approved employee and approved bgc, and is RENEWING them, even though they still don't show up post-sale in the User list and pages which are set to only allow those roles fail to find the roles. It does see the approved employer as being missing and so GRANTS the role.
________________________________________________________________________
For this last test, I removed all Workflow conditions that would affect the Ubercart system post-sale and tried again. (Initially when I set up Ubercart, I had an issue where once the credit card payment was charged, all purchases would default to Pending rather than being automatically set to Completed. Looking around at some of the solutions on the forums here, I used the solution via the Workflow module to check the incoming order, determine whether the balance was zero, then change the Pending order to Completed.)
With the Workflow conditions deactivated, I ran another test using a new fresh account that had never purchased a role-granting product before.
First, I run into the problem again where it defaults to Pending, even though the credit card was charged $1.00 and the authorization was received back from the credit processor and shows in the Ubercart order view.
No roles have been granted, of course, because roles are set to be granted on Completion, and the order is at Pending. So I manually change the order status from Pending to Completed, at which point the final role in the 3 roles contained in the product is the one granted to the user, "approved bgc".
Looking up the user under User Mgmt > Users confirms that the "approved bgc" role is the only one now granted to the user. However, when I look under Role Expirations while editing that user, I see now that there are THREE Role Expiration contingencies all set up as if the three roles had been granted successfully, even though only one of those roles is checked and displays above the Role Expiration section as having been granted.
Order results are as follows:
01/14/2008 11:16:48 AM 35 Credit card charged: $1.00
01/14/2008 11:16:50 AM - Order created through website.
01/14/2008 11:20:57 AM 21 User has been granted the approved employee role.
01/14/2008 11:20:57 AM 21 User has been granted the approved employer role.
01/14/2008 11:20:57 AM 21 User has been granted the approved bgc role.
Don't mean to blow out the thread here, but I figured more info was better. I know this is a screwy issue, Shawn, I really appreciate your help on this!
Do all of the roles show up in the uc_roles_expiration table, or just the one? It seems like if they are all getting set in the database, just not being reported in the order or user areas, then it might not be the function isn't working - maybe it's just the reporting that isn't.
If you create a new role and a page that only that role can access, you might need 3 pages (one for each role) - and check to see if you can access all three pages. If so then it looks like all 3 roles are getting assigned.
Just scattershooting here.
All of the roles that the product should bestow do show up in the uc_roles_expiration_table for the user that purchased the product.
I've peeked into the raw data on the db... the desired roles appear to show up everywhere with the exception of the users_roles table for Drupal. And since the roles aren't bestowed in users_roles, no standard scripting will be able to verify the roles without a query hack.
So to Drupal, the roles don't exist. The role subsystems and Ubercart sees them and assigns them correctly, but the link between Ubercart and the users_roles appears to be buggered somehow.
Can you upgrade to the beta 1 release? It sounds like the problem you're having is the same as this issue which has been resolved between alpha-8 & beta 1.
I'll do that. I thought I was still caught up with the newest version actually. I'll load the new system and run another test and let you know. Thanks again for the assistance!
Okay, I completed the Alpha8 -> Beta1 upgrade, and I'm having the same issue. Did a complete file replacement, ran the update to update the schema, and it looks like the same things are happening. Multiple roles fail. Should I continue this over at the similar uc_roles fail when setting multiple roles thread? Thanks.
Hmm, I don't know what to tell you. I've pulled ubercart beta-2 out of the box off of d.o and I installed it, created a few roles, created a new product that assigns roles, and when I set the order status to completed all roles were assigned. The bug you have sounds definitely like the one mentioned in the link, however that should have been nailed. Is your test server out on the net? If so, you can PM about a way to access your site. I would definitely be interested in seeing what's going on there, but with out all the details it will be tough to see what's going on.
I apologize if this question has been answered before. Our requirement is as follows: display a teaser (or intro paragraph) for an article and then present the visitor with the option to subscribe (and request payment) in order to view the full article. So, once a visitor has paid e.g. for articles under a section called let's say MOVIES, their subscription allows them to view all MOVIES articles. Visitors should be able to subscribe to more than one section, each section paid for separately. Is this possible with Ubercart?
many thanks.
Drupal/Ubercart by itself can't restrict access to certain nodes by itself. To restrict access to certain nodes you'd have to use the Drupal core taxonomy module and a module like TAC lite or Taxonomy Access Control. Once enabled, you can add a taxonomy to nodes that can only be viewed by a certain role that you create. With that role and taxonomy in place, you can start selling the Role you created with the Ubercart Roles module.
First I'd like to say WOW, what an amazing module, congratulations guys!!!
Second, my apologies if this is answered elsewhere.
I want to sell membership roles for my site. I've set up a "full membership" product that the user can buy and checkout with, which upgrades them to my "full user" role once payment is approved. NICE.
The trouble is, I don't want them to be able to add multiple "full memberships" to their cart before they checkout. So it would be good to be able to remove the product from the product list once the user has added it to their cart once. What's the easiest way to do this?
Thanks in advance,
Peter.
wotstheguts,
I'm just starting along the same path you're taking whereas I'm setting up UC to take care of User Registration payments. I have a quick question: Are you following any particular recipe to walk the user through the process of payment and registration? Is there a recommended set of steps to follow to get started?
Thanks in advance,
Mikep
Hi Mike, I'm afraid I don't have much information yet, but I found that the workflow-ng module (used by ubercart) is superb for directing people to the products screen after first registering, or on logging in, and has a lot of other application besides.
In ubercart I just set up a few different products for various lengths of membership, and assigned them different roles and expiry periods. I also created a role and product for "featured" where they can pay for home page exposure.
As I said, my main issue is that you can add a 1-month membership, for example, to your cart as many times as you like, which doesn't make sense (my 3-months and 6-months membership will be discounted). I need to allow users to only buy one role at a time.
I have to take a break now for a week to study for a philosophy exam, but if you like I'll put together some steps once I'm back into it.
Cheers,
Peter.
I'm not sure that type of thing is easy out-of-the-box .. but I could see it being done with the following steps, in a custom module (for a custom product type).
- Create the custom product type
- Hook into hook_product_info and set the access variable to a module-specific access level. Something like "can purchase subscriptions" - this access level is made available for only the subscriber role. (In other words, when you purchase the subscriber role, this role and permission is added to the user)
- Limiting one subscription in the cart at a time is easy enough to do (search for it on Ubercart.org)
- It's also easy to disable the "amount" field in the Cart Review page (/cart)
So I think with all the things combined, you could make it so that:
a) Only your regular authenticated users can buy the subscriptions
b) Only one subscription allowed in a cart at a time (you could make different levels unique products or options)
c) Once the subscriber role is purchased, set it in your user Access Control area that the Subscriber role does not have the permission "can purchase subscriptions"
This is just some ideas I have, I haven't actually tried it. But it sounds good in theory.
(Spitballing ideas is my specialty!)
My only real question mark remains in how the permission is inherited, if at all; since the subscriber role is really a child role of Authenticated user... unless the idea of "unchecking that permission for that custom role" doesn't work in practice...
My objective is simply to take someone through the registration process and collect money via PayPal Standard along the way. I'd like this to be as simple as possible for the user to maximize sales.
At a minimum I think I only need the user to complete the Username/Password and Payment sections. I can take them through other screens (such as Organic Groups etc.) via a Pageroute. Although I'm quite comfortable with Drupal and many of its modules, I'm not comfortable creating a new module at this time.
Would someone be so kind as to write a simple recipe for me to build a simple user registration process? I guess the part that's confusing me most is once the user completes the PayPal screens, how does it update his/her user account with the Role that is included with the purchase?
Thanks a lot in advance,
Mikep
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.
Peter,
Thanks for getting back to me on this. I did hack a workflow together but will likely make a few changes based on your email. I'll post back with any questions along the way.
Thanks again,
Mike
hi, i was just wondering if uc_roles conflicts with any other role granting module (ie autoassign role) ?
basically, my setup is that i have 3 roles that are subscription based and therefore should purchase the role via ubercart. then i have 1 role that isn't subscription based and that is set when an anon user registers via normal user registration (i use autoassign for this).
but for some inexplicable reason uc_roles stopped working the way they're supposed to. all orders are being processed properly and i have my uc_roles set to grant a role based on the product being purchased, but the roles aren't being granted. hence my question. 
also, i have autoassign roles, set to "User Role Assignment" and it isn't a required field. so i really dont know why uc_roles wouldnt be working. 
im using the latest bzr release for ubercart. any help would be greatly appreciated.
thanks,
sarah
I suppose some conflict is possible since they both have to do with the user object and actions. I'll take a look at the autoassign code to see what's going on.
Auto assign role is pretty simple, and I didn't see anything in it that would conflict with uc_roles. Wish I knew how to look for what's wrong.
you and me both. ill keep looking and let you know if i see anything.
thanks again.
[edit] a few hours later ...
anyway, turns out that uc_roles isn't assigning the role upon completion of the sale through the TEST gateway of ubercart. BUT when i use the paypal sandbox and complete a sale, the role is assigned. so, i should just disable the test gateway for the meantime and use paypal's sandbox.
hehehe! i dont know why i am so happy to have it partly figured it out. but its not completely solved just yet. it just moved issues.
now, why isn't it working for the test gateway? *scratches head* ill try to figure that one out when i get this project out of the way.
im excited to get this one out. 
Now that's very strange because I set up a role product today and it worked fine with the test gateway. I was used a Workflow-ng configuration to set the order status to Completed when a payment was entered.
could be a mess up on my configurations. but ill check it later on. i also have workflow-ng configured to set the order status to completed and roles are set to be granted upon order completion. ill look into it some more and post my findings.
[edit a few days later]
oh lyle! i hate 'bugs' that fix themselves without bothering to explain the hows and the whys. after i threatened the code (as forcefully as i can at 4am, i might add), and after disabling both payment gateway options and re-enabling them, it _just_ decided, for the heck of it (to mess me up, im sure) to work.
so there. im considering it case closed until it decides to act up again. thanks though. 










Joined: 08/07/2007