facetwp reset another facet on dropdown change

djrmom

{{gist file=”facet.js” lang=”javascript”}}
(function($) {
$(document).on(‘change’, ‘.facetwp-facet-product_categories’, function() { // change product_categories to name of dropdown facet
FWP.is_reset = true;
FWP.facets[‘product_tags’] = []; // set other facet to no selections
delete FWP.facets[‘paged’]; // remove “paged” from URL
FWP.refresh();
});
$(document).on(‘change’, ‘.facetwp-facet-product_tags’, function() { // change product_tags to name of dropdown facet
FWP.is_reset = true;
FWP.facets[‘product_categories’] = []; // set other facet to no selections
delete FWP.facets[‘paged’]; // remove “paged” from URL
FWP.refresh();
});
})(jQuery);
{{/gist}}