<?php
/** resets a facet changing another facet
** change 'facet_name_1' and 'facet_name_2' to the names of your facets
**/
add_action( 'wp_head', function() { ?>
<script>
document.addEventListener('facetwp-refresh', function() {
if ( null !== FWP.active_facet && 'facet_name_1' == fUtil(FWP.active_facet.nodes[0]).attr('data-name' ) ) {
FWP.facets['facet_name_2'] = [];
}
});
</script>
<?php }, 100 );