Woocommerce WordPress Plugin Change the Checkout Flow

I am using Woocommerce wordpress plugin in my site. When I am in the Cart page and click “proceed to checkout” I am now going to checkout page. I want to change this flow as below.

If the user is not logged in, he should be taken to a different url. If user is logged in he will go to checkout page as usual.

Read More

Any help is appreciated.

Related posts

Leave a Reply

1 comment

  1. First you create a page where you want to redirect the guest user, for example register

    then write this code in your functions.php

    function restrict_user() {
        if (! is_user_logged_in() && (is_checkout())) {
            wp_redirect("http://your site url.com/register/");
            exit;
        }
    }
    add_action('template_redirect', 'restrict_user');
    

    Hope this will help you…