Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Affiliates Gravity Form - extra referral
add_action( 'affiliates_referral', 'my_gf_extra_referral_affiliates_referral', 10, 2 );
function my_gf_extra_referral_affiliates_referral ( $referral_id, $info ) {
if ( $info['type'] == Affiliates_Gravity_Forms::REFERRAL_TYPE ) {
$description = "Gravity Form extra dollar";
$amount = 1;
$currency_id = "USD";
$affiliate_id = $info['affiliate_id'];
if ( class_exists( 'Affiliates_Referral_WordPress' ) ) {
$r = new Affiliates_Referral_WordPress();
$r->add_referrals( array( $affiliate_id ), null, $description, null, null, $amount, $currency_id);
} else {
affiliates_add_referral( $affiliate_id, null, $description, null, $amount, $currency_id);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.