Well customizing Woocommerce account and adding new items comes in a few steps,
First Step: Create Links:
You should use woocommerce_account_menu_items
filter to modify existing menu items or adding new menu items, for example i add an item called Wishlist
add_filter( 'woocommerce_account_menu_items', function($items) {
$items['wishlist'] = __('Wishlist', 'textdomain');
return $items;
}, 99, 1 );
Note: I've gone through simplest way, you can use array_slice if you want to put menu item at your desired position.
P.s: If you want to remove or modify existing items you can do it like this:
add_filter( 'woocommerce_account_menu_items', function($items) {
unset($items['downloads']); // Remove downloads item
$items['orders'] = __('My Orders', 'textdomain'); // Changing label for orders
return $items;
}, 99, 1 );
Step 2: Add rewrite end points:
For each item you add you're gonna need to add an endpoint:
add_action( 'init', function() {
add_rewrite_endpoint( 'wishlist', EP_ROOT | EP_PAGES );
// Repeat above line for more items ...
} );
Note that after you add new endpoints you need to flush rewrite rules by either going to wp-admin/settings/permalinks and clicking update button or with flush_rewrite_rules()
function
Step 3: Display new item content
To display content for your newly added items you should use woocommerce_account_{myEndPoint}_endpoint
action, for our example i created a file called wishlist.php
in my themes directory under woocommerce/myaccount/
and display it's content like this:
add_action( 'woocommerce_account_wishlist_endpoint', function() {
wc_get_template_part('myaccount/wishlist');
});