Documentation

User Documentation

Upon installing this package, there will be a new user attribute which stores a users points. This number may be regarded as the users social activity on your site. There are several ways that you can increase this number:

Referals: On install, there is a new page available at yoursite.com/refer. You can add a block to any page that will show users their referal url, so that they can earn points for inviting new users to your site. If these refered users sign up for your site, their referers will earn more points. 

Purchases: When a user purchases a new product, they will be given more points as well.

And More! This addon provides an easy to use method of adding points for third party applications. Contact the author of your favorite addon to see if they can add support!

You also have several tools to promote interactions. Points awarded will show the people that have won points most recently, and Top users will display the users with the most points.

Editing: You can edit existing ways that users can earn points in the dashboard, at yoursite.com/dashboard/reward_system/

 

When a user gets 5000 or more more points, they will be added to a new group. This group will contain all the users with 5000+ points. This group can then be given access to restricted pages, edit priveleges, discounts on eccomerce, and much more. Another group is activated when a user gets 10,000 or more points.

 

Developer Documentation

Check if the package exists:

 

$package = Package::getByHandle('reward_system');
if($package) {
//stuff here
}
Load model:
loader::model('reward_points', 'reward_system');
Add a new point category:
RewardPoints::addType($categoryHandle, $categoryName, $pointsEarned,$pathToImage);
Note that pathToImage is optional
update point category
RewardPoints::updateType($categoryName, $pointsEarned, $pointCategoryID, $pathToImage);
Note that pathToImage is optional
Delete Point Category
RewardPoints::deleteType($pointCategoryID)
Add Points

RewardPoints::addPoints($uID, $categoryHandle
);

Remove Points

RewardPoints::removePoints($uID, $pointsToRemove);

 

All you really need to get it working is this:

In package installer file:

 

$package = Package::getByHandle('reward_system');
if($package) {
RewardPoints::addType($categoryHandle, $categoryName, $pointsEarned,$pathToImage);
}
When something is done that should earn points
$package = Package::getByHandle('reward_system');
if($package) {
     RewardPoints::addPoints($uID, $categoryHandle);
}