diff --git a/commerce_popular_products.module b/commerce_popular_products.module index 1d5f0d12e523301e3635987d817bd4ce881f3c6f..4df68ce24ab136213ff800481320be5149044d27 100644 --- a/commerce_popular_products.module +++ b/commerce_popular_products.module @@ -179,7 +179,7 @@ function commerce_popular_products_menu() { function commerce_popular_products_settings() { $output = t('
Here you can define which product types are ranked for popularity & the period over which they are ranked.
'); $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; }