Skip to content

Instantly share code, notes, and snippets.

@mtruitt
Last active April 20, 2017 18:52
Show Gist options
  • Select an option

  • Save mtruitt/031b6f63da05fb0c2e753533848d6321 to your computer and use it in GitHub Desktop.

Select an option

Save mtruitt/031b6f63da05fb0c2e753533848d6321 to your computer and use it in GitHub Desktop.
Hide Coupon Field
<?php
// Hide coupon field
function hide_coupon_field( $enabled ) {
if ( is_cart() ) {
$enabled = false;
}
return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field' );
// hide coupon field on checkout page
function hide_coupon_field_on_checkout( $enabled ) {
if ( is_checkout() ) {
$enabled = false;
}
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