Last active
October 17, 2017 15:35
-
-
Save djrmom/26e5cb6d92edb380347a303d9bf7ca78 to your computer and use it in GitHub Desktop.
facetwp reset another facet on dropdown change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment