On my website the checkout page containing "Have a coupon? Click here to enter your code" box. I don't want this field on checkout page.I applying coupon via URl. I want to remove this box from checkout page by CSS. I attached the screenshot of that box in my checkout page.
Is this possible?
I have already tried this:
function hide_coupon_field_on_checkout( $enabled ) {
if ( is_checkout() ) {
$enabled = false;
}
return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_checkout' );
But it disable coupons functionality in checkout page.
Any help will be appreciated.
You can use a custom function hooked in woocommerce_before_checkout_form action hook that will remove the notice coupon form without disabling coupon functionality in checkout page:
add_action( 'woocommerce_before_checkout_form', 'remove_checkout_coupon_form', 9 );
function remove_checkout_coupon_form(){
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
}
Code goes in function.php file of the active child theme (or active theme).
Tested and works.
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