Conditional facet

mgibbs189

{{gist file=”test.js” lang=”javascript”}}
<script>
(function($) {
$(document).on(‘facetwp-loaded’, function() {
if (0 < FWP.facets[‘product_cat’].length) {
$(‘.facetwp-facet-product_sub_cat select’).removeAttr(‘disabled’);
}
else {
$(‘.facetwp-facet-product_sub_cat select’).attr(‘disabled’, ‘disabled’);
}
});
})(jQuery);
</script>
{{/gist}}