Skip to content

Instantly share code, notes, and snippets.

@rynaldos-zz
Created May 27, 2020 07:18
Show Gist options
  • Save rynaldos-zz/ae95c02a3dfdf1b36754f30abb46d74e to your computer and use it in GitHub Desktop.
Save rynaldos-zz/ae95c02a3dfdf1b36754f30abb46d74e to your computer and use it in GitHub Desktop.
WooCommerce remove checkout page coupon field for guests
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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment