How send multiple referral to multiple affiliate on single order

I had affiliate enterprise and woocormmerce integration.

I create two types of group which is role group and team group:
– In the role group, the affiliate with different role will be assigned with different rate
– In the team group, any of the members in the same team group placed an order, the refer will send to
all of the members in the same team group and the rate will be followed with the role group that
e.g. TeamGroupA:
-member A (also in role group of Leader with 0.5 rate)
– member B (also in role group of Senior with 0.2 rate)
-member C (also in role group of Junior with 0.1 rate)
member B placed an order in woocommerce. All member in TeamGroupA will all get refer with the the
rate in role group.

How could I do that ??

3 Responses to How send multiple referral to multiple affiliate on single order

  1. George February 26, 2020 at 3:12 pm #

    Hi Hin,

    Yes of course but please keep in mind that you need to have advanced knowledge of PHP in order to implement this properly.

    In this example page you will find a description of affiliates_referral hook which triggers once a referral is recorded. The affiliate id can be retrieved through the $data array and is $data[‘affiliate_id’]. Also there are other useful examples on how to add a referral programmatically.

    Regarding groups and once you retrieved the affiliate id, you can get the group by first finding the user id for that affiliate and then after checking this example page you can get the groups the user belongs to and then get all the users for that group.
    Finally after getting the rest of the users inside the group, you can get each one’s affiliate id with this function and add referrals for them.
    Hope it helps.

    Kind regards,

  2. Hin Leong Lee February 25, 2020 at 3:32 am #

    May I know any recommend action , or function to use in the situation. e.g to get the group id from user, get the user id under the same group and get an affiliate id. Which action should I use to do that?

  3. George February 24, 2020 at 11:57 am #


    Thanks for reaching support for your request.

    Assuming that you’re using Groups free plugin from Itthinx to organise your users into groups.

    If you like all group members to trigger multiple automatic referrals when one of the group members refers a sale, then you need to use a custom implementation. It will get the referrer’s group, then get all the other members of that group and add a referral for each of these members. A prerequisite for this to work properly is to ensure that all group members are affiliates and that each member doesn’t belong to several groups. If the group members belong to multiple groups then you might end up with an infinite loop of referrals for all your affiliates depending on how the groups are setup.

    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