Index the related product price for Tribe events

mgibbs189

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

function index_event_cost( $params, $class ) {
if ( ‘evenementen_prijs’ == $params[‘facet_name’] ) {
if ( function_exists( ‘tribe_get_cost’ ) ) {
$cost = tribe_get_cost( $params[‘post_id’], false );
$params[‘facet_value’] = $cost;
$params[‘facet_display_value’] = $cost;
}
}
return $params;
}
add_filter( ‘facetwp_index_row’, ‘index_event_cost’, 10, 2 );
{{/gist}}