summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Lindsay2012-09-14 10:12:44 (GMT)
committerAnthony Lindsay2012-09-14 10:12:44 (GMT)
commit3a97920af3670cbce2f07ec1af855f9ff1809e03 (patch)
tree3d1444398fc3382f2da069c3cbb82d4fbb7e9ad4
parentacbbba32d6f5bd66a07b52541ebb8ccaed43a543 (diff)
Get available product types up front and use them to define settings checkboxes.
-rw-r--r--commerce_popular_products.module3
1 files changed, 2 insertions, 1 deletions
diff --git a/commerce_popular_products.module b/commerce_popular_products.module
index 7fcd05f..3db59e5 100644
--- a/commerce_popular_products.module
+++ b/commerce_popular_products.module
@@ -186,13 +186,14 @@ function commerce_popular_products_settings_form($form, &$form_state) {
$number = variable_get('commerce_popular_products_number', $default = '1');
$products = variable_get('commerce_popular_products_products');
$title = variable_get('commerce_popular_products_title', 'Popular Products This Month');
+ $product_types = commerce_popular_products_get_product_types();
$form['block_title'] = array(
'#type' => 'textfield',
'#title' => t('Block title.'),
'#description' => t('The title of the "popular products" block as shown to users.'),
'#default_value' => $title,
);
- if (isset($products)) {
+ if (isset($product_types)) {
$form['product_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Product Types.'),