Join

Combine the Billing Address and Payment Methods WooCommerce Endpoints

Don't want to mess with code snippets? This is a feature of MyListing Pro.

Instructions

  1. Create a new PHP code snippet.
  2. Copy the contents of code snippet below.
  3. Paste the contents into your code snippet.
  4. Review any notes that I’ve provided.
  5. Save and enable the code snippet.
  6. Test.

Snippet

This snippet helps you reduce the number of WooCoommerce Endpoints within the MyListing dashboard.

Instead of three separate endpoints for Account, Payment Methods, and Address, you can use just the ‘Account’ endpoint (/my-account/edit-account/) to display everything.

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"
);