Create WooCommerce Custom Accounts Page

Last Updated : April 15, 2020

In this post I am going to show you how to create WooCommerce custom accounts page. We will create a new accounts tab and a page linked to it.

custom_woocommerce_accounts_page

Create New Account Tab

We will create a new tab “CI Custom Endpoint” and assigned it to the items array. Our custom tab menu function will be hooked to woocommerce_account_menu_items. The logout menu tab is passed to unset() function because we want our Custom Tab before it. Later again Logout tab is added to the items[] array to display it in the end .

Create WooCommerce Custom Page in Accounts Panel

Flush Rewrite Rules

We need to register a new endpoint in WordPress using the add_rewrite_endpoint() function.
Also register it using the query_vars filter. Endpoints are an extra part in the site URL that detect and show different content of page.

Custom Accounts Page

In last step the ci_custom_endpoint_content() function includes custom page and is hooked to endpoint. The code within this function will display tabs data. You can add code directly to function or can add a custom page. The page my-custom-endpoint.php is added within theme directory, it can be added to custom plugin.

Add the following code to the functions.php file

 
Product Tabs in WooCommerce
 
Custom WooCommerce Plugin Development
 
WooCommerce Endpoints
 
Flatsome Theme Customization

 

Share post with others

2 thoughts on “Create WooCommerce Custom Accounts Page”

  1. Hello Sir,
    I created a Page called “ADD PRODUCT”. The page has a Form that allows signed in users to post WooCommerce Product from the Front End.

    So I want to Add an Endpoint to my Woocommerce My Account Page, and the endpoint will be called “Add Product”.

    Now when this endpoint is clicked, I want it to open the URL directly or the Page directly where I have the form. The page is https://styleandpatterns.com.ng/add-product/

    Please, how do I achieve that?

    Reply

Leave a Comment