Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Last active October 11, 2018 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/6c53e5ee5b4d00839877 to your computer and use it in GitHub Desktop.
Save mgibbs189/6c53e5ee5b4d00839877 to your computer and use it in GitHub Desktop.
Index the related product price for Tribe events
<?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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment