How to Disable Coupons WooCommerce ( 4 Ways )

Having coupons on your WooCommerce website is considered a great marketing strategy because your customers are engaged with your store and keep purchasing products, etc. Especially for new WooCommerce store owners who want to start getting customers and increase their sales.

But sometimes coupons can have a negative impact on your product’s sale; in this guide, I will discuss why and how to disable coupons in the WordPress WooCommerce website.

Why Disable coupons WooCommerce?

The main reason why you should hide coupons from customers is that when you keep providing coupons for your customers, they get used to it, and they will always look for coupons whenever they want to buy products from your store, and if they don’t get a coupons code, they will be waiting to find the coupon code and purchase products from your store.

Meanwhile, if they get a coupon code for any other store that has the same product that you are selling, they will immediately buy from them, and in that way, you will lose your customer. So it’s better to hide coupons on that specific product, and your customer will know that there is no coupon code for the product and will purchase it immediately without waiting.

4 Ways to Disable Coupons in the WooCommerce store

This guide will show you four ways that will disable or hide coupons in the WordPress WooCommerce store. Like if you want to disable the coupons for the overall website or only for some specific page, so let’s get started.

1) WooCommerce Disable coupons on the entire site

In WordPress, the WooCommerce plugin has a built-in function to disable coupons on the entire site, to do so, go to WooCommerce > Settings > General. In the General Tab, scroll down below, and there you will see Enable Coupons; uncheck it, and this way, the coupons section will be disabled on the entire site

unchecking coupons code section on entire website

2) WooCommerce Remove Coupon from Checkout page

If you want to remove the coupons section only from checkout page, then insert this below code in function.php file which is located in Appearance > Theme Editor

<?php
// remove coupon field on the checkout page
function disable_coupon_field_on_checkout( $enabled ) {
	if ( is_checkout() ) {
		$enabled = false;
	}
	return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'disable_coupon_field_on_checkout' );
disabling coupons for checkout page

This code will hide the WooCommerce coupon only on the checkout page while still showing on the cart page.

How to Disable Coupons WooCommerce ( 4 Ways )

3) Remove Coupon from Cart WooCommerce

If you want to show coupon only on the checkout page and remove it from the cart in WooCommerce, then insert this below code in the function.php file of your theme

<?php
// remove coupon field on the cart page
function disable_coupon_field_on_cart( $enabled ) {
	if ( is_cart() ) {
		$enabled = false;
	}
	return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'disable_coupon_field_on_cart' );
disabling coupons on cart page

In this way, the coupons section will be disabled on the cart page and visible on the checkout page.

You May Like:

How to Fix Add to cart Button not Working WooCommerce

Comment Form not Showing WordPress [Solved]

How to Add Product Short Description in WooCommerce Checkout

4) Disable Coupon only for Specific Product

If you want to hide coupons for a specific product only, for example, you don’t want to give a discount on this particular product; then you can hide the coupon section for that specific product using this code.

<?php

add_filter( 'woocommerce_coupons_enabled','hide_coupon_field_on_cart' );
function hide_coupon_field_on_cart( $enabled ) {

	$product_id = 55;
	$cart = WC()->cart->get_cart();
	foreach ( $cart as $id => $cart_item ) {
		if( $cart_item[ 'data' ]->get_id() == $product_id ) {
			return false;
		}
	}	

	return $enabled;
}

For this, you should know the ID of that specific product and then replace it with the above 55 number given to $product_id.

To get the ID for a specific product, go to your products in WooCommerce, and there check the ID of that product

WooCommerce product ID

Note: I showed you that copy and paste my code in function.php file but if you changed your theme, your code will be gone, so it’s better you use a plugin name Code Snippets and insert these codes there.

FAQ( How to Disable Coupons WooCommerce )

How do I remove a coupon code from my cart page?

To remove the coupon code from your cart page only then, insert the below code in your Theme Editor > In function.php file:
<?php
// remove coupon field on the cart page
function disable_coupon_field_on_cart( $enabled ) {
if ( is_cart() ) {
$enabled = false;
}
return $enabled;
}
add_filter( ‘woocommerce_coupons_enabled’, ‘disable_coupon_field_on_cart’ );

Why remove coupons code from WooCommerce?

Suppose you have a coupon system on your website, and now you don’t want to give further discounts on your products and not providing coupons anymore. In that case, your customers will be waiting for your coupon code and will not buy your products until they get a coupon code because they know that this store provides coupons.
This way, they will be waiting and will not be purchasing products, and they may find another vendor and buy from them. So it’s better to remove the coupon section from your WooCommerce store so they don’t see the coupon code section in checkout and buy the product immediately

Conclusion

I hope in this guide; you have learned when and why to remove coupons from your WooCommerce store. I have discussed four ways that will help you disable coupons from your WooCommerce pages. If you still have some queries in your mind, you can comment below, and I will reply to you as soon as possible.

I will be happy to help you out with this. Thanks for reading….!

Hamza Afridi is a Full stack Web & WordPress developer and writer with 5+ years of experience. He is Founder of webtalkhub.com, a blog on web development, SEO, and digital marketing tutorials. He enjoys learning and sharing new technologies.

Leave a Comment