Posted: August 30, 2015 at 8:26 pm
|
The date for ‘Goes on Sale’ in the ticket selector is not following the format in WordPress settings. How do I change this particular date string? See this link http://dev.southgatemelbourne.com.au/events/st-vincent/ |
|
Hi, Currently the only way to amend that date format is via a small function. The following can be added to a site specific plugin (https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ ):
The above should change it to match your format (e.g. Monday 31 August 2015). |
|
Hi Dean Thanks for your response. I’ve tried this with no luck unfortunately. I put the following in our functions file (we maintain our own custom theme so don’t need to use plugins) function goesonsale($dformat) { Is there anything I’m missing? Thanks |
|
Hi, Nope, nothing else needed. I tested with the Twenty Twelve default theme and it worked fine. You could check the code to make sure the quotation marks are correct (not curly ones) and that there is no obvious mistakes. Otherwise you could try the custom site plugin route. The code itself though is solid. |
|
Hi Dean I’ve typed it out rather than cut & paste and have tried the plugin approach to no avail. I’ve managed to get other custom functions to work fine, eg removing the ical button. So I’m at a loss as to why this wouldn’t work… |
|
Hi, OK, I should have thought of this earlier. The hook being used in the code is a fairly recent addition to the plugin and your dev site EE version is out of date. If you update to the latest version then it should work just fine from there. |
|
Hi Dean Thanks |
|
It’s a possibility, you would have to check your sites error logs to see what’s happening and whether any errors from this function appear or not. |
|
Actually, no. It appears, and I’m really sorry about this, that we have been talking about different areas of the plugin. The above code works, but only for the Ticket Details area (screenshot http://take.ms/5MNy1) not the actual ticket selector. Currently there is no filter for the Goes on dale datetime in the area you are looking at. I will request the development team to add one in. |
|
Bummer! Well at least I know I’m not going crazy! Thanks for placing the request. In the meantime, is it possible to point me to where I could hack this in core code for a temporary fix? |
Hi Jade, Generally we do not provide support for core edits, however as this fix will be included within the next version of Event Espresso we can provide the code used. Open up modules/ticket_selector/templates/ticket_selector_chart.template.php Line 198 is this:
Change that to:
Then use a function like this: function custom_ts_short_date($dformat) { $dformat = 'Y-m-d'; return $dformat; } add_filter('FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format', 'custom_ts_short_date'); To alter the format used. The reason you are adding a filter is because that filter will be added in the next version of EE, so when you update this will continue to work as expected. The next version of Event Espresso will use the date format set within the WordPress general settings, that filter allows you to use a shorthand version if you prefer. |
|
|
Brilliant, thanks so much Tony! Looks great http://www.southgatemelbourne.com.au/events/st-vincent/ |
You’re most welcome 🙂 Ill close this thread, please feel free to open up another if you have further problems. |
|
Hello, filters are now available that will allow you to customize the date formats in the ticket selector. Thanks again! — |
|
The support post ‘Goes on sale Date format’ 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.