I do apologize if this is somewhere else and I missed it. Here is what I am trying to accomplish (and I am up for hearing simpler or more logical methods of getting there):
I have a content type (called 'discount') that I created with a module by the same name. It is basically a discount that people who work at our university can get at various businesses around town by showing their university id. What I want to have in the end is a page that has a search text box along with two optional filters (managed with taxonomy) that will use AJAX to retrieve the results and load them into a div under the search box.
I have the form made up, and I have the AJAX part sending the message and getting a test response. My next goal was to use a view to get the results I wanted. Using the views and views_fastsearch modules to create my view that exposed the word and the other two optional filters. It worked but what I want to do now is call the results of the view in my AJAX call. So here is what I did:
function _discount_ajax_query() {
$search_key = strtolower(check_plain($_POST['message']));
$view = views_get_view('discounts_fastsearch');
$view->is_cacheable = FALSE;
$view->filter[1]['value'] = $search_key;
$view->execute();
print drupal_to_js($view->result);
exit();
}
I am not getting anything back in my result. Thanks for any help.