Remove Coupon Field on the Checkout Page for Guest Users in WooCommerce

Remove coupon field on the checkout page for guest users if using WooCommerce on your child site.

Snippet Type

Execute on Child Sites

Snippet

function no_coupon_checkout_function() {
    if ( !is_user_logged_in() ) {

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

    }
}
    
add_action('init', 'no_coupon_checkout_function');
2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.