To hide coupon on cart page for WooCommerce add the following code in the functions.php file:
1 2 3 4 5 6 7 8 | // hide coupon field on cart page only function hide_coupon_field_on_cart( $enabled ) { if ( is_cart() ) { $enabled = false; } return $enabled; } add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_cart' ); |
Additionally, if you want to remove the coupon on the checkout page, add the following code in the functions.php file:
1 2 3 4 5 6 7 8 | // 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' ); |