-
-
Save planetahuevo/70eeeb5e8a8f2685109cdbeb19dfb0f5 to your computer and use it in GitHub Desktop.
Hide EDD Coupon fields and codes at checkout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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