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
/** | |
* Send email to affiliate when a referral has been paid | |
*/ | |
function affwp_custom_affiliate_referral_paid_email( $referral_id, $new_status, $old_status ) { | |
if ( ! function_exists( 'affiliate_wp' ) || ( 'paid' != $new_status || 'unpaid' != $old_status ) ) { | |
return; | |
} | |
$referral = affiliate_wp()->referrals->get_by( 'referral_id', $referral_id ); |
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
/** | |
* Auto enable affiliate referral notifications | |
* Pre-selects the "Enable New Referral Notifications" checkbox on the "Settings" tab of the affiliate area when an affiliate either registers from the front-end, or is added from the admin | |
*/ | |
function affwp_custom_auto_enable_affiliate_referral_notifications( $add ) { | |
update_user_meta( affwp_get_affiliate_user_id( $add ), 'affwp_referral_notifications', true ); | |
} | |
add_action( 'affwp_insert_affiliate', 'affwp_custom_auto_enable_affiliate_referral_notifications' ); |
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
// add the Namibian Dollar as a currency | |
function affwp_custom_add_namibian_currency( $currencies ) { | |
$currencies['NAD'] = 'Namibian Dollar'; | |
return $currencies; | |
} | |
add_filter( 'affwp_currencies', 'affwp_custom_add_namibian_currency' ); | |
// add the currency symbol before the amount | |
function affwp_custom_namibian_currency_symbol( $formatted, $currency, $amount ) { | |
$formatted = 'N$' . $amount; |
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 | |
$affiliate = affwp_get_affiliate( affwp_get_affiliate_id() ); | |
$user_info = get_userdata( $affiliate->user_id ); | |
$affiliate_user_name = $user_info->user_login; | |
?> | |
<div id="affwp-affiliate-dashboard-url-generator" class="affwp-tab-content"> | |
<h4><?php _e( 'Referral URL Generator', 'affiliate-wp' ); ?></h4> |
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 | |
/** | |
* [affiliate_referral_url_username] shortcode | |
*/ | |
function affwp_custom_referral_url_shortcode( $atts, $content = null ) { | |
if ( ! affwp_is_affiliate() ) { | |
return; | |
} |
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 | |
/* | |
* Plugin Name: Easy Digital Downloads - Force account creation by cart total | |
* Description: Force account creation at checkout if the cart total is a certain amount | |
* Author: Andrew Munro | |
* Version: 1.0 | |
*/ | |
function sumobi_edd_force_account_creation_by_cart_total( $ret ) { | |
// enter the cart total amount that should force account creation |
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 | |
/* | |
* Plugin Name: Easy Digital Downloads - Force account creation by category or tag | |
* Description: Forces the customer to create an account at checkout if a download in the cart has a specific download category or tag | |
* Author: Andrew Munro | |
* Version: 1.0 | |
*/ | |
function sumobi_edd_force_account_creation_by_download_category_or_tag( $ret ) { | |
// download categories that the download must belong to before account creation is forced |
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
/** | |
* Add link through to user's profile screen from the reference column of the referrals page | |
*/ | |
function affwp_custom_wc_referrals_user_link( $reference, $referral ) { | |
if ( ! ( 'woocommerce' == $referral->context || class_exists( 'WC_Order' ) ) ) { | |
return $reference; | |
} | |
$order = new WC_Order( $referral->reference ); | |
$customer_first_name = isset( $order->billing_first_name ) ? $order->billing_first_name : ''; |
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 | |
/** | |
* Add a {ip_address} tag for use in either the purchase receipt email or admin notification emails | |
*/ | |
if ( function_exists( 'edd_add_email_tag' ) ) { | |
edd_add_email_tag( 'ip_address', 'Customer\'s IP Address', 'sumobi_edd_email_tag_ip_address' ); | |
} | |
/** |
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 | |
/** | |
* Add this where you'd like the leaderboard to be displayed | |
*/ | |
if ( function_exists( 'affwp_custom_show_leaderboard' ) ) { | |
affwp_custom_show_leaderboard(); | |
} | |
?> |