1. Home
  2. WC Vendors Pro
  3. How To
  4. Customization and Pagination of Vendor List

Customization and Pagination of Vendor List

The shortcode wcv_pro_vendorslist is available for WC Vendors Pro v1.2.3 and above. To customize the shortcodes output, see the template /templates/front/pro-vendor-list.php. By default, we use WooCommerce pagination for the shortcode. If you want to change it, see the sample code below.

WC Vendors Pro vendors list uses the same layout as the default woocommerce pagination. If your theme is overriding the layout of the pagination links then you can use the following snippets (modified for your theme) to make the vendor list pagination links wrap with your theme wrappers and styles.

<?php
// Pagination wrapper opening tag
add_filter( 'wcv_pagination_before', 'wcv_pagination_before_wrapper' ); 
function wcv_pagination_before_wrapper( $html ) { 
	return '<div class="somethign else">'; 
}

// Pagination wrapper closing tag 
add_filter( 'wcv_pagination_after', 'wcv_pagination_after_wrapper' ); 
function wcv_pagination_after_wrapper( $html ) { 
	return '</div>'; 
}

// Pagination links arguments that may need to change if your theme overrides these too. 
add_filter( 'wcv_pagination_args', 'wcv_pagination_link_args', 10, 3 ); 
function wcv_pagination_link_args( $args, $current_page, $total_pages ) { 

	// Modify this argument array to replicate what your theme uses 
	return array(  
			    'base' => get_pagenum_link( ) . '%_%',  
			    'format' => 'page/%#%/',  
			    'current' => $current_page,  
			    'total' => $total_pages,  
			    'prev_next'    => false,  
			    'type'         => 'list',  
	); 
}

?>

filters

Updated on December 20, 2016

Was this article helpful?