Home › Forums › Calendar Products › Events Calendar PRO › Problems with priece aand currency symbol
- This topic has 12 replies, 3 voices, and was last updated 9 years, 5 months ago by
Cliff.
-
AuthorPosts
-
October 27, 2016 at 7:24 am #1183710
Muriel
ParticipantHello,
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
ConnyOctober 27, 2016 at 2:52 pm #1184080Cliff
MemberHi 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)
October 28, 2016 at 1:55 am #1184299Muriel
ParticipantThis reply is private.
October 28, 2016 at 5:42 am #1184349Cliff
MemberMuriel, 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?
October 28, 2016 at 9:22 am #1184449Cliff
MemberAssuming “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.
October 31, 2016 at 1:38 pm #1185451Muriel
ParticipantThis reply is private.
November 1, 2016 at 2:52 pm #1186030Cliff
MemberMuriel, I updated the code snippet. Please view the latest version and let me know if it’s working well for you now.
November 2, 2016 at 3:48 am #1186236Muriel
ParticipantHi 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 ConnyNovember 2, 2016 at 4:20 am #1186254Muriel
ParticipantThis reply is private.
November 2, 2016 at 9:56 am #1186449Cliff
MemberMuriel, 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.
November 4, 2016 at 3:56 am #1187636Muriel
ParticipantThank 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
ConnyNovember 4, 2016 at 9:26 am #1187755Cliff
MemberExcellent. It turned out to be more work than I expected it would be, but I’m very glad it was worth it for you!
-
AuthorPosts
- The topic ‘Problems with priece aand currency symbol’ is closed to new replies.
