Skip to content

Instantly share code, notes, and snippets.

@mrgarry043
Last active July 16, 2017 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrgarry043/89192ec83a7d7a5e26066a81647d9570 to your computer and use it in GitHub Desktop.
Save mrgarry043/89192ec83a7d7a5e26066a81647d9570 to your computer and use it in GitHub Desktop.
Hide Coupon on checkout page if a coupon is already applied
<?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