Override Commissions Email Template

// Remove default email template remove_action( ‘eddc_insert_commission’, ‘eddc_email_alert’, 10, 5 ); // Build New email template for Commissions (same as default, carefully make your modifications) function sd_edd_commissions_email_alert( $user_id, $commission_amount, $rate, $download_id, $commission_id ) { global $edd_options; $from_name = isset( $edd_options[‘from_name’]…Continue reading

Withholding Tax Example

function ds_edd_adjust_commission_rate_for_withholding_tax( $recipient, $commission_amount, $rate, $download_id, $commission_id, $payment_id ) { $payment = new EDD_Payment( $payment_id ); $commission = new EDD_Commission( $commission_id ); $address = $payment->address; $shop_country = edd_get_shop_country(); // Set the commission meta key $meta_key = ‘_eddc_withheld_amount’; // Sanity check…Continue reading

Adjust Rate for Referrals

/* * This is for combining EDD Commissions with Affiliates Pro */ function pw_edd_adjust_commission_rate_for_referrals( $recipient, $commission_amount, $rate, $download_id, $commission_id, $payment_id ) { global $wpdb; // See if this payment had a referral associated with it if( $wpdb->get_var( $wpdb->prepare( “SELECT referral_id…Continue reading

Commissions payment_id email tag

function pj_eddc_add_payment_id_email_template_tag( $message, $user_id, $commission_amount, $rate, $download_id, $commission_id ){ //Get the payment Id $payment_id = get_post_meta( $commission_id, ‘_edd_commission_payment_id’, true ); $message = str_replace( ‘{payment_id}’, $payment_id, $message ); return $message; } add_filter( ‘eddc_sale_alert_email’, ‘pj_eddc_add_payment_id_email_template_tag’, 10, 6 );Continue reading