diff --git a/commerce_popular_products.module b/commerce_popular_products.module index cb4fefb92d8333776abfd0876be05bc8ebe6606f..4df68ce24ab136213ff800481320be5149044d27 100644 --- a/commerce_popular_products.module +++ b/commerce_popular_products.module @@ -136,6 +136,7 @@ function commerce_popular_products_block_info() { // A block To display a popular product. $blocks['popular-product-block'] = array( 'info' => t('Commerce Popular Products display block'), + 'region' => array('Content'), 'weight' => '-50', ); return $blocks; @@ -192,19 +193,6 @@ 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(); - $options = array(); - - foreach ($product_types as $type) { - $options[$type] = $type; - } - if (!isset($products)) { - $product_array = array(); - foreach ($product_types as $type) { - $product_array[$type] = 0; - } - $products = $product_array; - } $form['block_title'] = array( '#type' => 'textfield', '#title' => t('Block title.'), @@ -217,7 +205,11 @@ function commerce_popular_products_settings_form($form, &$form_state) { '#description' => t('Product nodes to include in the popularity check.'), '#default_value' => $products, ); - + $product_types = commerce_popular_products_get_product_types(); + $options = array(); + foreach ($product_types as $type) { + $options[$type] = $type; + } $form['product_types']['#options'] = $options; $form['time_period'] = array( '#type' => 'radios', @@ -244,7 +236,7 @@ function commerce_popular_products_settings_form($form, &$form_state) { ), '#default_value' => $number, ); - $form['submit'] = array('#type' => 'submit', '#value' => t('Save')); + $form['submit'] = array('#type' => 'submit', '#value' => t('Save'));; return $form; }