Javascript required
Skip to content Skip to sidebar Skip to footer

How to Add Custom Field in Woocommerce My Account Page

LnRiLWZpZWxke21hcmdpbi1ib3R0b206MC43NmVtfS50Yi1maWVsZC0tbGVmdHt0ZXh0LWFsaWduOmxlZnR9LnRiLWZpZWxkLS1jZW50ZXJ7dGV4dC1hbGlnbjpjZW50ZXJ9LnRiLWZpZWxkLS1yaWdodHt0ZXh0LWFsaWduOnJpZ2h0fS50Yi1maWVsZF9fc2t5cGVfcHJldmlld3twYWRkaW5nOjEwcHggMjBweDtib3JkZXItcmFkaXVzOjNweDtjb2xvcjojZmZmO2JhY2tncm91bmQ6IzAwYWZlZTtkaXNwbGF5OmlubGluZS1ibG9ja311bC5nbGlkZV9fc2xpZGVze21hcmdpbjowfQ==

LnRiLWltYWdle3Bvc2l0aW9uOnJlbGF0aXZlO3RyYW5zaXRpb246dHJhbnNmb3JtIDAuMjVzIGVhc2V9LndwLWJsb2NrLWltYWdlIC50Yi1pbWFnZS5hbGlnbmNlbnRlcnttYXJnaW4tbGVmdDphdXRvO21hcmdpbi1yaWdodDphdXRvfS50Yi1pbWFnZSBpbWd7bWF4LXdpZHRoOjEwMCU7aGVpZ2h0OmF1dG87d2lkdGg6YXV0bzt0cmFuc2l0aW9uOnRyYW5zZm9ybSAwLjI1cyBlYXNlfS50Yi1pbWFnZSAudGItaW1hZ2UtY2FwdGlvbi1maXQtdG8taW1hZ2V7ZGlzcGxheTp0YWJsZX0udGItaW1hZ2UgLnRiLWltYWdlLWNhcHRpb24tZml0LXRvLWltYWdlIC50Yi1pbWFnZS1jYXB0aW9ue2Rpc3BsYXk6dGFibGUtY2FwdGlvbjtjYXB0aW9uLXNpZGU6Ym90dG9tfSAudGItaW1hZ2VbZGF0YS10b29sc2V0LWJsb2Nrcy1pbWFnZT0iMWU4ZWNmMTk4MGEyZWVlZGU2MDVhMjdjMDQ4ZWM0NjgiXSB7IG1heC13aWR0aDogMTAwJTsgfSAudGItaW1hZ2VbZGF0YS10b29sc2V0LWJ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dlLWNhcHRpb257ZGlzcGxheTp0YWJsZS1jYXB0aW9uO2NhcHRpb24tc2lkZTpib3R0b219LnRiLWltYWdle3Bvc2l0aW9uOnJlbGF0aXZlO3RyYW5zaXRpb246dHJhbnNmb3JtIDAuMjVzIGVhc2V9LndwLWJsb2NrLWltYWdlIC50Yi1pbWFnZS5hbGlnbmNlbnRlcnttYXJnaW4tbGVmdDphdXRvO21hcmdpbi1yaWdodDphdXRvfS50Yi1pbWFnZSBpbWd7bWF4LXdpZHRoOjEwMCU7aGVpZ2h0OmF1dG87d2lkdGg6YXV0bzt0cmFuc2l0aW9uOnRyYW5zZm9ybSAwLjI1cyBlYXNlfS50Yi1pbWFnZSAudGItaW1hZ2UtY2FwdGlvbi1maXQtdG8taW1hZ2V7ZGlzcGxheTp0YWJsZX0udGItaW1hZ2UgLnRiLWltYWdlLWNhcHRpb24tZml0LXRvLWltYWdlIC50Yi1pbWFnZS1jYXB0aW9ue2Rpc3BsYXk6dGFibGUtY2FwdGlvbjtjYXB0aW9uLXNpZGU6Ym90dG9tfSB9IA==

Let's go over the most popular use-cases for customizing the WooCommerce "My Account" page with Toolset.

Hide Additional Content from Visitors

Before actually adding anything to the "My Account" page, let's make sure we display additional content only to logged-in Customers. Remember, visitors that are not logged-in could also reach this page. In this case, the custom content you add to this page wouldn't make sense and most of it would render empty.

Steps to display custom content on the "My Account" page only for Customer and Administrator roles:

  1. Insert the Toolset Conditional block. Click the button to add conditions and a pop-up dialog appears.
  2. In the left dropdown, select the Current user role option.
  3. In the right dropdown, select the Other role option.
  4. In the new dropdown that appears, select Customer.

Using the Toolset Conditional block to display content only to users with a Customer role

You will probably want the site's administrator to also see this content on the front-end.

  1. Still in the same dialog, click the plus button to add another condition.
  2. This time, select Other roleAdministrator.

That's it, click Accept and then put all your additional custom content inside the Conditional block.

Add a List of Posts Submitted by the Current User

With Toolset, you can create forms so users can submit new content from the front-end.

"My Account" page is a sensible place to show the current user a list of posts that they have submitted.

Use the following steps to create such View:

  1. Edit the "My Account" page.
  2. Insert theViewblock either before or after the block containing the woocommerce_my_account shortcode.
  3. Create a new View, select the type of content you want to list, and design its output using blocks.
  4. Click to select the mainViewblock and in the right sidebar, expand theContent Selection section.
  5. In the Query Filters sub-section, click Add a filter.
  6. In the dialog that appears, select to filter byPost author and clickAdd query filter.
  7. In the right sidebar, select thePost author is the same as the logged in useroption and clickSave.

Users will now see a list of the posts they submitted.

WooCommerce "My Account" page with a list of posts submitted by the current user

You might want to also allow them to edit or delete their posts. You can learn more about this in the lesson about allowing users to manage their items.

WordPress provides some basic fields for user profiles like name, nickname, email, website, and more.

With Toolset, you can add any custom fields to your user profiles:

  1. Go to Toolset Custom Fields, click the User Fields tab, and then the Add New Group button.
  2. Give a name to your new group of custom user fields.
  3. Click the Add New Field button to add a field. You can add any number of fields.

Now, all user profiles will include the fields you added.

Of course, you can then also display them on the front-end:

  1. Edit the "My Account" page.
  2. Insert the Fields and Text block either before or after the block containing the woocommerce_my_account shortcode. You can use any number of Fields and Text blocks.
  3. In the editor of the Fields and Text block, click the Views button.
  4. In the pop-up dialog that appears, you can find your custom group of user fields. Click the user field you want to insert.
  5. Select the option to display the field for the current logged in user and click Insert shortcode.

Custom user fields displayed on the WooCommerce "My Account" page

Further Customization of the Custom Content

Besides adding custom content to the "My Account" page, you can use any 3rd-party blocks for designing.

For example, if you want to display all your extra custom information inside tabs, we suggest using Kadence Blocks. Their Tabs block provides horizontal and vertical tabs with great designing options.

How to Add Custom Field in Woocommerce My Account Page

Source: https://toolset.com/course-lesson/adding-toolset-blocks-to-the-woocommerce-my-account-page/