Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created April 18, 2016 16:37
Show Gist options
  • Save Pebblo/2b5c0eedf2d4c6ad97910edf560cd706 to your computer and use it in GitHub Desktop.
Save Pebblo/2b5c0eedf2d4c6ad97910edf560cd706 to your computer and use it in GitHub Desktop.
Force the EE4 User Integration add-on to include the price even when a user does not have the capability to purchase the ticket and the ticket is free. So it changes the ticket selector from this: http://take.ms/ngTeu To this: http://take.ms/FaApG
<?php
//Do not include the opening PHP tag if you already have one open
function tw_ee_display_free_price_on_member_ticket( $original_string, $tkt, $ticket_price, $tkt_status ) {
$ticket_price = empty( $ticket_price ) ? ' (' . EEH_Template::format_currency( 0.00 ) . ')' : $ticket_price;
$new_string = sprintf( __( 'The %1$s%2$s%3$s%4$s is available to members only. %5$s', 'event_espresso' ), '<strong>', $tkt->name(), $ticket_price, '</strong>', $tkt_status );
return $new_string;
}
add_filter( 'FHEE__EED_WP_Users_Ticket_Selector__maybe_restrict_ticket_option_by_cap__no_access_msg', 'tw_ee_display_free_price_on_member_ticket', 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment