I am trying to remove the "Have a coupon" section that sits at the top of a Woocommerce checkout page (/checkout).
I would like to keep the coupon section on the Cart page, so I can't completely disable coupons, but would like it removed on the checkout page.
Any help would be greatly appreciated.
Enabling the WooCommerce Coupons feature is easy. Go to your WordPress dashboard -> WooCommerce -> Settings page. Under the General tab, ensure the “Enable coupons” option is checked. And Save the settings.
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
Put this in your functions.php
and this should do it.
There is two way one is already given in this question by Reigel.
If it is not working below is another code:
function hide_coupon_field_on_cart( $enabled ) {
if ( is_checkout() ) {
$enabled = false;
}
return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_cart' );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With