Move Payment Methods WooCommerce
March 21, 2025 · AI Conversations
### ✅ Add this to your theme’s `functions.php` file or a custom plugin:
// Remove default payment section
remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
// Add payment section after additional information
add_action( 'woocommerce_checkout_after_customer_details', 'custom_move_payment_section' );
function custom_move_payment_section() {
echo '<div id="order_review" class="woocommerce-checkout-review-order">';
do_action( 'woocommerce_checkout_payment' );
echo '</div>';
}
### 🔍 Explanation:
– `woocommerce_checkout_order_review` at priority `20` is where the payment section originally loads.
– By removing it and then adding it with `woocommerce_checkout_after_customer_details`, it moves **after billing/shipping & additional info**.
—
Let me know if you also want to move the order summary section, or only payment methods.
Here’s a complete solution:
—
### ✅ Add this to your theme’s `functions.php` file:
// 1. Remove default payment section (includes terms & conditions)
remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
// 2. Re-add payment section after additional info with terms and conditions
add_action( 'woocommerce_checkout_after_customer_details', 'custom_move_payment_section_with_terms' );
function custom_move_payment_section_with_terms() {
echo '<div id="order_review" class="woocommerce-checkout-review-order">';
// Include the payment section
wc_get_template( 'checkout/payment.php' );
// Include terms and conditions checkbox manually
if ( function_exists( 'wc_terms_and_conditions_checkbox' ) ) {
wc_terms_and_conditions_checkbox();
}
echo '</div>';
}
—
### ✅ Make sure Terms & Conditions page is set:
1. Go to **WooCommerce > Settings > Advanced**.
2. Ensure the **"Terms and Conditions"** page is selected.
—
Let me know if you also want to hide the default checkbox if it still shows elsewhere or customize its label/position further!
—
### ✅ Add this to your theme’s `functions.php`:
add_filter( 'woocommerce_get_privacy_policy_text', 'custom_woocommerce_privacy_policy_text' );
function custom_woocommerce_privacy_policy_text( $text ) {
// Replace with your custom message
return 'By placing an order, you agree to our <a href="' . esc_url( get_privacy_policy_url() ) . '" target="_blank">Privacy Policy</a>.';
}
—
### 📝 Example Output:
> "By placing an order, you agree to our Privacy Policy."
You can customize this however you like — add extra HTML, text, or even style classes.
—
Let me know if you also want to customize the **Terms and Conditions** text or **combine both** into one unified message.