zul
Forum Replies Created
-
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Search Only From Custom “Keyword” FieldThank you.
I have also tried to delete the line of code but, the output still same. By the way, modifying multiple select into single select location solve this problem.
Thanks for the help.
Here is the screenshot image https://postimg.org/image/ewge7ramt/
I’m using code combined from your documentation and support.
add_filter( 'adverts_form_load', 'location_to_dropdown' ); function location_to_dropdown( $form ) { if( $form['name'] != 'search' ) { return $form; } foreach( $form["field"] as $key => $field ) { if( $field["name"] == "location" ) { $field["type"] = "adverts_field_select"; $field["empty_option"] = 1; $field["empty_option_text"] = "Seluruh Pahang"; $field["options"] = array( array("value" => "Bentong", "text" => "Bentong"), array("value" => "Bera", "text" => "Bera"), array("value" => "Cameron Highlands", "text" => "Cameron Highlands"), array("value" => "Chenor", "text" => "Chenor"), array("value" => "Jengka", "text" => "Jengka"), array("value" => "Jerantut", "text" => "Jerantut"), array("value" => "Kuantan", "text" => "Kuantan"), array("value" => "Kuala Lipis", "text" => "Lipis"), array("value" => "Maran", "text" => "Maran"), array("value" => "Muadzam Shah", "text" => "Muadzam Shah"), array("value" => "Pekan", "text" => "Pekan"), array("value" => "Raub", "text" => "Raub"), array("value" => "Rompin", "text" => "Rompin"), array("value" => "Temerloh", "text" => "Temerloh"), // more options here ); $form["field"][$key] = $field; } } return $form; }
I have do some try and error. Changing Location Field search in WPAdverts setting, using search location other than Use Default will cause an error.
Dropdown, autocomplete and Google autocomplete option will produce the error.
I have tried to disable all plugins except Wp Adverts and Wp Adverts – Maps and Locations, also changing search param to advert_category. Still got no solution.
I also execute MySQL query using suggested plugins, and it show no result either from debug bar nor phpmyadmin.
Try run link here
This link suppose to show 6 results. But, it show all results from location id 76 (Pekan) and not only by category id 35 (Peralatan). AURA TIMUR is not from category id 35.Search result shows all categories in selected location. It suppose only show results on selected category from selected location.
For example, I select location id 71 and category id 35. But, result shows all categories from location id 71.