Skip to content

Instantly share code, notes, and snippets.

@jack-arturo
Created March 27, 2025 05:41
Show Gist options
  • Save jack-arturo/76f1f5a7c7a7cea9a8341f63f4db2cfe to your computer and use it in GitHub Desktop.
Save jack-arturo/76f1f5a7c7a7cea9a8341f63f4db2cfe to your computer and use it in GitHub Desktop.
Hide the discount code on the Easy Digital Downloads checkout and show the discount name instead
<?php
/**
* Show EDD discount name instead of code in checkout summary.
*/
function my_custom_edd_discount_display( $discount_html, $discount ) {
$discount = edd_get_discount_by_code( $discount );
if ( ! $discount ) {
return $discount_html;
}
$discount_html = str_replace( $discount . '&nbsp;', $discount->name . '&nbsp;', $discount_html );
return $discount_html;
}
add_filter( 'edd_get_cart_discount_html', 'my_custom_edd_discount_display', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment