Show a download’s sale and download count

Here’s a short tutorial for Easy Digital Downloads that adds a download’s sales and download count to the Download Details widget, found under Appearance → Widgets. If you’d like to show the counts somewhere else, simply call each function and pass in your download’s ID.

The Download Details widget shown on the 2013 theme

Copy and paste the following (mind the opening PHP tag) into your child theme’s functions.php or custom plugin.

14 thoughts on “Show a download’s sale and download count”

  1. Hi,
    I’m using EDD and I wanted i download counter but with your solution It does not work
    1- I’m using a custom theme and I have not your widget. Can you tell me how to add it to my theme.
    2- with your code It always show me 0 for the downloads !!?
    – Can you please post a step by step solution Thank you in advance.

    PS: I don’t have any programming skills.

    1. This tutorial is designed to work with the widget that EDD provides, it’s not a widget I have built. Go to the widgets section and drag the “download details” widget into your widget area. How are you using the code when it’s showing 0? can you show me an example?

  2. Looks like my post got deleted. i’ll try again.

    How can i show total sales for all the products combined? like if i have 5 products, how, i need a way to add up all sales into one.


    1. Posts needs to be moderated if you’re a first time poster, it didn’t get deleted. I’ll see if I can put together a tutorial to show your total sales count, of all downloads combined.

  3. Hi I am having a little trouble writing an if else statement for this. Basically I found a small problem with this snippet of code. If a user has 1 sale, it says 1 sales. I am wondering how to make it say sale for 1 sale and sales for anything else. I hope that makes sense.

Leave a Reply

Your email address will not be published. Required fields are marked *