JoeHana
9/3/2013 - 1:35 PM

Display price (min/max) select dropdowns instead of text fields

Display price (min/max) select dropdowns instead of text fields

<?php

/**
 * Display price (min/max) select
 * dropdowns instead of text fields
 */
 
add_filter( 'wpsight_search_form_details', 'custom_search_form_details', 50 );

function custom_search_form_details( $fields ) {

    // Set price (min) to select

	$fields['min']['type'] = 'select';
	
	// Set price (min) select options
	
	$fields['min']['data'] = array(
		'100000' => '100.000',
		'200000' => '200.000',
		'300000' => '300.000',
		'400000' => '400.000'
	);
	
	// Set price (max) to select
	
	$fields['max']['type'] = 'select';
	
	// Set price (max) select options
	
	$fields['max']['data'] = array(
		'500000' => '500.000',
		'600000' => '600.000',
		'700000' => '700.000',
		'800000' => '800.000'
	);
	
	return $fields;

}