This page contains some tweaks that our users submitted to us. The following sample tweaks have not been tested by us.
These tweaks are meant for developers only (you have to be a developer to be able to read the code and understand what it does and then maybe use it for a particular project).
Limit Referral Commission to first order
If you’re using WooCommerce as your e-Commerce solution then initiate this hook below (you can add this code to your theme’s functions.php file):
function on_purchase( $order_id ) {
//the code
}
add_action( 'woocommerce_order_status_completed', 'on_purchase' );
Affiliates Manager uses cookie tracking to automate pay processes. so if a cookie does not exist, no commission is awarded. Therefore we’re going to adjust the cookie to avoid recurring commission after an order made by a user (make sure this is applied to a registered user).
In the on_purchase function add the following line to delete the cookie value after the first-time purchase:
setcookie("wpam_id", "", time()-3600);
That is it. You can add conditionals before executing the line of code above.
Detect Adblock and Alert the Affiliate
This code checks if the affiliate is on the creatives page and alerts the affiliate if he is using adblock plus.