Support

Home Forums Event Espresso Premium Bundle Price Display is incorrect ee5

Bundle Price Display is incorrect ee5

Posted: May 14, 2023 at 2:15 pm


Omar Paloma

May 14, 2023 at 2:15 pm

When I create a bundle the price displaying is the price per ticket vs the price for the entire bundle, as in the documentation.

How can I fix this?


Tony

  • Support Staff

May 15, 2023 at 6:31 am

Hi there,

Which specific version number of EE are you using, please?

In your other thread you mentioned the EE5 Beta, are you still using beta or the latest version?

I tested this using 5.0.3 and can’t reproduce, can you link me to the event so I can take a look?


Omar Paloma

May 15, 2023 at 12:11 pm

My mistake. It is 5.0.3

I found the problem. It’s in this snippet which is designed to show the base ticket price before add-ons.

/* display the base price of the ticket in the ticket selector instead of the price with price modifiers */

add_filter( 'FHEE__ticket_selector_chart_template__ticket_price', 'change_ee_ticket_selector_base_price_display', 10, 2 );

function change_ee_ticket_selector_base_price_display( $ticket_price, $ticket ) {
    
    $base_price = $ticket->base_price();
    
    return $base_price->amount();
}

function espresso_vip_tickets_displayed( $ticket_row_html, EE_Ticket $ticket ) {
    $cap_required = $ticket->get_extra_meta( 'ee_ticket_cap_required', true );
    if ( empty( $cap_required ) ) {
        return false;
    }
    if ( ( is_admin() && ! EE_FRONT_AJAX ) || ! empty( $cap_required ) && is_user_logged_in() &&  EE_Registry::instance()->CAP->current_user_can( $cap_required, 'wp_user_ticket_selector_check' ) ) {
        return false; //cap required but user has access so continue on please.
    } 
    $ticket_row_html = '';
    return $ticket_row_html;
}
add_filter( 'FHEE__ticket_selector_chart_template__do_ticket_entire_row', 'espresso_vip_tickets_displayed', 10, 2 );

//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
//* Disable email match check for logged out users

add_filter( 'EED_WP_Users_SPCO__verify_user_access__perform_email_user_match_check', 'ee_wp_users_remove_email_user_match_check_logged_out' );

function ee_wp_users_remove_email_user_match_check_logged_out() {
    if ( ! is_user_logged_in() ) {
        return false;        
    } else {
        return true;
    }
}

I implemented it to show the price before fees, But it seems that it also affects the display of bundle pricing. Is there a way to tweek the snippet so that bundle prices display as in the documentation?


Tony

  • Support Staff

May 16, 2023 at 5:04 am

I’d use the same method the ticket selector uses to determine if the ticket is a bundle and just return the default price, otherwise use the base price, like so:


$ticket_min = $ticket->min();
// for ticket bundles, set min and max qty the same
if ($ticket_min !== 0 && $ticket_min === $ticket->max()) {
    //Bundle ticket, return the default price
    return $ticket_price;
}
return $ticket->base_price()->amount();

The support post ‘Bundle Price Display is incorrect ee5’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso