if you’re using woo-commerce as your e-Commerce and order publishing solution. then initiate this hook below:
function on_purchase( $order_id ) {
//the code
}
add_action( 'woocommerce_order_status_completed', 'mojo_on_purchase' );
add this code above to your theme’s function file
From my study of the functionality of the plugin, i discovered that wp affiliate manager uses cookie tracking to automate pay processes. so if cookie does not exist, no commission is awarded. therefore we’re gonna add a cookie delete piece of code to avoid recurring commission every of the order by the user(make sure this is applied to a registered user). In the on_purchase function add the following line to delete cookie after first time purchase:
setcookie("wpam_id", "", time()-3600);
That is it. you can add conditionals before executing the line of code above.
So what does the plugin publishers think about this?