Contrib type:
ModuleStatus:
Uploaded for testingSponsored by:
Sundays EnergyCompatibility:
Ubercart Alpha 7eLatest version:
0.4-devA really basic report that lists all the products in the store with the following columns.
ID | Title | Price | Quantity | Total | Number of Times Purchased
Quantity refers to the total number of times it has been ordered.
Number of times purchased refers to the number of orders with the product in it (popularity).
Clicking on a product shows a list of all the customers who have purchased the product. Useful for events and such.
Work in progress, just wanted to post ASAP.
| Attachment | Size |
|---|---|
| 0.4 uc_stats.zip | 2.52 KB |


Re: Basic Product Report
Awesome! I'll check try to check this out tomorrow and give some feedback. It would be awesome to get some reports in core.
EDIT: Ok, just checked this out. You're headed in the right direction, and here's a few tips... to only show products, you'll want to adjust the SQL to include a check on the node type. You can use IN (array) in your query and generated the array using the function uc_product_node_info() I believe to return all the product node types.
Sortable tables are fairly easy to accomplish, but it can be hard to make sense of Drupal's documentation. You need to use the tablesort functions, and you can look in uc_order.module for an example in the function uc_order_history() in Alpha 7e and later.
I'd recommend using either a dynamic menu item or just checking for arg(4); and adding a /#nid to the end of your URLs instead of ?nid=#nid.
Good luck with continued work.
Sortable Tables
Hi there,
couldn't find the function uc_order_history() in the uc_orders.module
version = "5.x-1.0-alpha7e"
Any other suggestions of where to find an example?
Thanks.
Re: Basic Product Report
Nice, I see you fixed the tablesort and node type.
By way of a couple suggestions... in the .info file, using Reports instead of reports is causing that fieldset to display out of order. Silly, I know, but it'd be nice to have it display in order.
Also, given the confusing column titles and the fact that it requires an explanation right now... What if you renamed times purchased to "Orders found" and quantity to "Total bought" or something like that.
It would also be helpful for the results pages to use Drupal's pager. (See pager_query().) I've got some products on Livetest on hundreds of orders, and that just makes the page huuuge.
Bug into Products Order Status Report
Product1 -> add revision (price modify) ==> Products Order Status Report
obtained result:
Quantity (listed in report) = Qtt revision 1 + Qtt revision2 + ... Qtt revision N
Must be:
Quantity (listed in report) = Qtt revision N
where
revision N = Current revision
Format improvements
Thanks, very simple and useful module, I using it as base for my more complex report-module.
In your original version for displaying prices you using
<?php'$'.sprintf("%01.2f", $order->sell_price)
?>
This is not right, you need use uc_currency_format() function to show prices in UC:
<?phpuc_currency_format($order->sell_price)
?>
Read more about uc_currency_format() function.
All the world don't using dollars, remember this
In attached file I correct your code to use uc_currency_format().
0.4 i
I made more complex version of this module. Many improvements and useful things added, many needless things removed, few little bugs corrected (I hope
). Also this version have integration with uc_inventory_api module (but can works without it).
My shop following to conception "free price": every product has "official" price, but my manager can set "special" price (less or more then "official") for every item in order.
Primer: continual or wholesale customer needs less price than anonymous.
And this version of report module I made with this conception in mind: you can see real money statistic of every sold item considering "special" price.
In real, works of my version not so tangled - everything is clear and simple
Try it!
Module compatible with UC Alpha 7e - Beta 2