Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    add_shortcode( 'wc_download_count', 'wc_download_count' );
    
    function wc_download_count() {
    	global $wpdb;
    
    	echo absint( $wpdb->get_var( "SELECT SUM(download_count) FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions;" ) );
    }
    Thread Starter Mian Shahzad Raza

    (@mianshahzadraza)

    Hi,
    thanks for your quick response. i am in a bit of situation and would be glad if you could help with above code a bit more.
    I have multisite network and i want to display download count in main site where woocommerce is setup in other site in network
    want to display stats here https://stylothemes.com/
    where woocommerce is setup over here https://stylothemes.com/shop/

    Plugin Contributor Mike Jolley

    (@mikejolley)

    You’d have the change the prefix used in the SQL query then. The same database is used across multisite so thats no issue.

    Consider jobs.wordpress.net if you need further code customisation.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display Downloads Count’ is closed to new replies.