Skip to content

Instantly share code, notes, and snippets.

@shreyans94
Created January 23, 2018 21:40
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 shreyans94/291e722dc055c5b84abab2eef7e87fc2 to your computer and use it in GitHub Desktop.
Save shreyans94/291e722dc055c5b84abab2eef7e87fc2 to your computer and use it in GitHub Desktop.
remove coupon field on woocommerce cart page
// hide coupon field on cart page.
function hide_coupon_field_on_cart( $enabled ) {
if ( is_cart() ) {
$enabled = false;
}
return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_cart' );
// hide coupon field on checkout page
function hide_coupon_field_on_checkout( $enabled ) {
if ( is_checkout() ) {
$enabled = true;
}
return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_checkout' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment