Support

Home Forums Event Espresso Premium Can we Restrict AffiliateWP to not calculate referral bonus based on total?

Can we Restrict AffiliateWP to not calculate referral bonus based on total?

Posted: January 31, 2023 at 12:40 pm

Viewing 3 reply threads


fuzzyminds

January 31, 2023 at 12:40 pm

Hello,

We use EE in conjunction with AffiliateWP using your provided integration. We want to implement a custom calculation method to calculate referral bonus from event sales, we want the bonus to be calculated from a specific price type tied to a ticket instead of the total price.

Can you please guide us with some hooks and sample code to accomplish this?


Tony

  • Support Staff

February 1, 2023 at 5:11 am

Hi there,

We don’t have any examples of doing this but there is a filter within the EE WP affiliatewp add-on which allows you to alter to amount used:

return apply_filters(
    'FHEE__EED_Affiliate_WP__getInvoiceAmount__amount',
    $amount,
    $transaction,
    $awp
);

Your developers can hook into that filter and use the EE_Transaction object within $transaction to calculate the amount using whatever values you prefer there.


fuzzyminds

February 1, 2023 at 11:00 am

Thanks for the help Tony, much appreciated!


Tony

  • Support Staff

February 1, 2023 at 11:25 am

You’re most welcome 🙂

Viewing 3 reply threads

The support post ‘Can we Restrict AffiliateWP to not calculate referral bonus based on total?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso