wrong decimal seperator in ticketprice

Home Forums Calendar Products Events Calendar PRO wrong decimal seperator in ticketprice

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1332349
    Stephan
    Participant

    Hi!

    I have a problem with the dezimal seperator in prices in listview of events calender pro.

    I need the German spelling, eg 10,00 € but I always get 10.00 €. It is just a display problem – woocommerce takes the right formatting with kommar-seperator.

    In the detailed view, I am able to correct the price (via function.php -> … $ main = str_ireplace (‘. 00 €’, ‘, 00 €’, $ main);….) In the listview but still the Incorrect spelling. 🙁

    Any tips?
    Thanks
    S

    #1332799
    Victor
    Member

    Hi Stephan!

    Thanks for getting in touch with us!

    The event cost in the single event view is shown using the same tribe_get_cost() function as in the list view, so you should be able to customize the output in the same way.

    Could you please share with me the code you’re using to customize the price format in the single event view? This way I can take a look and see if it can also be used to modify the price in the list view.

    Thanks,
    Victor

    #1332811
    Stephan
    Participant

    Hi Victor,
    i add the following code to funktion.php

    _____

    add_filter(‘gettext’, ‘translate_text’);
    add_filter(‘ngettext’, ‘translate_text’);
    function translate_text($translated) {
    $translated = str_ireplace(‘.00 €’, ‘,00 €’, $translated);
    return $translated;}

    _____

    In the moment we only sell tickets with ,00 prices so i found another way – i changed the currency-symbol to ,00 €. It works but i thinks this is not the way it should word 😉

    Stephan

    #1333430
    Victor
    Member

    Hi Stephan!

    I suggest you try using the following code snippet instead of the one you are using:

    add_filter( 'tribe_get_cost', 'tribe_get_cost_decimal', 10, 1 );
    function tribe_get_cost_decimal( $cost ){
    $cost = str_replace( '.', ',', $cost );
    return $cost;
    }

    Let me know if it works for you.

    Best,
    Victor

    #1333463
    Stephan
    Participant

    Hi Victor!
    It works! 😀
    Thanks
    Stephan

    #1333486
    Victor
    Member

    Hey Stephan!

    Glad to know it works for you! Thanks for following up to let me know about it 🙂

    I’ll close this now, but feel free to open a new topic if anything comes up and we’d be happy to help!

    Cheers,
    Victor

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘wrong decimal seperator in ticketprice’ is closed to new replies.