Software Developer

Replace ‘Test Payment’ with ‘Free Purchase’ on Admin Email For Free Purchases in Easy Digital Downloads

If you offer some free downloads in your Easy Digital Downloads store, a customer who downloads a free item will get a purchase receipt email with the payment method listed as “Free Purchase.” But, the admin email (“New Sale Notification”) will list the payment method as “Test Payment” even when your store is live (not in Test mode).

This snippet will replace the “Test Payment” payment method in the admin email with “Free Purchase” for free purchases (i.e. for ‘manual’ payments).

/**
 * Replace 'Test Payment' with 'Free Purchase' on admin email for free purchases.
 */

function isa_filter_manual_gateway_admin_label( $label, $gateway ) {

	if ( 'manual' == $gateway && 'Test Payment' == $label ) {
			$label = __( 'Free Purchase', 'easy-digital-downloads' );
	}

	return $label;
}
add_filter( 'edd_gateway_admin_label', 'isa_filter_manual_gateway_admin_label', 99, 2 );

By

We've 3 Responses

  1. May 26th, 2017 at 8:22 pm

    Thank you for this code – this issue has been driving me crazy! Where does this code go, though? In functions.php, or somewhere in the EDD files, or somewhere else? Thank you!

    avatar

Leave a Reply to JP Cancel reply

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]