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 );
JP
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!
Isabel
May 28th, 2017 at 8:17 pm
Thank you. See how to add code to your site.
JP
June 17th, 2017 at 2:31 pm
Perfect – thank you!