| Project: | Ubercart Contributions |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I want to bring to attention that many Ubercart modules are not using the 'product_types' hook when they probably should.
Instead of something like this:
$p_types = module_invoke_all('product_types');
foreach ($p_types as $id) {
$product_types[] = "'". $id ."'";
}
modules are just dipping into the uc_product_class table for a quick look and adding the default 'product'. eg:
$product_types = array("'product'");
$types = db_query("SELECT DISTINCT(pcid) FROM {uc_product_classes}");
One instance of this happening is in uc_reports: function uc_reports_products().
I have brought up this issue because I created a new product type uc_event (a paid event), using the 'product_types' hook implementation and I want to enable uc_reports to report on it. I have modified my uc_reports script in order to make this happen and am requesting that this go to core.
I will report back here on any other instances in uc modules where I think the 'product_types' hook should be used.

