Last active
January 4, 2016 01:49
-
-
Save maxrice/8550706 to your computer and use it in GitHub Desktop.
WooCommerce - hide the coupon form everywhere, but leave coupons enabled for use with plugins like Smart Coupons and URL Coupons
This file contains hidden or 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
<?php | |
// hide coupon form everywhere | |
function hide_coupon_field( $enabled ) { | |
if ( is_cart() || is_checkout() ) { | |
$enabled = false; | |
} | |
return $enabled; | |
} | |
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment