Thanks . I tried this
I tried this in search-form.php
Quote
<div class="row one_input">
<h6><?php _e('Mileage', 'cars_attributes'); ?></h6>
<select name="min_mileage" id="min_mileage">
<?php $min_mileage = Params::getParam('min_mileage') ; ?>
<option value=""><?php _e('min', 'cars_attributes');?></option>
<option value="0"><?php $min_mileage = 0; ?><?php _e('0 km', 'cars_attributes');?></option>
<option value="50000"><?php $min_mileage = 50000; ?><?php _e('50.000 km', 'cars_attributes');?></option>
<option value="100000"><?php $min_mileage = 100000; ?><?php _e('100.000 km', 'cars_attributes');?></option>
<option value="150000"><?php $min_mileage = 150000; ?><?php _e('150.000 km', 'cars_attributes');?></option>
<option value="200000"><?php $min_mileage = 200000; ?><?php _e('200.000 km', 'cars_attributes');?></option>
<option value="250000"><?php $min_mileage = 250000; ?><?php _e('250.000 km', 'cars_attributes');?></option>
<option value="300000"><?php $min_mileage = 300000; ?><?php _e('300.000 km', 'cars_attributes');?></option>
<option value="350000"><?php $min_mileage = 350000; ?><?php _e('350.000 km', 'cars_attributes');?></option>
<option value="400000"><?php $min_mileage = 400000; ?><?php _e('400.000 km', 'cars_attributes');?></option>
<option value="450000"><?php $min_mileage = 450000; ?><?php _e('450.000 km', 'cars_attributes');?></option>
<option value="500000"><?php $min_mileage = 500000; ?><?php _e('500.000 km', 'cars_attributes');?></option>
<option value="550000"><?php $min_mileage = 550000; ?><?php _e('550.000 km', 'cars_attributes');?></option>
<option value="600000"><?php $min_mileage = 600000; ?><?php _e('600.000 km', 'cars_attributes');?></option>
<option value="650000"><?php $min_mileage = 650000; ?><?php _e('650.000 km', 'cars_attributes');?></option>
<option value="700000"><?php $min_mileage = 700000; ?><?php _e('700.000 km', 'cars_attributes');?></option>
<option value="750000"><?php $min_mileage = 750000; ?><?php _e('750.000 km', 'cars_attributes');?></option>
<option value="800000"><?php $min_mileage = 800000; ?><?php _e('800.000 km', 'cars_attributes');?></option>
<option value="850000"><?php $min_mileage = 850000; ?><?php _e('850.000 km', 'cars_attributes');?></option>
<option value="900000"><?php $min_mileage = 900000; ?><?php _e('900.000 km', 'cars_attributes');?></option>
<option value="950000"><?php $min_mileage = 950000; ?><?php _e('950.000 km', 'cars_attributes');?></option>
<option value="1000000"><?php $min_mileage = 1000000; ?><?php _e('1.000.000 km', 'cars_attributes');?></option>
</select>
<select name="max_mileage" id="max_mileage">
<?php $max_mileage = Params::getParam('max_mileage') ; ?>
<option value=""><?php _e('max', 'cars_attributes');?></option>
<option value="0"><?php $max_mileage = 0; ?><?php _e('0 km', 'cars_attributes');?></option>
<option value="50000"><?php $max_mileage = 50000; ?><?php _e('50.000 km', 'cars_attributes');?></option>
<option value="100000"><?php $max_mileage = 100000; ?><?php _e('100.000 km', 'cars_attributes');?></option>
<option value="150000"><?php $max_mileage = 150000; ?><?php _e('150.000 km', 'cars_attributes');?></option>
<option value="200000"><?php $max_mileage = 200000; ?><?php _e('200.000 km', 'cars_attributes');?></option>
<option value="250000"><?php $max_mileage = 250000; ?><?php _e('250.000 km', 'cars_attributes');?></option>
<option value="300000"><?php $max_mileage = 300000; ?><?php _e('300.000 km', 'cars_attributes');?></option>
<option value="350000"><?php $max_mileage = 350000; ?><?php _e('350.000 km', 'cars_attributes');?></option>
<option value="400000"><?php $max_mileage = 400000; ?><?php _e('400.000 km', 'cars_attributes');?></option>
<option value="450000"><?php $max_mileage = 450000; ?><?php _e('450.000 km', 'cars_attributes');?></option>
<option value="500000"><?php $max_mileage = 500000; ?><?php _e('500.000 km', 'cars_attributes');?></option>
<option value="550000"><?php $max_mileage = 550000; ?><?php _e('550.000 km', 'cars_attributes');?></option>
<option value="600000"><?php $max_mileage = 600000; ?><?php _e('600.000 km', 'cars_attributes');?></option>
<option value="650000"><?php $max_mileage = 650000; ?><?php _e('650.000 km', 'cars_attributes');?></option>
<option value="700000"><?php $max_mileage = 700000; ?><?php _e('700.000 km', 'cars_attributes');?></option>
<option value="750000"><?php $max_mileage = 750000; ?><?php _e('750.000 km', 'cars_attributes');?></option>
<option value="800000"><?php $max_mileage = 800000; ?><?php _e('800.000 km', 'cars_attributes');?></option>
<option value="850000"><?php $max_mileage = 850000; ?><?php _e('850.000 km', 'cars_attributes');?></option>
<option value="900000"><?php $max_mileage = 900000; ?><?php _e('900.000 km', 'cars_attributes');?></option>
<option value="950000"><?php $max_mileage = 950000; ?><?php _e('950.000 km', 'cars_attributes');?></option>
<option value="1000000"><?php $max_mileage = 1000000; ?><?php _e('1.000.000 km', 'cars_attributes');?></option>
</select>
</div>
And as conditions in the index.php
Quote
case 'min_mileage':
if ((int)$value >= 0 && (int)$value < 1000000) {
Search::newInstance()->addConditions(sprintf("%st_item_car_attr.i_mileage >= '%s'", DB_TABLE_PREFIX, (int)$value));
$has_conditions = true;
}
break;
case 'max_mileage':
if ( (int)$value > 0 && (int)$value < 1000000 ) {
Search::newInstance()->addConditions(sprintf("%st_item_car_attr.i_mileage <= '%s'", DB_TABLE_PREFIX, (int)$value));
$has_conditions = true;
}
break;
After I press Search button , during the process of searching i see being prepared for display for a very short time the item wich has the mileage in the interval submitted and and after page refresh instead of that filtered item the search parametres dissapear and all other ads in the same categoy are displayed. I think i missed something
Modify message