Hi Guys
I had a plug in created so that visitors could advertise rooms for rent on a website.
www.christianrooms.com/wordpress
I am trying to get a search function/plug in written where the visitor can search for rooms by certain criteria.
The visitors need to be able to search by:
Location (where they fill in their own text, and the info is pulled from the “local area” data)
Rental Type – (a drop down box with the following options: nightly, weekly or monthly taken from the rental type data)
Then they click a button with “Search Rooms” and are presented with a list of available accommodation which I’m assuming could be taken from the “Rooms Available” page maybe.
Does anyone know of a ready made solution that would do this OR anyone up for creating it for me.
Any advice or help would be much appreciated
Many thanks
Steve
Milan Petrovic answers:
I am in the process of developing plugin GD Products Center that will be used to add products by type (this can be rooms), and set up categorization/properties/specification/images/videos for each product, different product pages, search/filter capabilities and more. Currently is in Beta, with about month of development left. You can check out news about plugin and development, and request demo to test it:
http://www.dev4press.com/archive/plg-gd-products-center/blog/
http://www.dev4press.com/request-demo/
Sébastien | French WordpressDesigner answers:
This plugin could search several data (each data is in a custom field)
[[LINK href="http://wordpress.org/extend/plugins/wp-custom-fields-search/"]]http://wordpress.org/extend/plugins/wp-custom-fields-search/[[/LINK]]
I have made an advanced search for loft (not room) here : [[LINK href="http://www.lestetesdepub.com/location-lofts"]]http://www.lestetesdepub.com/location-lofts[[/LINK]] but it is a long work
Luis Abarca answers:
I made this sites with a similar funcionality
[[LINK href="http://mchome.com.mx/propiedades/"]]http://mchome.com.mx/propiedades/[[/LINK]]
[[LINK href="http://ihata.com.mx/"]]http://ihata.com.mx/[[/LINK]]
I'm using custom taxonomies for filter the search in both sites, and a custom table for room availability in the second one.
John Cotton answers:
<blockquote>Does anyone know of a ready made solution</blockquote>
You're almost there as it is....
You need a form in your search area (I'm guessing that's a widget?) with this kind of code in:
<form method="post" action="http://www.christianrooms.com/wordpress/my-ads/">
<select name="location"><!-- pull the values from your local area - don't get them typing in or else potentially you'll have missed matches for typos</select>
<select name="type"><!-- pull from your rental types (get_terms) --></select>
<input type="submit" value="Search" />
Then, on the my-ads page (template or archive.php?) you get check for $_POST value and adjust the query...
<?php
if( isset($POST(['location']) ) {
$filter = array(
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'location',
'field' => 'slug',
'terms' => array( $_POST['location'] )
),
array(
'taxonomy' => 'rental_type',
'field' => 'slug',
'terms' => array( $_POST['type'] )
)
)
);
// merge your new query with the existing one for this page
query_posts( array_merge( $wp_query->query, $filter ) );
}
?>
And that should do it!
This, of course, assumes location and rental are taxonomies. If they are not (eg they are custom fields) just adjust the query above.
JC