Support

Home Forums Event Espresso Premium Alternative currency display on ticket selector

Alternative currency display on ticket selector

Posted: March 3, 2017 at 9:08 am

Viewing 3 reply threads


Greenstones

March 3, 2017 at 9:08 am

I’d like to display an additional currency on the ticket price table using a shortcode from a currency plugin: (€[convert number=6825 from=”sek” to=”eur”])

What template do I need to duplicate, where do I need to put it (uploads/espresso/ template maybe) and what code line do I need to modify?


Josh

  • Support Staff

March 3, 2017 at 2:21 pm

Hi there,

You actually don’t duplicate a template, or modify a template to make this change.

Instead, you can use the FHEE__ticket_selector_chart_template__do_ticket_inside_row
filter hook to filter the output of the ticket selector html.

https://github.com/eventespresso/event-espresso-core/blob/master/modules/ticket_selector/TicketSelectorRowStandard.php#L178

You’ll add your custom code to a custom functions plugin.


Greenstones

March 4, 2017 at 6:24 am

Thanks. I’ve setup the custom plugin fine – but it would be helpful if you could post an example that demonstrates how to modify the filter hook.


Josh

  • Support Staff

March 6, 2017 at 12:40 pm

You don’t actually modify the filter hook. You modify what’s returned by default. So you can copy the default html from the core plugin into your custom function. Your custom function will look like this:

add_filter( 
  'FHEE__ticket_selector_chart_template__do_ticket_inside_row', 
  'my_custom_ticket_selector_row_html', 
  10, 
  9 
);
function my_custom_ticket_selector_row_html(
  $new_row_cells_content,
  $ticket,
  $max,
  $min,
  $required_ticket_sold_out,
  $ticket_price,
  $ticket_bundle,
  $ticket_status,
  $status_class
) {
  // $new_row_cells_content = // custom code goes here;
  return $new_row_cells_content;
}
Viewing 3 reply threads

The support post ‘Alternative currency display on ticket selector’ 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