Support

Home Forums Event Espresso Premium How to format price in ticketselector shortcode?

How to format price in ticketselector shortcode?

Posted: December 1, 2019 at 3:27 pm


liatoss

December 1, 2019 at 3:27 pm

Hello Guys,

I have a new page, so far it is on Russian, but you can see the problem even in Russian: https://www.russiannights.ch/ru/meropriyatiya/bal-sokrovischa-rossii-2020/bal-sokrovischa-rossii-2020-p-2/?preview=true
Ideally, the price needs to be formatted in better way as it has now several evident problems :

  • Now it has currency symbol just after the number, without any space, which make it hard to read
  • The price has doubled currency, just after the number and currency symbol one can see the currency like this (CHF) – I can hide it with css styles!

So, my question is as follows:
How can I add a space between the price number and the currency? Ideally, for the first row the price looks like as follows: 190.00 CHF

I tried to analyze different hooks (https://gist.github.com/lorenzocaum/4b64e88ab1536c46c22c) and found that i can add into my functions.php of the theme the following code:

function runights_ticket_price($ticket_price) {
  return $ticket_price . " ***"; //str_replace('CHF', 'CHF ', $new_row_cells_content);
}
add_filter(
            'FHEE__ticket_selector_chart_template__ticket_price',
			'runights_ticket_price'
);

but it doesn’t work. Can you give me any idea how to write a correct filter function and what parameters it can get in it?

My second question is as follows: where can I found a list of possible filter functions with enetered parameters?

Thank you in advance, Vlad.


Tony

  • Support Staff

December 2, 2019 at 5:07 am

Hi there,

So, my question is as follows:
How can I add a space between the price number and the currency? Ideally, for the first row the price looks like as follows: 190.00 CHF

I replied to almost exactly the same question here:

https://eventespresso.com/topic/space-between-currency-and-number/#post-301978

I recommend following those same steps.

My second question is as follows: where can I found a list of possible filter functions with enetered parameters?

Currently, we don’ have a full breakdown of all hooks within EE4.

One way to find a hook you are looking for is to use Debug bar with the Actions and Filters Addon


liatoss

December 2, 2019 at 1:35 pm

Ok, Tony. It helps, thank you!


Tony

  • Support Staff

December 3, 2019 at 2:17 am

You’re most welcome.

Any further questions just let us know.

The support post ‘How to format price in ticketselector shortcode?’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: closed

Updated by  Tony 7 months, 2 weeks ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!