Home Forums WC Vendors Free Support How do i search vendors by there name.

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.


Thank you to all of our customers!


Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #11007

    How do i search vendors by there vendor name.

    • This topic was modified 7 years, 3 months ago by sanjay.
    WC Vendors Support

    I’m not sure. It’s a feature we plan to add in the future, there may be a plugin on wordpress.org that allows you to do that now, I just don’t know of any in particular….


    Ok can you please give just one trick i am able search vendor by name suppose if i have vendor sam telyor and sandy teld,sarin teron ok suppose if i put the sandy teld in serch box and hit enter its shows the sandy teld vendor but i am looking for something if put “sa” or “te” in serch box and hit the enter button so it will show the vendor which have starting name from “sa” or surname “te” so that i have to use comapre operator for this so can you just boost me to create this.


    • This reply was modified 7 years, 3 months ago by sanjay.
    • This reply was modified 7 years, 3 months ago by sanjay.
    WC Vendors Support

    I have no idea……


    I have done this with simple text field with submit button.bellow is the code.

    function wc_vendors_location78( $atts ) {
    		$html = ''; 
    			extract( shortcode_atts( array(
    	  			'orderby' 		=> 'display_name',
    	  			'order'			=> 'ASC',
    			  	'per_page'      => '1',
    		  		'columns'       => '4', 
    		  		'show_products'	=> 'yes',
    				'pv_shop_name' => '',
    				'meta_compare' 		=> 'LIKE',
    		  		//'org'			=> '',
    		  	), $atts ) );
    	  	// Hook into the user query to modify the query to return users that have at least one product 
    	  	if ($show_products == 'yes') //remove_action( 'pre_user_query', array( $this, 'vendors_with_products') );
    		//add_action( 'pre_user_query', array( $this, 'vendors_with_products1') );
    		add_action( 'pre_user_query','vendors_with_products' );
    	  	// Get all vendors 
    	  	$vendor_total_args = array ( 
    	  		'role' 				=> 'vendor', 
    	  		'meta_key' 			=> 'pv_shop_slug',
      			'meta_value'   		=> '',
    		  	'meta_key' 			=> 'pv_shop_name', 
      			'meta_value'   		=> $_POST[ 'serchbyvendornamessss' ],
    			'meta_compare' => 'LIKE'
    		   	//'orderby' 			=> $orderby,
      			//'order'				=> $order,
    	  	if ($show_products == 'yes') $vendor_total_args['query_id'] = 'vendors_with_products'; 
    	  	$vendor_query = New WP_User_Query( $vendor_total_args ); 
    	  	$all_vendors =$vendor_query->get_results(); 
    	    // Loop through all vendors and output a simple link to their vendor pages
    	    foreach ($all_vendors as $vendor) {
    	       wc_get_template( 'vendor-list.php', array(
    	      										'shop_link'			=> WCV_Vendors::get_vendor_shop_page($vendor->ID), 
    														'shop_name'			=> $vendor->pv_shop_name, 
    														'vendor_id' 		=> $vendor->ID, 
    														'shop_description'	=> $vendor->pv_shop_description, 
    												), 'wc-vendors/front/', wcv_plugin_dir . 'templates/front/' );
    	    } // End foreach 
    	   //	$html .= '<ul class="wcv_vendorslist">' . ob_get_clean() . '</ul>';
    	   $html .= '<ul class="wcv_vendorslist">' . ob_get_clean() . '</ul>';
    	    if ($total_vendors > $total_vendors_paged) {  
    			$html .= '<div class="wcv_pagination">';  
    			  $current_page = max( 1, get_query_var('paged') );  
    			  $html .= paginate_links( 	array(  
    			        'base' => get_pagenum_link(1) . '%_%',  
    			        'format' => 'page/%#%/',  
    			        'current' => $current_page,  
    			        'total' => $total_pages,  
    			        'prev_next'    => false,  
    			        'type'         => 'list',  
    			$html .= '</div>'; 
    	    return $html; 
    	    //return $html; 
    	//start  speciality  
    	if ( !empty($_POST[ 'serchbyvendornamessss' ] ) ) {
    add_shortcode('wc_vendors_location', 'wc_vendors_location78');
    WC Vendors Support

    Nice work. 🙂


    Hey Guys!
    I am really intregued in using this solution to search by vendor name. How would i implement this? i have added the code to my functions.php doc and created a page and inserted shortcode [wc_vendors_location] on it but the shortcode does not do anything. when i visit the page it simply shows the text of [wc_vendors_location]. Any help would be greatly appreciated! 🙂



    Hello, i bump this post … any news? i’m trying to add the Vendors Search but without success from now, any help/idea to how add to the page the serach field?

    thanks so much


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