0

I have a search form with multiple fields on my front page. After clicking on submit button, user would be routed to search result page. The user fills out the form, clicks on a 'Search' button, and the browser replaces the front page with a results page. (Ideally, a Commerce search view). On search result page, all facets blocks are enabled.

I have created a page using Views exposed filter for front page and I am getting result as per filters. But I am not able to map that search filters with my facet search blocks on result page. Is there any way to do that ?

Another way I tried is created a custom form but not sure how to build URL so that user would be redirected to Search result page.

0

You should use the same faceted search block on front page too. You can invoke the faceted search block on front page.

  • But Format of my search blocks are different. Like on front page I want dropdown and in result page I want checkboxes for same facet. – Adoshi Jul 4 '14 at 13:06
  • Thanks Parvin for ur suggestion. It helped me to find out the way. – Adoshi Jul 7 '14 at 14:03
  • Adoshi, If solution works for you, please mark this as answer. It will be helpful for someone else. – Parvind Jul 8 '14 at 5:55
0

I resolved it by creating a custom form and in submit hook, I have redirected user to my search result page using below code.

if (isset($form_state['values']['brand']) &&  $form_state['values']['brand'] != '') {
      $element[0] = 'field_product%3Afield_brand:'. $form_state['values']['brand'];
      $cnt++;
    }

    $elements = serialize(array('f' => $element));

    $form_state['redirect'] = array('search/parts/results', array('query' => unserialize($elements)));

I didn't find any better solution as my display widget types are different for both the pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.