I've got content-type with two fields with real values. Their interior name are field_price1 and field_price2. I created page view includes contents. I've got search. I want to allow user to give some value(s) in search (min and max) to seek contents. I want to display only these contents whose field_price1 OR field_price2 is between min and max filled in by user.
Has someone any ideas?
I tried and I decided to create two filters. First filter (for field_price1) exposed, second (for field_price2) not. So that, in my search I've got two inputs (I chose between operator). I wanted the second filter inherits values from first filter. I coded:
function customSearch_views_pre_execute(&$view) {
if ($view->name == 'search') {
$filters = $view->display_handler->get_option('filters');
$filters['field_price2_value']['value']['min'] = $view->exposed_input['field_price1_value']['min'];
$filters['field_price2_value']['value']['max'] = $view->exposed_input['field_price1_value']['max'];
$view->display_handler->override_option('filters', $filters);
}
}
I place that function in my custom module named customSearch. My view is named search. Unfornately it doesn't work. Second filter doesn't inherit values from first one. I don't know why. Could someone help me, please?