pmpro_report_sales_widget

The Paid Memberships Pro pmpro report sales widget function.

Description

pmpro_report_sales_widget(); 

Usage

  1. if ( !function_exists( 'pmpro_report_sales_widget' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/adminpages/reports/sales.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = pmpro_report_sales_widget(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/adminpages/reports/sales.php  
  1. function pmpro_report_sales_widget() 
  2. global $wpdb; 
  3. ?> 
  4. <style> 
  5. #pmpro_report_sales tbody td:last-child {text-align: right; } 
  6. </style> 
  7. <span id="pmpro_report_sales"> 
  8. <table class="wp-list-table widefat fixed striped"> 
  9. <thead> 
  10. <tr> 
  11. <th scope="col"> </th> 
  12. <th scope="col"><?php _e('Sales', 'paid-memberships-pro' ); ?></th> 
  13. <th scope="col"><?php _e('Revenue', 'paid-memberships-pro' ); ?></th> 
  14. </tr> 
  15. </thead> 
  16. <tbody> 
  17. <tr> 
  18. <th scope="row"><?php _e('Today', 'paid-memberships-pro' ); ?></th> 
  19. <td><?php echo number_format_i18n(pmpro_getSales("today")); ?></td> 
  20. <td><?php echo pmpro_formatPrice(pmpro_getRevenue("today"));?></td> 
  21. </tr> 
  22. <tr> 
  23. <th scope="row"><?php _e('This Month', 'paid-memberships-pro' ); ?></th> 
  24. <td><?php echo number_format_i18n(pmpro_getSales("this month")); ?></td> 
  25. <td><?php echo pmpro_formatPrice(pmpro_getRevenue("this month"));?></td> 
  26. </tr> 
  27. <tr> 
  28. <th scope="row"><?php _e('This Year', 'paid-memberships-pro' ); ?></th> 
  29. <td><?php echo number_format_i18n(pmpro_getSales("this year")); ?></td> 
  30. <td><?php echo pmpro_formatPrice(pmpro_getRevenue("this year"));?></td> 
  31. </tr> 
  32. <tr> 
  33. <th scope="row"><?php _e('All Time', 'paid-memberships-pro' ); ?></th> 
  34. <td><?php echo number_format_i18n(pmpro_getSales("all time")); ?></td> 
  35. <td><?php echo pmpro_formatPrice(pmpro_getRevenue("all time"));?></td> 
  36. </tr> 
  37. </tbody> 
  38. </table>  
  39. </span> 
  40. <?php