- This topic has 0 replies, 1 voice, and was last updated 11 years, 2 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Affiliates Management Plugin for WordPress
by
WordPress Affiliate Manager › Forums › Affiliate Manager Plugin › Integration with Event Espresso 4
Tagged: Event Espresso 4, integration
I’m really enjoying to use this plugin, having just set it up with woo on one site. Would love to know if it is possible to set up the sales trigger with Event Espresso 4. I found the following code on their site for a different affiliate plugin, wondering if it could be tweaked to work with this plugin, or else…?
Thanks for any input.
function espresso_track_successful_sale( $Transaction, $reg_msg, $from_admin ){
if ($Transaction instanceof EE_Transaction) {
$sale_amt = $Transaction->paid();
$unique_transaction_id = $Transaction->ID();
$Primary_Registration = $Transaction->primary_registration();
if ($Primary_Registration instanceof EE_Registration) {
$Attendee = $Primary_Registration->attendee();
if ($Attendee instanceof EE_Attendee) {
$email = $Attendee->email();
$referrer = $_COOKIE[‘ap_id’];
do_action(‘wp_affiliate_process_cart_commission’, array(“referrer” => $referrer, “sale_amt” =>$sale_amt, “txn_id”=>$unique_transaction_id, “buyer_email”=>$email));
}
}
}
}
add_action(‘AHEE__EE_Transaction__finalize__all_transaction’,’espresso_track_successful_sale’, 20, 3);