Skip to content

Instantly share code, notes, and snippets.

@kish2011
Forked from bekarice/hide-edd-coupons.php
Created December 21, 2016 09:40
Show Gist options
  • Save kish2011/2f1db1d384e4035d07023da81ca32304 to your computer and use it in GitHub Desktop.
Save kish2011/2f1db1d384e4035d07023da81ca32304 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