Searchanise Search & Filter

Snippet

Add the following snippet inside the body element in the theme.liquid.

<script>
    document.addEventListener('Searchanise.AutocompleteUpdated', function() {
        document.dispatchEvent(new CustomEvent('la:dn:collection:updated'));
    });
    
    document.addEventListener('Searchanise.ResultsUpdated', function() {
        document.dispatchEvent(new CustomEvent('la:dn:collection:updated'));
    });
</script>

Alternative, using Loaded event

If the above does not work for you, uou may need to wrap this into the Searchanise.Loaded event. To do this use the following snippet:

<script>
  document.addEventListener('Searchanise.Loaded', function() {
    (function($) {
      $(document).on('Searchanise.AutocompleteUpdated', function(event, input, container) {
        document.dispatchEvent(new CustomEvent('la:dn:collection:updated'));
      });
       $(document).on('Searchanise.ResultsUpdated', function(event, input, container) {
        document.dispatchEvent(new CustomEvent('la:dn:collection:updated'));
      });
    })(window.Searchanise.$);
  });
</script>

Last updated