WooCommerce: Hide ‘Coupon form’ on checkout page

This will hide ‘Coupon form’ on checkout page, if any coupon is already applied from cart. Put this code on your function.php.

add_filter( 'woocommerce_coupons_enabled', 'woocommerce_coupons_enabled_checkout' );

function woocommerce_coupons_enabled_checkout( $coupons_enabled ) {
    global $woocommerce;
    if ( ! empty( $woocommerce->cart->applied_coupons ) ) {
        return false;
    }
    return $coupons_enabled;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s