# "Sold X Times" Note Under EDD Purchase Buttons

> Shows how many times a download has been bought under its purchase button, as social proof, once it passes a minimum number of sales.

- Type: PHP
- Runs: Run everywhere
- Category: [Easy Digital Downloads](https://wpide.com/library/category/edd/)
- Requires: Easy Digital Downloads
- Tags: edd, social-proof, sales, conversion
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/edd-sales-count-badge/

## Code

```php
$wpide_edd_min_sales = 10; // Show the note from this many sales.

add_action( 'edd_purchase_link_end', function ( $download_id ) use ( $wpide_edd_min_sales ) {
    $sales = (int) edd_get_download_sales_stats( $download_id );

    if ( $sales >= $wpide_edd_min_sales ) {
        printf( '<p class="wpide-edd-sales" style="margin:.5em 0 0;font-size:.9em;opacity:.8">%s</p>', esc_html( sprintf( 'Bought %s times', number_format_i18n( $sales ) ) ) );
    }
} );
```

## Notes

Hidden until a download reaches $wpide_edd_min_sales sales, so new products do not show low numbers.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find ""Sold X Times" Note Under EDD Purchase Buttons" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
