Commit 3a97920a authored by anthonylindsay's avatar anthonylindsay

Get available product types up front and use them to define settings checkboxes.

parent acbbba32
......@@ -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.'),
......
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