FacetWP – index WooCommerce taxonomy attributes (negative numbers)

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

// Re-index afterwards
function fwp_index_woocommerce_negatives( $params, $class ) {
$facet_names = array( ‘temperature_min’, ‘temperature_max’ );
if ( in_array( $params[‘facet_name’], $facet_names ) ) {
$actual_value = $params[‘facet_display_value’];
$params[‘facet_value’] = $actual_value; // override the facet_value column
}
return $params;
}
add_filter( ‘facetwp_index_row’, ‘fwp_index_woocommerce_negatives’, 10, 2 );
{{/gist}}