Search code examples
phpformswoocommercehook-woocommercecheckout

move WooCommerce checkout login form to after checkout order review


I want to show the WooCommerce checkout login form just after the checkout order review.

I tried the following:

remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_login_form', 10 );
add_action( 'woocommerce_checkout_after_order_review', 'woocommerce_checkout_login_form', 10 );

It was not working. jQuery's code is not working. Login form opened before click the login button.

here is

I need help to make it work properly.


Solution

  • As WooCommerce checkout login form, includes its own <form>, it requires to be added outside any existing form, so outside the main checkout form (before or after)...

    So what is going to work instead is:

    remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_login_form', 10 );
    add_action( 'woocommerce_after_checkout_form', 'woocommerce_checkout_login_form', 10 );