Home Forums WC Vendors Pro Support Get Store Name from Vendor Id

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 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #66671
    Malavika Gupta
    Participant

    I have a function that returns the Vendor Id. Is there a way to get the Store name from these vendor Ids and return the store name instead? I have tried my best but in vain. Thanks

    function tep_exclude_users( $args )
    {
    $args = array( ‘role’ => ‘vendor’ ) ;
    $user_query = new WP_User_Query( $args );
    return $args;
    }
    add_filter(‘tep_directory_arguments’, ‘tep_exclude_users’);

    #66677
    DELETE
    Participant

    If you already have the vendor ID, the easiest way to do that would be WCV_Vendors::get_vendor_shop_name( stripslashes( $vendor_id ) )

    -Avishai

    #66699
    Malavika Gupta
    Participant

    Thanks Avishai.
    I am not sure how to use WCV_Vendors::get_vendor_shop_name( stripslashes( $vendor_id ) )
    on the above function.

    If I do something like below, it returns no users
    function fep_exclude_users( $args )
    {
    $vendors = array( ‘role’ => ‘vendor’ ) ;
    $user_query = new WP_User_Query( $args );
    foreach( $vendors as $vendor ) {
    $args= WCV_Vendors::get_vendor_shop_name( stripslashes( $vendor_id ) );
    }
    return $args;
    }
    add_filter(‘fep_directory_arguments’, ‘fep_exclude_users’);

    #66948
    Malavika Gupta
    Participant

    I can work with Vendor Id, so please consider this as resolved.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.
This website uses cookies to ensure you get the best experience on our website.