Skip to content

Instantly share code, notes, and snippets.

@michaelmusgrove
Last active September 29, 2015 08:20
Show Gist options
  • Save michaelmusgrove/9c33d85a222df2c1e97c to your computer and use it in GitHub Desktop.
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
<?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