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
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
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
I recommend installing Code Snippets.
Create a snippet and paste this code.
Best
Damian Góra