Last active
August 29, 2015 14:07
-
-
Save amdrew/ae2cf4bad5ac31d8e17b to your computer and use it in GitHub Desktop.
AffiliateWP - Per-affiliate, per-product rate
This file contains 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_custom_per_product_per_affiliate_referral_amount( $referral_amount, $affiliate_id, $amount, $reference, $product_id ) { | |
$special_affiliate_id = 145; | |
$special_product_id = 3133; | |
$special_referral_amount = $amount * .8; // 80% | |
if ( $special_affiliate_id == $affiliate_id && $special_product_id == $product_id ) { | |
$referral_amount = $special_referral_amount; | |
} | |
return $referral_amount; | |
} | |
add_filter( 'affwp_calc_referral_amount', 'affwp_custom_per_product_per_affiliate_referral_amount', 10, 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, there's no reply notifications on gists so I have only just seen your reply. I'm not too sure I understand your question, can you contact me through [email protected]?