facetwp redirect on change

djrmom

{{gist file=”facet.js” lang=”javascript”}}
(function($) {
$(document).on(‘change’, ‘.facetwp-facet-product_tags’, function() { // change product_tags to name of dropdown facet
FWP.parse_facets();
FWP.set_hash();
var query = FWP.build_query_string();
window.location.href = ‘/search-results/?’ + query; // search-results to correct page
});
})(jQuery);
{{/gist}}