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

Download count shortcode

// Optional attributs supported : id, offset function edd_download_count_shortcode( $atts ) { if( function_exists( ‘edd_get_download_sales_stats’ ) ) { $post_id = get_the_ID(); $a = shortcode_atts( array( ‘offset’ => 0, ‘id’ => $post_id, ), $atts ); $download_count = edd_get_download_sales_stats( $a[‘id’] ) +…Continue reading

Remove AggregateRating and Reviews Schema

add_filter( ‘aioseo_schema_output’, ‘product_schema_aggregate_reviews’ ); function product_schema_aggregate_reviews( $schema ) { foreach ( $schema as &$schemaItem ) { if ( ‘Product’ === $schemaItem[‘@type’] ) { unset ($schemaItem[‘aggregateRating’]); unset ($schemaItem[‘review’]); } } return $schema; }Continue reading