Tag Archives: ordering

Add additional sort / order on homepage

Some PHP + HTML knowledge is required for this.

For version >= 1.5.5.:

This feature is only available for this type of fields: ‘INPUTBOX’, ‘DECIMAL’, ‘INTEGER’

For example that you want to enable filtering by: “Energy efficient”

Go to Admin->Real estates->Fields->Edit “Energy efficient” and click on “Enable numerical filtering”:

numeric_filtering

Now you need to add additional field in dropdown on homepage.

For realocation template for example open templates\{your-template}\widgets\center_recentproperties.php (or another if you using) add additional option in:

<select class="form-control pull-right selectpicker-small" placeholder="<?php _l('Sort'); ?>">
    <option value="id ASC" <?php _che($order_dateASC_selected); ?>><?php _l('DateASC'); ?></option>
    <option value="id DESC" <?php _che($order_dateDESC_selected); ?>><?php _l('DateDESC'); ?></option>
    <option value="price ASC" <?php _che($order_priceASC_selected); ?>><?php _l('PriceASC'); ?></option>
    <option value="price DESC" <?php _che($order_priceDESC_selected); ?>><?php _l('PriceDESC'); ?></option>
</select>

For example:

<option value="field_59_int ASC" <?php _che($order_field_59_int_ASC_selected); ?>><?php _l('Energy efficient'); ?></option>

Also you should add it in: templates\{your-template}\results.php

if value is not numeric then you should:

into property_lang database table add:

varchar(200)utf8_unicode_ci

Add this:

<option value=”field_7 ASC”>Your option name</option>

7 in that case represents field ID

One example:

ordering_default

ordering_example_selection