Created
June 8, 2017 03:47
-
-
Save amdrew/b5bf247424a5053b914ad410f1b5261d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function affwp_one_time_flat_rate_commission( $args, $amount, $order_id, $description, $affiliate_id, $visit_id, $products, $context ) { | |
if ( ! function_exists( 'affiliate_wp' ) ) { | |
return $args; | |
} | |
if ( 'flat' === affwp_get_affiliate_rate_type( $affiliate_id ) ) { | |
$args['amount'] = (float) affwp_get_affiliate_rate( $affiliate_id ); | |
} | |
return $args; | |
} | |
add_filter( 'affwp_insert_pending_referral', 'affwp_one_time_flat_rate_commission', 10, 8 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment