Tag: edd

How to show top selling items on EDD

Use this query for showing top selling items.

$popular_items = new WP_Query (array(
	'post_type' => 'download',
	'orderby'   => 'meta_value_num',
	'meta_query'     => array(
		'relation' => 'AND',
		array(
			'key'     => '_edd_download_sales',
			'compare' => '>',
			'value'   => 0,
			'order'   => 'DESC',
		),
	),
	'posts_per_page' => 3
));

How to show total Downloads in Easy Digital Downloads (EDD)

Follow the below instruction to show total Downloads in Easy Digital Downloads (EDD).

Go to functions.php and paste this code:

function edd_count_total_file_downloads() {
    global $edd_logs;
    return $edd_logs->get_log_count( null, 'file_download' );
}

Then to bring it all together, you can get the total number of customers, products, and file downloads with the following PHP: Continue Reading