I have installed 'better exposed form' module on my Drupal 7 site, I created a view for commerce module catalog, and made a slider range filter on JQuery, here it is (sorry, the site is in russian language, but anyway, the essential thing is a JQueryUI slider) http://doors.ekt0.ru/. So, the question is, how to set the slider minimum and maximum possible values programatically from a hook. This is because a want to make the min and max prices be real, from the database table with product prices. Here is my code:
function zen_form_views_exposed_form_alter(&$form, $form_state) {
$minmax = db_query('SELECT MIN(`commerce_price_amount`) AS `min`, MAX(`commerce_price_amount`) AS `max` FROM `field_data_commerce_price`')->fetchAssoc();
$form['commerce_price_amount']['min']['#value'] = $minmax['min'];
$form['commerce_price_amount']['max']['#value'] = $minmax['max'];
}
and here's the contents of 'commerce_price_amount' key of $form array:
[commerce_price_amount] => Array (
[#tree] => 1
[min] => Array (
[#type] => textfield
[#title] =>
[#size] => 30
[#default_value] =>
)
[max] => Array (
[#type] => textfield
[#title] => And
[#size] => 30
[#default_value] =>
)
)
So, as we see here, the only array key that looks like what I need is #default_value, but it's not actually the one, it doesn't make any visible changes to the form, and I also tried #value key (as on the code), but it sets default slider range values, just moving the knobs, not making minimum and maximum values. So the question is, how to do it, and the second question is that perhaps, there is any setting in the module to set that min and max values automatically (I coudn't manage to find anything in the settings). Thanks in advance!