Forum Replies Created

Viewing 25 posts - 1 through 25 (of 25 total)
  • Author
    Posts
  • in reply to: Multiple User Roles #16305
    sanjay
    Participant

    you mean this is possible with wc vendor pro version ?????

    in reply to: Multiple User Roles #15916
    sanjay
    Participant

    Hi jamie is possible to you provide us that 12 files name so we can perfectly add multiple user roles.

    in reply to: How do i search vendors by there name. #13472
    sanjay
    Participant

    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(); 
    		
    		ob_start();
    	    // 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');
    
    	}
    in reply to: How do i search vendors by there name. #12392
    sanjay
    Participant

    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.

    http://pastebin.com/RtD4qrhX

    in reply to: How to create seo tittle for custom field. #8557
    sanjay
    Participant

    finally i got it

    function overwrite_vendor_title($desc) {

    // Return the default value if we're not on a vendor shop page
    if(!WCV_Vendors::is_vendor_page()) return $desc;

    // Get the vendor description and return it
    $vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
    $vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
    //$desc = get_user_meta( $vendor_id, 'pv_shop_description', true );
    $name = get_user_meta( $vendor_id, 'pv_shop_name', true );
    $city = get_user_meta( $vendor_id, 'pv_merchant_id2', true );
    $specialization = get_user_meta( $vendor_id, 'pv_merchant_specialization', true );

    $desc=$name." | ".$specialization." in ".$city." | Team Web";

    // Remove line breaks
    $desc = str_replace(array("\r", "\n"), " ", strip_tags($desc));
    // Remove extra spaces
    $desc = preg_replace( '/\s+/', ' ', $desc );
    // Escape special characters
    $desc = htmlspecialchars($desc);
    // Shorten it to 156 characters (153 + '...')
    $desc = substr($desc ,0,500).'...';

    return $desc;
    }
    add_filter( 'wpseo_title', 'overwrite_vendor_title', 10, 1);

    in reply to: How to create seo tittle for custom field. #8519
    sanjay
    Participant

    thanks bean. i will check.

    sanjay
    Participant

    I have resolved the bug $vendor_total_args['query_id'] replaced with $vendor_paged_args['query_id']

    if ($show_products == 'yes' ) $vendor_paged_args['query_id'] = 'vendors_with_products';

    /**
    * list of vendors
    *
    * @param $atts shortcode attributs
    */
    public function wcv_vendorslist( $atts ) {
    $html = '';

    extract( shortcode_atts( array(
    'orderby' => 'registered',
    'order' => 'ASC',
    'per_page' => '12',
    'columns' => '4',
    'show_products' => 'yes'
    ), $atts ) );
    $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
    $offset = ( $paged - 1 ) * $per_page;
    error_log(print_r($atts, true));
    // Hook into the user query to modify the query to return users that have at least one product
    if ($show_products == 'yes') add_action( 'pre_user_query', array( $this, 'vendors_with_products') );
    // Get all vendors
    $vendor_total_args = array (
    'role' => 'vendor',
    'meta_key' => 'pv_shop_slug',
    'meta_value' => '',
    'meta_compare' => '>',
    '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();
    // Get the paged vendors
    $vendor_paged_args = array (
    'role' => 'vendor',
    'meta_key' => 'pv_shop_slug',
    'meta_value' => '',
    'meta_compare' => '>',
    'orderby' => $orderby,
    'order' => $order,
    'offset' => $offset,
    'number' => $per_page,
    );
    if ($show_products == 'yes' ) $vendor_paged_args['query_id'] = 'vendors_with_products';
    $vendor_paged_query = New WP_User_Query( $vendor_paged_args );
    $paged_vendors = $vendor_paged_query->get_results();
    // Pagination calcs
    $total_vendors = count($all_vendors);
    $total_vendors_paged = count($paged_vendors);
    $total_pages = intval($total_vendors / $per_page) +1;

    ob_start();
    // Loop through all vendors and output a simple link to their vendor pages
    foreach ($paged_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() . '';
    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;
    }

    sanjay
    Participant

    hope you will fix asap for your plugin lovers.

    sanjay
    Participant

    hi been is there any update?

    sanjay
    Participant

    Is there any update on this and isconfirmed as bug ?????.

    sanjay
    Participant

    i have done it in own way click here
    Do not post site link publicly

    sanjay
    Participant

    no that vendor dont have any hidden product the problem in updated code you can check add vendor with old class-wcv-shortcodes.php and with new code so you will realize the actual.but need to sort out asap.

    sanjay
    Participant

    there is bug in new updated version for pagination in file class-wcv-shortcodes.php this file i have replace with old code which was not show pagination for vendor list after updating old code vendor not displaying which dont have any product.

    something wrong on 505 line on bellow code
    $paged_vendors = $vendor_paged_query->get_results();

    sanjay
    Participant

    vendor list link http://www.justforhearts.org/experts/page/5/

    and check the vendor DR ARCHANA CHOPADE

    vendor detail link http://www.justforhearts.org/experts/dr-archana-chopade/
    her you can see the vendor dont have any product after that is displayed on list

    <h1>Note:- do not post site link publicly.</h1>

    in reply to: Need idea for vendor filtration using custom filed #6959
    sanjay
    Participant

    i know bin you dont have large team but i am just asking idea not a all code.

    in reply to: Need idea for vendor filtration using custom filed #6954
    sanjay
    Participant

    anybody?????

    in reply to: Vendor list pagination not displaying all vendors. #6911
    sanjay
    Participant

    working charm Jamie thanks.

    in reply to: How to display vendor list with pagination? #6905
    sanjay
    Participant

    @ben updated version code getting issue like suppose if i have 38 vendors and i am showing [wcv_vendorslist per_page=10] using this short code so its showing only 30 vendor of them with 3 page pagination if i increase the size of vendors to 40 then its displaying vendor 40 with 4 page pagination i think there some little bit bug can you please look into this

    in reply to: How to display vendor list with pagination? #6904
    sanjay
    Participant

    thanks ben for a great support issue resolved working charm.

    in reply to: How to display vendor list with pagination? #6900
    sanjay
    Participant

    can you please tell me in which file you have made the changes.

    in reply to: How to display vendor list with pagination? #6898
    sanjay
    Participant

    Thanks ben for announcing me a winner i hope as soon as possible this will get resolved.

    in reply to: How to display vendor list with pagination? #6863
    sanjay
    Participant

    ok

    in reply to: How to display vendor list with pagination? #6860
    sanjay
    Participant

    yes it not works with wc vendor like this [wcv_vendorslist per_page=10]

    in reply to: change "vendor" slug to "expert" #5578
    sanjay
    Participant

    thanks done ):

    in reply to: sort vendor by shop setting field #5503
    sanjay
    Participant

    i am very new to php and wordpress at this point i am not able to figure out how do i code or query’s to achive this i have seen your plugin code for vendor list but i am to much confusing how do i start with code to achieve this goal can you please provide some sample code to sort vendor by them custom field.

Viewing 25 posts - 1 through 25 (of 25 total)