Move payment methods in Woocommerce checkout page Move payment methods in Woocommerce checkout page wordpress wordpress

Move payment methods in Woocommerce checkout page


Original WC Hook

// includes/wc-template-hooks.php:214add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );

Your Hook

This will be in your theme or plugin.

// make sure the priority value is correct, running after the default priority.remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );add_action( 'woocommerce_after_order_notes', 'woocommerce_checkout_payment', 20 );

Your hook should run after WC has loaded; so that you can remove it.

function theme_wc_setup() {  remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );  add_action( 'woocommerce_after_order_notes', 'woocommerce_checkout_payment', 20 );}add_action( 'after_setup_theme', 'theme_wc_setup' );

EDIT: Thanks all, didn't know this is still actively searched. Vote up to help other devs!


Template override is necessary (not possible editing functions.php only).

One possible way to achieve what you want is:

  1. Copy payment.php from woocommerce plugin folder to your_child _theme/woocommerce/checkout/ folder.
  2. Open the newly created payment.php file, and add a custom hook just before the line <div class="form-row place-order">. For example:

    <?php do_action( 'woocommerce_review_order_and_proceed' ); ?>

  3. In your child theme's functions.php, add the code below to unhook woocommerce_order_review action from it's original place, and hook it to the newly created hook:

    remove_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 );

    add_action( 'woocommerce_review_order_and_proceed', 'woocommerce_order_review', 20 );