How to hide coupons from Checkout and Cart Page in WooCommerce?

WooCommerce comes with a built-in feature called “Coupons”, which allows you to offer discount and rewards to your customers. It also provides options to enable or disable the coupons feature.

Quick Tip : How To Add URL Column To WordPress Media Library?

To Disable the Coupons,
1. Login to Dashboard.
2. From Left panel, navigate to WooCommerce >> Settings >> Checkout
3. Uncheck “Enable the use of coupons” option and click “Save changes” button.

You can easily enable or disable the Coupons using the above method.

However if you want to hide the coupons option from customers, but leave it enabled to use it with plugins like Smart Coupons and URL Coupons that apply discounts without requiring customers to manually enter a coupon code, you can do it using following WordPress code snippet,

// hide coupon field on cart page
function hide_coupon_field_on_cart( $enabled ) {
 
	if ( is_cart() ) {
		$enabled = false;
	}
 
	return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_cart' );
 
// hide coupon field on checkout page
function hide_coupon_field_on_checkout( $enabled ) {
 
	if ( is_checkout() ) {
		$enabled = false;
	}
 
	return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_checkout' );
how-to-hide-coupons-cart-checkout-woocommerce

Hide Coupons From WooCommerce Cart and Checkout Pages

0 Comments

Leave a Comment.