diff --git a/commerce_popular_products.module b/commerce_popular_products.module index 3db59e504462d9b87b0e17da964ea57e5a6d36b2..84806e23b49f8dd689f7500d0259af2901f6a445 100644 --- a/commerce_popular_products.module +++ b/commerce_popular_products.module @@ -198,7 +198,6 @@ function commerce_popular_products_settings_form($form, &$form_state) { '#type' => 'checkboxes', '#title' => t('Product Types.'), '#description' => t('Product nodes to include in the popularity check.'), - '#default_value' => $products, ); } else { @@ -213,6 +212,13 @@ function commerce_popular_products_settings_form($form, &$form_state) { $options[$type] = $type; } $form['product_types']['#options'] = $options; + if (empty($products)) { + $products = array(); + foreach ($product_types as $type) { + $products[$type] = 0; + } + } + $form['product_types']['#default_value'] = $products; $form['time_period'] = array( '#type' => 'radios', '#title' => t('Timeframe.'),