summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Lindsay2012-08-03 21:05:22 (GMT)
committerAnthony Lindsay2012-08-03 21:05:22 (GMT)
commit26bfb65c5823e8bb885694d91ef5c3abc9e0a4ec (patch)
treee174aa335dc7de46ead6c832fc888f63a563e87a
parent33acb6df1656aa07a90f295e16462cb1b34b79b1 (diff)
Changed from sql query to get product names to commerce_product_types() function.
-rw-r--r--commerce_popular_products.module8
1 files changed, 5 insertions, 3 deletions
diff --git a/commerce_popular_products.module b/commerce_popular_products.module
index fb76ca8..4df68ce 100644
--- a/commerce_popular_products.module
+++ b/commerce_popular_products.module
@@ -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;
}