Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Woocommerce Remove Coupon Section from Checkout Page

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.

like image 980
Wes Asbell Avatar asked Sep 14 '17 03:09

Wes Asbell


People also ask

Where is the coupon section in WooCommerce?

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.


Video Answer


2 Answers

remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 ); 

Put this in your functions.php and this should do it.

like image 154
Reigel Avatar answered Oct 06 '22 15:10

Reigel


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' );
like image 27
Akshay Shah Avatar answered Oct 06 '22 15:10

Akshay Shah