Commit 26bfb65c authored by anthonylindsay's avatar anthonylindsay

Changed from sql query to get product names to commerce_product_types() function.

parent 33acb6df
......@@ -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