FacetWP – do something on geolocation error

mgibbs189

{{gist file=”test.js” lang=”javascript”}}
<script>
(function($) {
FWP.hooks.addAction(‘facetwp/geolocation/error’, function(params) {
// “params.facet” contains the current facet container node
// “params.error” contains the error message
// in the example below, we’re changing the sort key and trigging an ajax reload
FWP.extras.sort = ‘price_desc’;
FWP.refresh();
});
})(jQuery);
</script>
{{/gist}}