This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Replacing Storefront Primary nav search

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Replacing Storefront Primary nav search

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #22280
    outofhouseoutofhouse
    Participant

    Hi – just trying to set up the plugin so I can replace the search in the Storefront primary nav menu. I have set the plugin to replace both the default theme and the WooCommerce search but this isn’t working. I’d really like to be able to show the Ajax search box in the same way as the current search box works (flips down and replaces the navigation when search icon in nav bar is clicked) is this possible?

    Thanks for your help…

    Rob

    #22292
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Rob,

    Thank you very much for the details, it helped a lot. Looks like that theme uses a different method to display the search bar. I have downloaded and looked up the source and managed to come up with a custom code that replaces the default search bar with ajax search pro.
    I placed the following custom code to the child theme directory into the functions.php file:

    add_filter('sfp_search_form_html', 'asp_override_sfp_search_form_html', 10);
    function asp_override_sfp_search_form_html() {
    	echo '<div>' . do_shortcode('[wpdreams_ajaxsearchpro id=1]') . '</div>';
    }

    You should see the new search bar there now.

    #22294
    outofhouseoutofhouse
    Participant

    That’s great – thanks! One minor thing… My header is sticky and scrolling through the results ends up with the Ajax Search results div moving with the page instead of remaining static – do you know what css I could use to stop the main container scrolling with the main page?
    Thanks again!

    #22295
    outofhouseoutofhouse
    Participant

    Actually – I think I managed it with:
    #ajaxsearchprores1_1, #ajaxsearchprores1_2, div.asp_r.asp_r_1{position:fixed;}

    #22296
    Ernest MarcinkoErnest Marcinko
    Keymaster

    That is a perfect solution, it should do the trick 🙂

    #22298
    outofhouseoutofhouse
    Participant

    Ok – well I think this ticket can be closed – thanks for your help!

    #22299
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Replacing Storefront Primary nav search’ is closed to new replies.