NB: Make sure you do a back up of your theme, files and database before attempting the tutorials


---- Last modified : Mar 25 2022

We will display the number of vendors from the Dokan Multivendor plugin. Vendors can sign up to websites using this plugin.

Vendors need to activate their Dokan Multivendor online store. In order to do so, I recommend creating a query displaying the number of vendors that have activated their online store.

Dokan Multivendor has multiple User Metas including one called dokan_enable_selling which displays yes or no for their online store activation.

function woocl_total_count_members_seeling_status($status) {	
	global $wpdb;
	$count = $wpdb->get_var( $wpdb->prepare(
		"SELECT COUNT(*) FROM $wpdb->users
		LEFT JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id
		WHERE meta_key = 'dokan_enable_selling'
		AND meta_value = '$status';"
	, $level ));
	return $count;

Display the number of vendors - Activated online stores.

You can choose yes or no.

<?php echo woocl_total_count_members_seeling_status('yes'); ?>

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>