Combine Billing Address and Payment Methods for WooCommerce

Recommendation

Learn why I switched to WPCodeBox for managing code snippets for myself and for my clients.

Instructions

Snippet Type: PHP

  1. Copy the snippet.
  2. Add the snippet using WPCodeBox.
  3. Follow any customization notes provided.
  4. Save the snippet.
  5. Enable the snippet.
  6. Test.

Snippet

				
					// WOOCOMMERCE - COMBINE BILLING ADDRESS AND PAYMENT METHODS
add_filter(
  "woocommerce_account_menu_items",
  function ($items) {
    unset($items["edit-address"]);
    unset($items["payment-methods"]);
    return $items;
  },
  999
);

add_action(
  "woocommerce_account_edit-account_endpoint",
  "woocommerce_account_payment_methods"
);
add_action(
  "woocommerce_account_edit-account_endpoint",
  "woocommerce_account_edit_address"
);