Reputation: 155
I want to display a custom wordpress page at the "my-account" page. (Only display it if the user is logged in).
if user is not logged in, it should show the standard Login / Register. That's ok.
Right now, the my-account page, after logging in, shows the standard "From your account dashboard you can view your recent orders, manage your shipping and billing addresses and edit your password and account details." message.
I don't want that. I want users to land on a completely different wordpress page if they are logged in and visit "my-account".
Thanks, Jo
Upvotes: 0
Views: 5673
Reputation: 3572
You can create a new shortcode for that.
<?php
add_shortcode('woocommerce_my_account_custom','woocommerce_my_account_custom');
function woocommerce_my_account_custom(){
if (!is_user_logged_in()) return do_shortcode('[woocommerce_my_account]');
else {
$custompage=get_post(ANOTHER_PAGE_ID);//different page ID which contains custom data for logged in users
echo apply_filters('the_content',$custompage->post_content);
}
}
And then replace [woocommerce_my_account] shortcode with [woocommerce_my_account_custom].
Upvotes: 1