Conditional Gateway Fees

function cl_remove_gateway_fees_by_cart_total( $fee ) { // enter the cart total for no gateway fees $limit = 5; // get the cart total $cart_total = edd_get_cart_total(); if ( $cart_total >= $limit ) { // if the cart total is greater than…Continue reading

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

Show Invoice for Refunded

function pw_edd_pdf_invoices_for_refunded( $show_invoice, $payment_id ) { $payment = get_post( $payment_id ); $status = edd_get_payment_status( $payment ); if( ‘refunded’ === $status ) { $show_invoice = true; } return $show_invoice; } add_filter( ‘eddpdfi_is_invoice_link_allowed’, ‘pw_edd_pdf_invoices_for_refunded’, 10, 2 );Continue reading

Show Invoice for Pending

function pw_edd_pdf_invoices_for_pending( $show_invoice, $payment_id ) { $payment = get_post( $payment_id ); $status = edd_get_payment_status( $payment ); if( ‘pending’ === $status ) { $show_invoice = true; } return $show_invoice; } add_filter( ‘eddpdfi_is_invoice_link_allowed’, ‘pw_edd_pdf_invoices_for_pending’, 10, 2 );Continue reading

Add terms to downloads shortcode

function sd_edd_downloads_shortcode_display_terms() { $post_id = get_the_ID(); // use “download_category” for categories and “download_tag” for tags the_terms( $post_id, ‘download_category’, ‘Categories: ‘, ‘, ‘, ” ); } add_action( ‘edd_download_after’, ‘sd_edd_downloads_shortcode_display_terms’ );Continue reading