Posted: August 18, 2012 at 8:41 pm
|
In Japan, there is no decimal used within the currency system. |
The decimal placement is actually determined at the database level. For example, in the “wp_events_prices” table the “event_cost” column type is decimal(20,2). You might be able to modify the price columns in the database to reflect the pricing structure for your specific needs. FYI. I think we are changing this in EE 3.2. |
|
|
Actually Seth that doesn’t work. It still displays the price with .00 at the end even though the database is not keeping any decimal places on file. I made the following changes which didn’t have any effect on the price layout on the event page. wp_event_attendee_cost table wp_event_prices table wp_events_attendee table |
Sorry guys! It seems I was mistaken. We use the PHP number_format() function to display/store price data in some places. So, if you would like to override the format. Then you will need to use the Custom Files addon to override the functions that display the prices. These three functions can be found in the event-espresso/includes/functions/pricing.php: event_espresso_get_final_price() event_espresso_price_dropdown() espresso_attendee_price() You should be able to copy these functions into the custom_function.php file, then change the number_format() parameters to display the prices as needed. Hope that helps.
|
|
|
Seth, thanks for your support. I uploaded the 3 custom files I then edited a local copy of Finally, I copied those three sections of code that I edited: event_espresso_get_final_price() didn’t seem to change anything I’m wondering if you could kindly attach the correct code that I should append to custom_functions.php in order to resolve the trailing .00 issue ? |
We would need a custom development request to write the code for you. This is why it says on the page that the custom files add-on should be used by people familiar with PHP programming — we cannot provide support for custom code. Have you tested your code with WP_DEBUG turned on to identify any programming errors?
|
|
|
Thanks for your reply, Chris. I am not comfortable with PHP programming yet my client needs a site that will correctly display prices in yen. (no trailing decimal and with a comma after the thousandth integer ie. ?3,000) |
If Seth is saying that it would need to be custom programmed, then I would defer to him. He would know better than I would what’s going into the next 3.1 release since he’s been working with the code more than I have. |
|
|
Hi. Without adding custom_functions it can be done in pricing.php – just need to change all “, 2” to “, 0” everywhere in the code π |
If you make the changes directly to pricing.php, you’ll lose your changes on each update of Event Espresso. That’s why we recommend overriding this in the custom functions file. |
|
|
I know that π But I need to do to much changes! Almost in 1/4 of all files I changed something – currency right, not left, translated something, that isnt translated by language file, done some specific thinks, that must be done not only in template but in code too. I know that, that lost this job and because was writing few letters, asked about 3.2… dont want to start lot of special customisations and after month get new script and do all job again. Most important thing – i want to customise as i need and leave it. Maybe for year. And again sit to huge upgrade and customisation from zero π |
The support post ‘Event price – remove decimal’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.