• Resolved vandanga

    (@vandanga)


    All was working fine and very fast.
    Now it is not working. Not sure when it stopped working exactly but have upgraded wordpress to
    5.0.1 running GeneratePress theme.
    Our dev. site is running 4.9.8 and has the same problems.
    Search displays a list but not selectable and on click just closes. Pressing return does display search results on an archive page. Pre Loader not working.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Damian Góra

    (@damian-gora)

    Hi,
    You have to multiple instances of the ajax search form on one page. I have not finished yet this feature. In some cases it works, but sometimes not.

    You have to wait for the official release of this feature (not earlier than in a few months.) At this moment I recommend to use only one instance.

    Best
    Damian Góra

    Thread Starter vandanga

    (@vandanga)

    I’ve taken out one of the instances on our test site and it still does not work.
    From testing it appears that using a shortcode in the menu bar (Mega Menu plugin), the ajax search now produces a java script error. It did work mid December.
    See link below as to error.
    https://content.screencast.com/users/cotswoldphoto/folders/Jing/media/749b8364-66e7-40d2-8d8e-f697879a8740/2019-01-07_1706.png

    Plugin Author Damian Góra

    (@damian-gora)

    Here is the temporary solution:

    
    (function ($) {
    
            $(document).ready(function () {
    
                var uniqueContext = [];
                $('.dgwt-wcas-search-wrapp[data-wcas-context]').each(function () {
                    var context = $(this).attr('data-wcas-context');
                    if ($.inArray(context, uniqueContext)) {
                        var newContext = Math.random().toString(36).substring(2, 6);
                        var suggestionsContainer = $('.dgwt-wcas-suggestions-wrapp');
                        var detailsContainer = $('.dgwt-wcas-details-wrapp');
    
                        $(this).attr('data-wcas-context', newContext);
    
                        if (suggestionsContainer && typeof suggestionsContainer[1] != 'undefined') {
                            $(suggestionsContainer[1]).attr('data-wcas-context', newContext);
                        }
    
                        if (detailsContainer && typeof detailsContainer[1] != 'undefined') {
                            $(detailsContainer[1]).attr('data-wcas-context', newContext);
                        }
    
                    } else {
                        formContext.push(context);
                    }
    
                });
    
            });
    
        })(jQuery);
    

    I will include this fix to the next plugin release.

    Best
    Damian Góra

    Where does this code go ?
    What file.
    Kind Regards

    Plugin Author Damian Góra

    (@damian-gora)

    I recommend installing Code Snippets.

    Create a snippet and paste this code.

    Best
    Damian Góra

    Thanks a lot ^^

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Live search not working’ is closed to new replies.