We have to imediately show that a course was booked to the coresponding affiliate. Because we check payment externally we don´t need to wait for a transaction in EE to be paid. How can we define the transaction as paid from the beginning or at least send this status to affiliatewp recommendations when the booking is done?
We don’t have any filters within the WP Affiliate add-on that allows you to set you own values to be used, however the add-on hooks in to do all of the functions we do now, so you can hook in with your own code to change the referral as you see fit.
Take a look at \eea-affiliate-wp\src\EED_Affiliate_WP.module.php to see how the add-on does what it does currently and then you can add your own functions to either the same hooks at a later priority, or a different hook if you want to set the values earlier on in the registration process. THe above file will give you a base to work from with your own hook, I do NOT recommend modifying the code within the add-on directly.
For example, if you want to run the process earlier you could hook into AHEE__EE_Single_Page_Checkout__process_attendee_information__end and set the referral at that point with whatever values you prefer. Most of the add-on’s functions check to see if the referral status is ‘paid’ before doing anything and if it is they do nothing.
$this in that context will be the EE_SPCO_Reg_Step_Attendee_Information instance.
Viewing 6 reply threads
The support post ‘transaction paid triggers affiliateWP- Howto send status paid from the beginning’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.