Auto-referral Doesn’t Work

Hi there,

We have enabled the option “Allow auto-referrals” and when we generate an affiliate link to a product and use that same link to purchase the product, we expected a commission to be calculated for the affiliate, but it doesn’t.

Would there be another setting somewhere that could prevent the commission from being applied?

We also use the WooCommerce integration with the Product_rates method.

Waiting for your feedback!

Kind regards,

8 Responses to Auto-referral Doesn’t Work

  1. Bastien January 19, 2016 at 9:26 pm #

    I think Affiliate Permanent works as it is expected to work.

    Is it possible that the problem comes from the Product-Rates method?

    I don’t see how “self::set_referrer( $user_id, $affiliate_id );” or “$result = self::get_referrer( $user_id );” could affect the auto-referral process as it only involves the “permanent_referrer_affiliate_id” user meta value.

    I think that as soon as Affiliate-Permanent is active and that a value is assigned in the “permanent_referrer_affiliate_id” user meta, the permanent referrer (permanent_referrer_affiliate_id) is preferred over the original referrer.

    Just like Affiliate Product wasn’t compatible with Enterprise tiers, I think that Affiliate Product is not compatible with Affiliate Permanent and that there’s some sort of clash between the two, as if it would either calculate the Product commission, or the Permanent commission, but not both. Would it be possible to fix this?

    At this point I’m really not sure what to look for 🙁

  2. Bastien January 19, 2016 at 8:59 pm #

    UPDATE :

    Amounts were calculated fine, my bad. At some point when I deactivated “Affiliates WooCommerce Integration” it changed the calculation method from ::product-rates to the default referral amount method, that’s why it wasn’t showing anything in the amount.

    There is still a problem with auto-referrals and affiliate permanent though.

    If I remove the following from class-affiliates-permanent.php :

    add_filter( 'affiliates_service_affiliate_id', array( __CLASS__, 'affiliates_service_affiliate_id' ), 10, 2 );

    The auto-referrals are working. So it seems something wrong is going on inside “affiliates_service_affiliate_id()”

    I’m trying to figure out how data are manipulated by this function, will update you if I find something…

  3. Bastien January 19, 2016 at 7:47 pm #

    Tested a few things…

    -> When Affiliate Permanent is active, a purchase by user BBC referring himself store a referral only to Direct…
    -> No amounts seems to be calculated
    -> I checked the user, BBC, and it was assigned permanently to Direct
    -> I changed the assignation to “Not assigned” and uh… Now the auto-referral is triggered but no amounts are calculated.

    Shouldn’t the referral be calculated the same if an user is assigned to an user or not assigned?
    The only difference being a commission would be calculated to Direct/Permanent-Referrer if it exist. But I don’t understand why that would change the original referrer.

    After making a purchase, the user BBC was permanently assigned to BBC (himself). I made another purchase, and the referral showed, but without any amount.

    I assigned the user BBC to Direct again and made another purchase trying to auto-refer myself. The auto-referral was not stored for user BBC, but it was stored for Direct with no amount calculated.

    It seems that Affiliate Permanent prevent Affiliate WooCommerce from returning the commission amount and interfere in the auto-referral process.

    I’m not sure what to do at this point though.

    Waiting for your feedback!


  4. Bastien January 19, 2016 at 6:01 pm #

    (for the auto-referrals not working)

  5. Bastien January 19, 2016 at 6:01 pm #

    Hello guys,

    I have identified the problem to come from Affiliates Permanent.

    I’ll try to check for something in the code but I’d appreciate if you could take a look too as you are best equipped to analyse the source.


    Kind regards,

  6. Bastien January 18, 2016 at 9:01 pm #

    Hey George,

    I have installed the latest version made recently available and did some more test to check for auto-referrals and it still didn’t work.

    Have you had the time to check what might be going on here?

    We’d like to open the door for affiliates by February and auto-referrals and permanent association with new user registration are the two last issues we have to address.

    Thank you for your help!

    Kind regards,

  7. Bastien January 8, 2016 at 5:09 pm #

    Hello George,

    Thank you for the reply. That’s what we tested yes but unfortunately it seems it’s not working.

    The referral is recorded under Affiliates>Referrals for the parent affiliate (we use Affiliates Permanent and the affiliate trying to refer himself is assigned to another affiliate). However there’s no commission calculated for the auto-referral.

    Waiting for your feedback.


  8. George January 8, 2016 at 10:38 am #

    Hi Bastien,

    Auto referrals option is used for affiliates to refer themselves. When an affiliate link is used and a purchase is made using the affiliates credentials in checkout, the affiliate is granted a referral for referring himself.

    Is the referral recorded under Affiliates>Referrals?
    Do you also use Affiliates Permanent?

    Kind regards,

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account