Skip to content

Instantly share code, notes, and snippets.

@planetahuevo
Forked from bekarice/hide-edd-coupons.php
Created November 10, 2020 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save planetahuevo/70eeeb5e8a8f2685109cdbeb19dfb0f5 to your computer and use it in GitHub Desktop.
Save planetahuevo/70eeeb5e8a8f2685109cdbeb19dfb0f5 to your computer and use it in GitHub Desktop.
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