Custom Registration Links On Woocommerce Checkout

Custom Registration Links On Woocommerce Checkout
Like Tweet Pin it Share Share Email

[myad1] On the Checkout page, we can see the default login and registration links and it will open bases on the theme design. Sometimes we need to our custom registration link to add another role. I was working on one of the Woocommerce projects and the client requested to add two new registration links on the Woocommerce Checkout page.

It was new to me and I had searched on the google. While the searching for the solution, I got the below solution. It took too much time to find the solution so I have created this solution to get you the code.

Add below action in the functions.php file. You can add it also in child theme functions.php file or in the custom plugin functions file.


add_action('woocommerce_checkout_fields', add_registration_custom_link');

function add_registration_custom_link(){
        if (!is_user_logged_in()){
            $info_message = apply_filters( 'woocommerce_checkout_login_message', __( 'New customer?', 'woocommerce' ) );
            $info_message .= '<a href="your_site_url/custom_registration-page-link"?>
' . __( 'Click here to Register', 'woocommerce' ) . '</a>';
            wc_print_notice( $info_message, 'notice' );



Please replace your custom registration page link with ‘custom_registration-page-link’.
By clicking on the URL page, it will be redirected to the custom registration page.

If you want to redirect it back to the checkout page then use below code


$info_message .= '<a href="your_site_url/custom_registration-page-link?redirect_to=your_site_url/checkout/">' . __( 'Click here to Register', 'woocommerce' ) . '</a>';


So, in this case, the checkout page will be redirected to the custom registration page and then after registration, it will be redirected to the checkout page

Thanks for reading our article. What Next?

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

nine + seven =