• Resolved soymariadcm

    (@soymariadcm)


    Hello!

    I have a question. Is it posible to remove the decimals from the selected price for the events? I mean, I would like to set up the price for an event in exactly 250€, so that I am not interested in showing the price like 250,00€. Is it any way to avoid showing those decimals along with the price?

    I just would like to show the prices on rounding numbers.

    Thank you! You guys are always helpful! ??

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    just to confirm, did you mean in the single events page ticket listing?

    Thread Starter soymariadcm

    (@soymariadcm)

    I mean everywhere. You can see an example on this link https://mariadcm.com/

    Plugin Support angelo_nwl

    (@angelo_nwl)

    you can try to modify template file at events-manager/templates/forms/bookingform/ticket-single.php

    eg. $EM_Ticket->get_price(false) instead of $EM_Ticket->get_price(true)

    to use templates: https://wp-events-plugin.com/documentation/using-template-files/

    eg. wp-content/themes/Your Theme/plugins/events-manager/forms/bookingform/ticket-single.php

    Thread Starter soymariadcm

    (@soymariadcm)

    I tried what you told me to do but it did not work.

    If you go to this link https://mariadcm.com/, you can see that the prices are showed with decimals.

    When I go to the source code it is this part what I would like to change.
    Now it is like that:
    <div class=”price”>
    <span class=”price-tag”>250,00€</span>
    </div>

    So…I want to change the configuration so that the class=”price tag” is showed like 250€, in other words, without the decimals. Just the rounding number.

    Could you please give me a hand with this?

    Thanks!

    • This reply was modified 7 years, 2 months ago by soymariadcm.
    • This reply was modified 7 years, 2 months ago by soymariadcm.

    I think adding the code below to the functions.php of your theme will be an easier, upgrade-proof way of doing this.

    https://pastebin.com/3NQ2xSTm

    You’d need to edit the number_format part. This should help:

    https://www.w3schools.com/php/func_string_number_format.asp

    Thread Starter soymariadcm

    (@soymariadcm)

    Hello! Thanks fot the reply caimin_nwl

    I tried to add the code you told to me funtions.php file of my theme but when I do this my website shows a 500 Error…
    Maybe you cannot give me more help here but…is there a simpler way to do what I want? Just adding some code somewhere especific? My knowledge in IT is not great…sorry about that.

    All I need is just to show the prices of the event tickets on rounding numbers ??

    Thread Starter soymariadcm

    (@soymariadcm)

    I finally got it! Thanks a lot! I got rid of the decimals hehe

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘I don’t want to show decimals on the event’s price’ is closed to new replies.