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

Prevent Discounts on Upgrades

function pw_edd_disable_discount_on_upgrade( $return ) { $cart_items = edd_get_cart_contents(); if ( $cart_items ) { foreach ( $cart_items as $item ) { if ( isset( $item[‘options’][‘is_upgrade’] ) ) { $error_message = __( ‘Discounts are not valid when upgrading.’, ‘edd’ ); edd_set_error( ‘edd-discount-error’,…Continue reading

Continue Shopping Button

add_action( ‘edd_cart_footer_buttons’, ‘ck_edd_continue_shopping_button’, 1 ); function ck_edd_continue_shopping_button() { $color = edd_get_option( ‘checkout_color’, ‘green’ ); $color = ( $color == ‘inherit’ ) ? ” : $color; ?> “>Continue reading