Hi,
is there a way to integrate WooCommerce My Account page with layouts/views so that, e.g., this page contains user submitted CRED forms as well? What would be the optimal way to do it?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Piotr,
Unfortunately no this is not possible since this is an internal template that is being generated by woocommerce.
Thanks,
SHane
Ok,
I found that the My Account page can be customized by adding/removing links: hidden link
I could and a new endpoint to the WooCommerce and then fill this endpoint with a content, e.g., from the above-mentioned page:
function iconic_information_endpoint_content() {
echo 'Your new content';
}
add_action( 'woocommerce_account_information_endpoint', 'iconic_information_endpoint_content' );
But is there a way to at least include a layout to show on set endpoint this way?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Piotr,
Actually changing the endpoint would just change the link I believe.
So it would still load the default woocommerce account template so it still wouldn't be possible but just change the links.
Thanks,
Shane
Dear Shane,
but this is perfectly fine, I need to customize menu on the WC My Account page and include custom content, preserving the general WC My Account page.
I did some test and managed to include custom link with a simple text shown this way (earlier I need to configure and register endpoints):
function my_account_endpoint_content() {
echo( 'Test' );
}
add_action( 'woocommerce_account_enquiries_endpoint', 'my_account_endpoint_content' );
And now the question is, is it possible to call a Toolset layout or a view from the above function (to appear where "Test" is on the attached screen)?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Piotr,
I see I thought that you wanted to use a different template for the my account page and not just add another option to the page itself.
It is indeed possible to call a view here and can be done by using the function below.
https://toolset.com/documentation/programmer-reference/views-api/#render_view
Please let me know if this helps.
Thanks,
Shane