Commit 63807ea9 authored by anthonylindsay's avatar anthonylindsay

Changed sql query to find product types to use Commerce api call.

parent 25c8818c
......@@ -179,7 +179,7 @@ function commerce_popular_products_menu() {
function commerce_popular_products_settings() {
$output = t('<p>Here you can define which product types are ranked for popularity & the period over which they are ranked.</p>');
$form = drupal_get_form('commerce_popular_products_settings_form');
$output .= render( &$form);
$output .= render(&$form);
return $output;
}
......@@ -260,9 +260,11 @@ function commerce_popular_products_settings_form_submit($form, &$form_state) {
* A simple query to return all the Commerce product types in the database.
*/
function commerce_popular_products_get_product_types() {
$sql = 'SELECT name from {commerce_product_type}';
$result = db_query($sql)->fetchCol();
return $result;
$products = commerce_product_types();
foreach ($products as $item) {
$names[] = $item['name'];
}
return $names;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment