Home / WooCommerce / How do I disable coupons in WooCommerce?

How do I disable coupons in WooCommerce?

Published On: March 10th, 2020|Categories: WooCommerce|Tags: |2 min read|

Disabling the use of coupon codes in WooCommerce is very simple. Go to WooCommerce -> Settings -> General – > scroll to the section Enable coupons and uncheck “Enable the use of coupon codes”.

How to disable coupons in WooCommerce

Unchecking “Enable the use of coupon codes” will disable completely the use of coupon codes in your WooCommerce store. The “Coupons” menu in the admin pannel will dissapear and you won’t be able to generate coupon codes. Also the fields to apply coupon code in Cart and Checkout pages will be gone as well. Your customer will no longer be able to use their coupon codes when placing their order. If you are using custom links to apply coupon code to WooCommerce cart via url – this will not work as well.

PHP Snippet: Remove Woocommerce Coupon Section from Checkout Page

Removing the coupon code section from the Checkout page (Have a coupon? Click here to enter your code) requires only 1 line of code. Paste the following code in your child theme’s functions.php file and you’re done.

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

Or you can use a more suffisticated way to hide the coupon form on the checkout page:

// hide coupon field on checkout page
function webroom_hide_coupon_field_on_woocommerce_checkout( $enabled ) {

	if ( is_checkout() ) {
		$enabled = false;
	}

	return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'webroom_hide_coupon_field_on_woocommerce_checkout' );

By removing the coupon code from the Checkout your cusomers will be able to apply a coupon only in the Cart page (or by url if you’ve enabled this).

PHP Snippet: Remove Woocommerce Coupon Section from Cart Page

// hide coupon field on cart page
function webroom_hide_coupon_field_on_woocommerce_cart( $enabled ) {

	if ( is_cart() ) {
		$enabled = false;
	}

	return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'webroom_hide_coupon_field_on_woocommerce_cart' );

Learn more about he woocommerce_coupons_enabled filter here.

Why to remove WooCommerce coupon code field?

Despite the fact that the use of coupons is very usefull feature, you may want to remove the WooCommerce coupon code field on the cart/checkout page in order to impove cart abandonment rate, to avoid distraction of customer in coupons.

What is your reason to completely disable the use of coupons or at least remove the coupon code field in cart/checkout page? Share your thoughts in the comments section below.




Related Articles

If you enjoyed reading this, then please explore our other articles below:

More Articles

If you enjoyed reading this, then please explore our other articles below: