I am using Woocommerce and am having problems disabling the guest checkout.
I have made sure 'Enable Guest Checkout' is unticked in the settings page but people are still able to checkout without creating an account or logging in.
Is there somewhere else I should be setting this?
Go to WooCommerce > Accounts and untick Enable registration on the "Checkout" page.
This should do the job!
Alternatively, you can add this code to your theme functions.php
add_action( 'template_redirect', 'woo_restirct_checkout' );
function woo_restirct_checkout() {
if ( !is_user_logged_in() && is_checkout() ) {
$my_account_url = get_permalink( get_option('woocommerce_myaccount_page_id') );
wp_redirect( $my_account_url );
exit;
}
}
Cheers, Francesco
Also need to unticked the option from Woocommerce -> Accounts tab. Where it says Enable registration on the "Checkout" page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With