Support » Plugin: User Registration & User Profile - Profile Builder » Add profile form to My Account page

  • Resolved kostiantyn

    (@kostiantyn)


    Hi,

    I have created an edit-profile form [wppb-edit-profile form_name=”medical-information”] and I would like to display its result in a separate tab on My Account page.

    I have created a custom endpoint. And is able to display the profile details in this way

    function my_custom_endpoint_content() {
    echo ‘<h3>Next of Kin</h3>’;
    global $current_user;
    get_currentuserinfo();
    echo ‘First Name ‘ . $current_user->next_of_kin_first_name . “\n”;
    echo ‘Last Name ‘ . $current_user->next_of_kin_last_name . “\n”;
    echo ‘Phone Number ‘ . $current_user->next_of_kin_phone . “\n”;
    }

    add_action( ‘woocommerce_account_my-custom-endpoint_endpoint’, ‘my_custom_endpoint_content’ );

    Is it possible to display all information that was submitted through a particular edit-profile form?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Actually I see that it saves the field entries. So, is it possible to display it the way it is displayed on the page using the shortcode?

    Plugin Author Gabriel Berzescu

    (@gabrielberzescu)

    Hello @kostiantyn

    We have here a guide for displaying a user meta by using a shortcode.

    https://www.cozmoslabs.com/docs/profile-builder-2/developers-knowledge-base/shortcodes/display-user-meta/

    With the best of wishes,
    Gabriel

    Hi @gabrielberzescu
    Thanks for your reply.

    I cannot insert a shortcode into My Account page because it’s generated by WooCommerce. So I think I’m missing something.

    Plugin Author Gabriel Berzescu

    (@gabrielberzescu)

    Hi @kostiantyn

    Oh, I see now.

    In this case, the only solution that comes to mind is placing our shorcode either above or below the woocommerce shortcode.

    We can’t mess much with the WooCommerce code.

    Are you using the free or a paid version?

    We are not allowed to speak about the paid version here, so in case you are using it, please contact us via the support ticket form here:

    https://www.cozmoslabs.com/support/open-ticket/

    Best regards,
    Gabriel

    Yes, I’m using the free version.

    I have created a custom endpoint to display content on My Account page. And I can display the fields one by one

    function my_custom_endpoint_content() {
    echo ‘<h3>Next of Kin</h3>’;
    global $current_user;
    get_currentuserinfo();
    echo ‘First Name ‘ . $current_user->next_of_kin_first_name . “\n”;
    echo ‘Last Name ‘ . $current_user->next_of_kin_last_name . “\n”;
    echo ‘Phone Number ‘ . $current_user->next_of_kin_phone . “\n”;
    }

    add_action( ‘woocommerce_account_my-custom-endpoint_endpoint’, ‘my_custom_endpoint_content’ );

    But I would like to display it the way it displays by shortcode on any other page. How do I display a specific form without a shortcode?

    Plugin Author Gabriel Berzescu

    (@gabrielberzescu)

    Hi,

    Perhaps the do_shortcode() WordPress function will help.

    You may use it like this:

    echo do_shortcode('[name_of_shortcode]');

    Best regards,
    Gabriel

    Hi Gabriel,

    It worked, thanks for your help!

    Best regards,
    Kostiantyn

    Plugin Author Gabriel Berzescu

    (@gabrielberzescu)

    Hello Kostiantyn,

    Great! Thanks for letting me know 🙂

    Please don’t forget: a review can help us greatly.

    Best of regards,
    Gabriel

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.