Problem with positioning search box

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Problem with positioning search box

This topic contains 13 replies, has 2 voices, and was last updated by Akis Apostoliadis Akis Apostoliadis 9 years, 1 month ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #4160
    Akis Apostoliadis
    Akis Apostoliadis
    Participant

    Hi,
    I’m trying to position the search box in my woocommerce e-shop but it’s not displaying.

    I want to position it between the nav menu and the shopping cart.

    I’ve followed your documentation but it seems that the search box has no height for some reason.

    Please send me an email so I can send you the user/pass in order to check out the site (it’s pass protected).

    Thank you in advance,
    A.

    #4161
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    You can safely upload private details in a .txt file to this thread, it’s not visible for public, or other users. (just me and you)

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4162
    Akis Apostoliadis
    Akis Apostoliadis
    Participant

    Here you are!

    Attachments:
    You must be logged in to view attached files.
    #4164
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thanks, it works.

    Currently however I see the search in the middle of the page, and it looks normal to me.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4165
    Akis Apostoliadis
    Akis Apostoliadis
    Participant

    Yes, I know.
    This is working.

    But I want to change the positioning and put it between the nav menu and the shopping cart.
    And it’s not displaying at this position.

    #4166
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You most likely will need to edit your theme files to do that and use the php shortcode to display the search.

    It’s usually the header.php file in the theme folder, but it varies from theme to theme. Before editing any of the theme files please make a backup in case anything goes wrong.

    Based on the html output I can see, the search bar should probably be placed between the navigation menu and the header links div inside the “header-menu” div into a new container displayed as a table cell, something like:

    
    <div style='display: table-cell; vertical-align: middle'>
       <?php echo do_shortcode('[wpdreams_ajaxsearchpro id=1]'); ?>
    </div>
    

    But this is just a guess based on a quick look at the theme. It might be much more complicated than this. If you want to be sure to have a correct implementation, you can always ask the theme developer if he has a better suggestion.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4167
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    One more thing. Adding a minimum width might be necessary, because I think that the table cell display will shrink everything as much as possible. So this might work better:

    
    <div style='display: table-cell; vertical-align: middle; min-width: 220px;'>
       <?php echo do_shortcode('[wpdreams_ajaxsearchpro id=1]'); ?>
    </div>
    
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4168
    Akis Apostoliadis
    Akis Apostoliadis
    Participant

    I managed to put it after the cart icon but now the results are displayed on the upper part of the header (to check out what I mean put “Life” search term in the search box).

    I would like the results to be displayed below the search box.

    Regards,
    A.

    #4169
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    It looks like the results shortcode is used in the header, so the search is displaying the results there naturally. If you remove the results shortcode from the header, the search results will appear below the search bar as default.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4171
    Akis Apostoliadis
    Akis Apostoliadis
    Participant

    I am not sure what you mean.

    You mean I must move “<?php echo do_shortcode(‘[wpdreams_ajaxsearchpro id=1]‘); ?>”
    below the header and before the photo slider?

    #4172
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Not that one. There must be another shortcode placed, the results shortcode, which is in this format:

    
    <?php echo do_shortcode('[wpdreams_ajaxsearchpro_results id=1 element="div"]'); ?>
    

    That’s a bit different shortcode, but it must be there, as I can see the output of it.

    You either remove that shortcode, or move it below the

    
    <div class='header-menu'>...</div>
    

    Currently, it should be above that line, based on the source code of the page.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4176
    Akis Apostoliadis
    Akis Apostoliadis
    Participant

    It’s ok now, thank you very much for your help.

    One more thing, there’s a big concern about the speed.

    It takes a full 3-4 sec to load the results (and I only have less than 10 titles in the DB right now).

    Compared to a competitor’s search functionality (www.book-it.gr) it takes more than 2x to lead the results (the competitor’s results show up after 1 1/2 sec most of the time).

    Why is that? Can I do something to make it speedier?

    #4178
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Yes actually.

    I’ve switched the ajax handler to a the custom ajax handler on the “Compatibility Options” submenu.

    WordPress is not famous for it’s speed in general, and unfortunately each ajax request has to wait till every plugin and core function is loaded which takes time, usually around 1 second. Only then it starts to actually work on the ajax request. By turning on the custom ajax handler, some of the loading time is decreased, so you should see faster results now. (1-2 second difference)

    Another thing that takes some time is the thumbnail generation. If the thumbnail is generated for the result for the first time, it take a bit more time. But the second time it’s cached, so no generation needed, thus the search is faster. If you try one search term two or more times, the second time it will be much faster – because the images are now generated.

    Also, if you want I can install the upcoming version for beta testing. (not completely finished, but working) It has some other improvements as well, which should affect the search speed greatly. I’m releasing it very soon, and some feedback would be nice. Let me know, and I will install it via the plugin manager.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #4182
    Akis Apostoliadis
    Akis Apostoliadis
    Participant

    Thank you very much for the detailed explanation (it’s 100% logical too).

    Results are around 2” faster now.

    If you want to send me the beta ver. (And it doesn’t make any changes to the settings I’ve input) I’d be glad to install it myself :).

    Kind Regards,
    A.

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.