I have to move the payment methods in the checkout page of a Woocommerce website above the order review, but I don't know how. The problem is, that I tried using the following code:
remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
add_action( 'woocommerce_after_order_notes', 'woocommerce_checkout_payment', 20 );
But also the "Terms and Conditions" text and the "Place order" button are moving with that. I need to have the payment options, then the order review, and in the end the "Terms and Conditions" text and the "Place order" button.
How can I do that?
// includes/wc-template-hooks.php:214
add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
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!
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