Last active
July 16, 2017 06:35
-
-
Save mrgarry043/89192ec83a7d7a5e26066a81647d9570 to your computer and use it in GitHub Desktop.
Hide Coupon 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 | |
/* | |
* source: https://wpglorify.com/?p=3846 | |
* 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