Problems with priece aand currency symbol

Home Forums Calendar Products Events Calendar PRO Problems with priece aand currency symbol

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1183710
    Muriel
    Participant

    Hello,
    i’ve got a question.
    In the price field, it was not possible to mix text and numbers. So I can not add Price “from 10” Euros if I have different prices. So for example: Theater tickets: different seats have different prices, but I can not specify a “starting price” mean?
    In the Dashboard (see screenshots) the text “ab” is stored, but on site it was not showing.

    I added following code into my functions.php an it works it shows now the starting price, but now the currency symbol is lost.
    It should show the currency symbol after the price, like before.
    I’m really not a great coder, so please, are you able to help me with the code so that the currency symbol will be there too?
    Kind regards
    Conny

    #1184080
    Cliff
    Member

    Hi Muriel.

    The code you put in functions.php didn’t make it into this thread. Could you please share it here?

    Also, the Event Cost field is meant to be a number, not “from a number” (text and a number)

    #1184299
    Muriel
    Participant

    This reply is private.

    #1184349
    Cliff
    Member

    Muriel, I found that code snippet at https://theeventscalendar.com/support/forums/topic/cost-field-validation-rules/#post-1087911

    Since it gets the _EventCost meta, it’s just getting the raw value of that field, which does not include the currency symbol.

    To be clear, you’re wanting that code but with the currency symbol displayed after that code’s output, right?

    #1184449
    Cliff
    Member

    Assuming “yes”, please try out this code snippet:

    https://gist.github.com/cliffordp/b74ef779f9dbfff291bc2fa4dfebad1e

    It’s untested but might just work for you.

    I always recommend enabling WP_DEBUG while trying out new code.

    #1185451
    Muriel
    Participant

    This reply is private.

    #1186030
    Cliff
    Member

    Muriel, I updated the code snippet. Please view the latest version and let me know if it’s working well for you now.

    #1186236
    Muriel
    Participant

    Hi Cliff,
    The last point: the price field should – according to the description – remain empty if nothing is written purely. Unfortunately now automatic 0 CHF appears. Could we please change yet, then it would be perfect 🙂

    I would be so glad
    Regards Conny

    #1186254
    Muriel
    Participant

    This reply is private.

    #1186449
    Cliff
    Member

    Muriel, I noticed a bug so I tested it thoroughly and you should use the latest version:

    https://gist.github.com/cliffordp/b74ef779f9dbfff291bc2fa4dfebad1e

    Please confirm you got this latest code and that it’s working well for you.

    Thanks.

    #1187636
    Muriel
    Participant

    Thank you very much.
    With the last code you sent, currency symbol disappeared again, but the one you sent before, as you see in my second answer, it works very well. It’s perfekt now.
    Thank you again, for helping 🙂

    Kind regards
    Conny

    #1187755
    Cliff
    Member

    Excellent. It turned out to be more work than I expected it would be, but I’m very glad it was worth it for you!

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Problems with priece aand currency symbol’ is closed to new replies.