简体   繁体   中英

Woocommerce - How to edit dashboard my account with elementor

Premise: I am a fan and not a programmer. I share this information because I have not found any solution on stackoverflow or google. So, working on my problem I was able to find a solution that I want to share. Maybe it can be useful to someone who is in the same situation as me. Sorry for my bad English.

By working on my website I have come to the point of customizing my account area. I started with the dashboard that all users see in their account.

As far as I know there are only two ways to customize the dashboard.

Way 1 : Through third party plugins: This is useful when you have no programming skills and do not know how to act on the php file.

Way 2 : Through the "dashboard.php" template file in woocommerce / templates / myaccount: This is preferable when you know at least a bit of php code and know how to structure everything.

There are no other ways to edit the dashboard. If you try elementor you realize that there is no section / option or page where you can change the dashboard of my account.

In my case I chose the second method because with the first method I could not customize the dashboard as I wanted. One of the problems with third-party plugins is that they have built-in functions, so they place some limits on modifying the dashboard. Put simply, you can't do everything you want with plugins.

Now, what I did was insert a single line of code into the dashboard.php file to make it editable with elementor. This way I can modify the content of the dashboard with everything that elementor offers. Obviously, if you want to insert particular functions such as showing the last order information on the dashboard, you still have to write some code in the dashboard.php file.

Here is the process of what I have done step by step. I specify that to do all this you need elementor pro.

Step 1 : In the child folder of your theme create a new folder titled woocommerce, inside it create another folder titled myaccount. At the end you should have this path: / wp-content / themes / your-child-theme / woocommerce / myaccount

Step 2 : Inside the myaccount folder you will need to create a new file called dashboard.php.

Step 3 : Open the dashboard.php file and paste the following line of code as is: <? Php echo do_shortcode ('[elementor-template id = "xxxxx"]'); ?> <? Php echo do_shortcode ('[elementor-template id = "xxxxx"]'); ?> <? Php echo do_shortcode ('[elementor-template id = "xxxxx"]'); ?> save the file and then you will go back to editing it.

Step 4 : Now with elementor pro we need to create a new template. In the wordpress menu go to template> new and create a new template by selecting "section" as template. Give it whatever name you want, it doesn't matter. After creating the new template do not modify it, you will do it later.

Step 5 : After creating and saving the template Go to the "saved templates" section of elementor, here you will find the list of all the templates you have created. Find the newly created template and on the right side of the list you should notice the shortcode section. Each template created with elementor pro has its own shortcode. Once you find the shortcode copy the id.

Step 6 : Go to the previously created dashboard.php file and paste the template id instead of xxxxx. An example, in my case the id of the template I am using is 39679 so the code is <? Php echo do_shortcode ('[elementor-template id = "39679"]'); ?> <? Php echo do_shortcode ('[elementor-template id = "39679"]'); ?> <? Php echo do_shortcode ('[elementor-template id = "39679"]'); ?> Once this is done, save the dashboard.php file and that's it.

The template you created with elementor pro will now be visible in the my account dashboard. All you have to do is modify the template as you wish through elementor.

All we did was simply introduce an elementor template into the dashboard. By doing so, what is originally present in the dashboard is not shown, but only the template we have inserted is displayed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM