The uc_roles module claims that it could be used to grant a role for a particular product purchase. I couldn't find any way to do it - among available actions in Conditional Actions (Ubercart 2.x) there is no action "assign role". In "product features" I selected a number of roles that I want to associate with products, but it doesn't get me anywhere if there is no available actions.
Has anyone done this - assigning (granting) role automatically on a product purchase?
Please help.

Thanks,

Vladimir

Comments

tr’s picture

Category: bug » support
Priority: Critical » Normal

Roles are granted directly by uc_roles, not through CA.

longwave’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Version: 6.x-2.6 » 6.x-2.7
Priority: Normal » Critical
Status: Closed (fixed) » Active

I changed this to 2.7, because this problem still seems to be present.

When I add a role as a product feature, I get this message:

Add roles through this page and then use the conditional actions interface to limit which orders they are applied to. Most important is the order status on which role granting will be triggered.

As calmforce noted above, there doesn't seem to be any conditional action to set a role.

If you view the tutorial in #2, it seems the answer is in the new "Role expiration" settings at: admin/store/settings/products/edit/features. But, in 2.7, the current version of uc_roles, there is no "Order status" box.

So, there's no box to set the order status that will trigger the role, and no CA action to set a role.

What version of uc_roles had the order status box picture in the #2 link, and why was it removed? Why is there no "add a role to a user" action?
All I saw was "renew a role."

So far, I cannot get a role to be assigned as a product purchase. I've tried both anonymous and authenticated users. I don't get any error message. They purchase the product, and yet the role is not assigned to them.

tr’s picture

Priority: Critical » Normal
Status: Active » Closed (fixed)

In the list at Grant or renew purchased roles, the CA is called "Grant or renew purchased roles"

Follow the link to configure the CA, or you set the status directly at admin/store/ca/uc_role_renewal/edit/conditions

Anonymous’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Active

Thanks for the quick response!

I see what my confusion was. I was adding a custom predicate, and looking at the list of "available actions." That list only includes "Renew the roles on an order."

Now I see what I missed at admin/store/ca: "Grant or renew purchased roles" near the bottom of the list.

Although, when I look at the "Actions" for that predicate, I still only see "Renew the roles on an order" -- nothing about granting them for the first time, but hopefully it still just works.

I will have to look elsewhere for why my roles aren't being granted. I'm not even sure what to post to help debug this. I have a fairly vanilla setup.
I'll look around.

longwave’s picture

Priority: Critical » Normal
Status: Active » Fixed

Grants and renewals are handled in the same operation, the action is correct, but perhaps we should rename it to make this clearer.

(also, please read http://drupal.org/node/45111 to learn how to set the "priority" field in issues)

longwave’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.