Hello, I love the module, great features, well written code. I've been going through trying to figure out how to integrate userpoints, as I am using the "Store Credit" module, and would like users earnings to be stored there. This allows them to cash it out or spend it on the site immediately. I saw that you said it would be too much coding, and someone else is welcome to attack it.

What about rules or conditional actions integration?

This would fix the userpoints situation as well, as it can be triggered by site/ubercart actions.

Usages:
1- Set/Remove affiliates using triggers (their affiliate joined a mailing list, created a node, etc)
2- Award users fixed rate, on any product! (You could award $0.25 for their affiliate joining a mailing list) Or bonuses if the affiliate has purchased X number of products or spent X dollars.
3- Award userpoints on product purchase, or any other site action
4- Rule based Redirects based on affiliate
5- Mailings, notifications, etc can all be triggered by rules.

Rules needed:
Condition:
- Has Affiliate?
- Product purchased (already in CA, not in rules)

Actions:
- Assign Affiliate
- Award comission or fixed amount

What are your thoughts? Is this the place to put this type of integration?

I'm willing to see how I can contribute, but someone with more experience with coding rules/Ca would probably be able to bang it out pretty quickly. Especially with the api.

Comments

keyinsight’s picture

This functionality is critical for my project and I need it yesterday!

I am willing to sponsor development if the price is not too high.

I believe the ability to tie uc_affiliate2 with userpoints will significantly improve the value of this module for many drupalrs.

I hired a coder at oDesk to do this for me last week, but he dropped the job.

Can you help us... please?

2ndChanceTech’s picture

It seems not many modules integrate with rules or CA enough. There's no need for it to be a dependency, and it allows methods of integrating with other modules, through their rules/ca integration.

The main feature needed here, is to be able to perform actions (core, CA, or rules) on a users affiliate.

This could be accomplished by passing a users affiliate as an argument.

As of yet Affiliate, UC Affiliate 2, Referral, User Relationships and related modules, do not offer arguments for rules. Only one I've found is User Reference for cck.

if we can't have a solution to this, could someone help me with:

Retrieve UID of who referred a user to the site via php?

univate’s picture

Status: Active » Needs work
StatusFileSize
new12.88 KB

I have started some work to try and add some CA support, at the moment I am just needing a flexible method of altering the commission based on various criteria as well as emailing information about affiliate commission when they happen.

I have also altered how commissions are calculated so that per product commission work even when more then one product is on an order.

univate’s picture

Assigned: Unassigned » univate
Status: Needs work » Needs review
StatusFileSize
new22.01 KB

Ok this patch is ready for testing and should be able to committed without any adverse effects on any existing functionality.

New features:
* add token support
* add CA support

Changes:
* commission calculation done on each product and then added together rather then on the order total amount. This allows per product commission on all orders, not just single product orders.

One of the things I haven't solved is a simple way to specify a special commission amount for a specific affiliate and product, at the moment I can do it with the CA I have added here and a custom PHP action (but that is still messy and not editable from non-developers) - so looking for ideas for this...

univate’s picture

Title: Rules or Conditional actions intergration » Add Conditional actions integration

I have committed the above patch, as I think it adds some useful features (like emailing affiliates on new commissions) without effecting any existing functionality.

I will leave this issue open for the moment as I don't think it solves all the OP needs, but it should provide the foundation for new features - the only reason I posted my patches here was they where related to adding CA support.

2ndChanceTech’s picture

are you able to supply us with the php code you use to "specify special commission amount for a specific affiliate and product?". Even thought it's only suitable for developers, I myself could really use it as a starting point. Thanks

univate’s picture

@kryptik - I have added a new feature to do what I want instead here: #715872: Fine grained product commissions for different users and roles

bojanz’s picture

Status: Needs review » Fixed

Since we now have CA support, I'm marking this as fixed.

Status: Fixed » Closed (fixed)

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