Support » Plugin: Ajax Search for WooCommerce » Search result links don’t work anymore

  • Resolved doulou

    (@doulou)


    I have your search in the header of all pages on this site. When I finished building the site and testing it about 6 months ago it worked perfectly. Now, the search results show, but if you try and click on any nothing happens. I’ve just advertised the site for the client and realised this isn’t working anymore! Is there anything I need to do? Many thanks in advance – I was really happy with the plugin when it worked…

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Damian Gora

    (@damian-gora)

    Hi,
    Sometimes some themes or plugins duplicate the search form. This is the cause of the issue. Do not worry, it will be fixed in the next plugin release. Can you wait about 3 days or you need the solution now?

    Best
    Damian Góra

    I’d rather not but maybe don’t have a choice. In the release, will the links to the product pages work then? I just plugged the site on my facebook page to boost business myself. If you are able to post a work around, please do – the client hasn’t flagged it up yet, but he’s very fussy and I’m just waiting for the email!

    On another note – thanks for getting back so speedily…

    Plugin Author Damian Gora

    (@damian-gora)

    No problem,

    Paste following JS into your code:

    
            /*-----------------------------------------------------------------
            /* Fix duplicate instances
            /*------------ -----------------------------------------------------*/
            $(window).on('load', function () {
    
                var $searchWrapps = $('.dgwt-wcas-search-wrapp[data-wcas-context]');
    
                var uniqueContext = [];
    
                if ($searchWrapps.length > 0) {
                    $searchWrapps.each(function () {
                        var context = $(this).attr('data-wcas-context');
    
                        if ($.inArray(context, uniqueContext) == -1) {
                            uniqueContext.push(context);
                        } else {
                            var newContext = Math.random().toString(36).substring(2, 6);
    
                            var suggestionsContainer = $('.dgwt-wcas-suggestions-wrapp[data-wcas-context="' + context + '"]');
                            var detailsContainer = $('.dgwt-wcas-details-wrapp[data-wcas-context="' + context + '"]');
    
                            $(this).attr('data-wcas-context', newContext);
    
                            if (suggestionsContainer.length > 0) {
                                $(suggestionsContainer[suggestionsContainer.length - 1]).attr('data-wcas-context', newContext);
                            }
    
                            if (detailsContainer.length > 0) {
                                $(detailsContainer[detailsContainer.length - 1]).attr('data-wcas-context', newContext);
                            }
                        }
                    });
                }
    
            });
    
    

    Remove this code after next update.

    Hi sorry for the delay (was night time), working fine now thanks.

    Plugin Author Damian Gora

    (@damian-gora)

    You can remove the temporary JavaScript code and update the plugin to the latest version (v1.3.2). This bug is officially fixed.

    Best
    Damian Góra

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Search result links don’t work anymore’ is closed to new replies.