Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hide EDD Coupon fields and codes at checkout
/**
* Snippets to hide EDD coupon fields & codes during the checkout process - handy if you use URLs to apply discounts instead
* Tutorial: http://www.sellwithwp.com/easy-digital-downloads-hide-coupons/
*/
// Removes the field to enter a discount at checkout
remove_action( 'edd_checkout_form_top', 'edd_discount_field', -1 );
// Changes the discount code in the checkout summary to display "Discount applied - " instead of the code
function remove_edd_discount_code_display( $html, $discounts, $rate, $remove_url ) {
$discounts = 'Discount applied - ' . $rate;
return $discounts;
}
add_filter( 'edd_get_cart_discounts_html', 'remove_edd_discount_code_display', 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment