Support

Home Forums Event Espresso Premium Displaying Surcharge in Checkout & Payment Option Page

Displaying Surcharge in Checkout & Payment Option Page

Posted: July 22, 2019 at 10:21 am


Ken Toh

July 22, 2019 at 10:21 am

Hello,

I would like to ask how do I modify the displayed price of the tickets at checkout and payment option pages?

For Checkout Page: I need the base price to be displayed as the price and the line stating that there is additional surcharge (something like payment option page)

For Payment Option Page: I just need the base price to be displayed as the price instead of the modified price.

Checkout Page

Payment Option Page


Ken Toh

July 28, 2019 at 11:12 am

any updates?


Josh

  • Support Staff

August 1, 2019 at 1:53 pm

Hi Ken,

As it stands now there isn’t a way to change the way those prices are displayed there. We can (and have started to) add some new filter hooks into Event Espresso core that expose the ticket/price data so you’ll be able to write a small function to change the way the price is displayed, put the function into a little plugin and activate it.

I’ll update this topic when said hooks are included in a new version of Event Espresso 4.


Josh

  • Support Staff

November 5, 2019 at 7:31 am

Update:

The hooks are provided in the latest version of EE4.

To change the way the price is displayed on the attendee information step, you can add the following to a site specific plugin:

add_filter(
    'FHEE__EE_Default_Line_Item_Display_Strategy___item_row__unit_price',
    'my_change_ticket_row_price',
    10,
    3
);
function my_change_ticket_row_price(
    $unit_price,
    $line_item,
    $tax_rate
) {
    $unit_price = EEH_Template::format_currency(
        $line_item->ticket()->base_price()->amount(),
        false,
        false
    );
    return $unit_price . ' + tax';
}

Then, to change the way the price is displayed on the payment options step:

add_filter(
    'FHEE__EE_SPCO_Line_Item_Display_Strategy___ticket_row__price',
    'ee_change_spco_ticket_row_price',
    10,
    2
);
function ee_change_spco_ticket_row_price($price, $line_item) {
    $price = EEH_Template::format_currency(
        $line_item->ticket()->base_price()->amount(),
        false,
        false
    );
    return $price;
}

add_filter(
    'FHEE__EE_SPCO_Line_Item_Display_Strategy___ticket_row__total',
    'ee_change_spco_total_tablecell',
    10,
    2
);
function ee_change_spco_total_tablecell($total, $line_item) {
    $total = $line_item->ticket()->base_price()->amount() * $line_item->quantity();
    return $total;
}


Josh

  • Support Staff

November 5, 2019 at 7:31 am

You can add the above to a functions plugin or, if available, into your WordPress child theme’s functions.php file.

The support post ‘Displaying Surcharge in Checkout & Payment Option Page’ 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