AI Verified

Name

WooCommerce Hide Coupon Form after apply

About

WooCommerce hide coupon form after coupon is applied.

Language

PHP

Rating

Voted: 4 by 4 user(s)

Codevault

MyCloudWorld

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: Not Specified

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Website/ Profile URL:

https://mycloudworld.com

History

Last modified:

12/06/2023

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

WooCommerce Hide Coupon Form after apply

 
                    
1add_filter( 'woocommerce_coupons_enabled', 'mcw_disable_woocommerce_checkout' );
2function mcw_disable_woocommerce_checkout( $coupons_enabled ) {
3 global $woocommerce;
4 // Check if any coupon applied and disable coupon if any coupon applied
5 if ( ! empty( $woocommerce->cart->applied_coupons ) ) {
6 return false;
7 }
8 return $coupons_enabled;
9}

4

Related Snippets

Please see some snippets below related to this snippet..

WooCommerce

AI Verified

0

WooCommerce Show Review Rating Count On Product Archive

Added: 1 year ago

Last Updated: 1 year ago

Do you know what’s really misleading? When you are comparing two products on the archive page and you’re weighing up the reviews. You notice Product A is rated 5 stars and Product B is only rated 4 st...

WooCommerce

AI Verified

2

WooCommerce Empty Cart Button

Added: 1 year ago

Last Updated: 2 months ago

By default, WooCommerce only lets users clear items from their cart one by one. This guide shows you how to create one button shown on the cart page which will empty the entire cart in one click. A lo...

WooCommerce

AI Verified

1

WooCommerce Disable Shipping Method If User Is Logged Out

Added: 1 year ago

Last Updated: 2 months ago

Enabling and disabling shipping method options based on whether the user is logged into their account is easy. Having this code snippet implemented can encourage the user to register an account with y...

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

General

AI Verified

6

Remove Google Fonts and Use System Fonts

Added: 2 years ago

Last Updated: 2 months ago

Use this hook to remove all Google Fonts from website and use system fonts for best CLS Score.

WooCommerce

AI Verified

4

WooCommerce Hide Coupon Form after apply

Added: 2 years ago

Last Updated: 1 year ago

WooCommerce hide coupon form after coupon is applied.

WordPress Admin

AI Verified

2

Image Size Upload Set To Full Default

Added: 2 years ago

Last Updated: 1 year ago

If you want to set the image size to full-width for use in the post editor permanently.