Last active
September 29, 2015 08:20
-
-
Save michaelmusgrove/9c33d85a222df2c1e97c to your computer and use it in GitHub Desktop.
WooCommerce: Hide coupon box on checkout page if a coupon is already applied
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
<?php | |
/* | |
* Hide coupon notice on the checkout page if a coupon has been applied in cart | |
*/ | |
add_filter( 'woocommerce_coupons_enabled', 'woocommerce_coupons_enabled_checkout' ); | |
function woocommerce_coupons_enabled_checkout( $coupons_enabled ) { | |
global $woocommerce; | |
if ( ! empty( $woocommerce->cart->applied_coupons ) ) { | |
return false; | |
} | |
return $coupons_enabled; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment