Move Payment Methods WooCommerce

User
Move payment methods after Additional information in woocommerce
Assistant
To move the **payment methods section below the "Additional Information"** section on the WooCommerce checkout page, you can use WordPress hooks. Here’s how you can do it by unhooking and re-hooking the payment section.

### ✅ 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.

User
include terms and condition checkobox
Assistant
Great! If you want to **move the payment section after the Additional Information** **and** include the **Terms and Conditions checkbox**, you can do both by adjusting the hooks and making sure WooCommerce still renders the checkbox correctly.

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!

User
change woocommerce-privacy-policy-text
Assistant
To **change the "Privacy Policy" text** shown on the WooCommerce checkout page (that appears above the Terms and Conditions checkbox), you can use a filter provided by WooCommerce.

### ✅ 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.

Leave a Comment

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