Home Forums WC Vendors Pro Support user_login display of a vendor

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #23817
    netteran
    Participant

    How to display a user_login of a vendor in store-header.php ?

    Thx in advance!

    #23828
    netteran
    Participant

    I bump up the topic:

    Generally I want to link vendors with authors of posts and the common factor is user_login.

    I’m trying to list excerpts of posts of particular vendor by its user_login, because I allowed them to wirte posts from the front-end.

    If I manage to call a user_login on a store-header.php I would be able to display the posts of the particular vendor.

    #23837
    WC Vendors Support
    Participant

    The ID of the vendors store is stored in $vendor_id — so all you need to do is use echo get_user_meta( $vendor_id, 'user_login', true);

    #23865
    netteran
    Participant

    This code
    <?php echo get_user_meta( $vendor_id, 'user_login', true); ?>
    is not working.

    I doesn’t display the vendors usre_login on particular venor store header 🙁

    #23866
    WC Vendors Support
    Participant

    Try:

    $vendor_login = get_user_meta( $vendor_id, 'user_login', true);
    echo $vendor_login;

    If that doesnt work:

    echo $vendor_id; and make sure the vendor ID is showing a #.

    #23886
    netteran
    Participant

    It works only when echoing $vendor_id in code:

    $vendor_login = get_user_meta( $vendor_id, 'user_login', true);
    echo $vendor_id;

    $vendor_login is not workin 🙁

    #23887
    WC Vendors Support
    Participant

    Oops! I’m so sorry. Total brain fart. get_user_meta is for user meta. The user_login is not user meta, it’s userdata. Instead of get_user_meta we use get_userdata and then echo out the array key.

    $vendor_userdata = get_userdata( $vendor_id);
    echo $vendor_userdata->user_login;

    Cheers

    #23929
    netteran
    Participant

    It works.

    Thanks!!!!!!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.