Search Results for 'booking form'
-
Search Results
-
I’m finally getting round to adding EO Pro to a site I have in development. I’ve not tested out the booking feature up until now. Unfortunately when I try and put my name and email address, select the tickets and click book, I get the following error message:
Fatal error: Call to a member function format() on a non-object in /home/user/public_html/staging/wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php on line 35
I still get the emails and it seems everything has been booked. What is causing the error?
Hi
The issue is fairly simple but it took me a while to find out and fix.
When somebody creates ticket that has amount above 999 it is stored in database as “1,000.00” because of “number_format” function that is setting up the price for DB in “event-organiser-pro/includes/tickets.php” both “eventorganiser_insert_ticket” and “eventorganiser_update_ticket” methods.
It looks correct when in database, but after displaying it in view while booking tickets it is truncated by javascript to display pretty prices so ticket amount comes out as a “1.00”.
I assume that price cant be stored with just (which gives us “1, 000.00”)
number_format( $ticket['price'], 2)
It has to be done with english format (which gives us “1000.00”)
number_format( $ticket['price'], 2, '.', '' )
So when it is taken from input to display, javascript wont truncate the value.
What do you think?
Mozin