Skip to content

Instantly share code, notes, and snippets.

@amdrew
amdrew / gist:ae2cf4bad5ac31d8e17b
Last active August 29, 2015 14:07
AffiliateWP - Per-affiliate, per-product rate
<?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;