Generate a coupon code on every nth referral.
By default, the plugin will generate a coupon code on every successful referral. You can change this via built-in filter so that you can reward customer on every nth referral.
// Minimum three orders function min_five_orders($not_active,$num_friends_refered,$order,$referrer_id) { if($num_friends_refered % 3 == 0) { $not_active = "no"; } else { // Dont generate coupon, but increase number of people referred. $not_active = "yes"; update_user_meta( $referrer_id, 'gens_num_friends', (int)$num_friends_refered + 1 ); } return $not_active; } add_filter( 'gens_raf_not_active', 'min_five_orders',10,4);
The example above will generate a coupon code for every 3rd referred friend. You can change the code above to generate coupon until x amount of friends are referred as well.