Move Payment Options WooCommerce
February 24, 2025 ยท AI Conversations
### **Solution: Move Payment Options to the Billing Section**
1. **Remove the Payment Section from the Sidebar**
2. **Add the Payment Section Below the Billing Section**
#### **Add the following code to your theme's `functions.php` file:**
function move_woocommerce_payment_to_billing_section() {
// Remove payment section from sidebar
remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
// Add payment section below billing details
add_action( 'woocommerce_after_checkout_billing_form', 'woocommerce_checkout_payment', 20 );
}
add_action( 'wp', 'move_woocommerce_payment_to_billing_section' );
### **Explanation:**
– `remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );`
โ This removes the payment options from the sidebar.
– `add_action( 'woocommerce_after_checkout_billing_form', 'woocommerce_checkout_payment', 20 );`
โ This adds the payment options below the billing details.
#### **Alternative: Adjust Layout via CSS (If needed)**
If the layout still appears broken after moving the payment section, you may need to apply some custom CSS:
#payment {
width: 100%;
margin-top: 20px;
}
This method ensures that the payment options appear right below the billing form instead of in the sidebar.
Let me know if you need further adjustments! ๐