Could someone please give me some PHP code to grant a badge to a user?

I am using Ubercart to grant users a role when they purchase a product, and would like to grant them a badge as well.

Comments

magnus’s picture

This probably could be solved with the Rules module.

1kenthomas’s picture

Well... if you were to peruse the module code... you should be able to find how it does that :)

Richard Blackborder’s picture

Status: Active » Closed (fixed)

I believe the module can assign badges when certain roles are assigned just using the user interface. Otherwise, the Rules module is always the way to go.