Home › Forums › Ticket Products › Event Tickets Plus › Show lowest cost ticket in Title and Details area
- This topic has 10 replies, 4 voices, and was last updated 8 years, 7 months ago by George.
-
AuthorPosts
-
March 2, 2015 at 12:09 pm #945538DanielParticipant
How can I show the lowest ticket price on the Single template in the Title and Detail area?
This function in the-events-calendar.class.php is outputting the data:
public function getEventMeta( $id, $meta, $single = true ) {.... get_post_meta( $id, $meta, $single );
Reference: http://codex.wordpress.org/Function_Reference/get_post_meta
I can see it’s pulling a single record but the problem and I expect if you add the tickets in the right order you can make it show lowest price first. However, the problem I have is that when you delete a ticket it isn’t always being deleted from the wp_postmeta table. This maybe a bug.
March 2, 2015 at 12:49 pm #945547SergioParticipantI have the same problem. did you solve this ?
March 3, 2015 at 5:15 pm #945795GeorgeParticipantHi Daniel,
Sorry for your trouble here. The issue with post meta not being deleted is definitely an issue we need to investigate, thanks for bringing it to our attention! Can you elaborate a bit on exactly what you mean when you said that the meta “isn’t always” being deleted? Are there any things you notice about times when the meta is successfully deleted compared to when it’s not?
In the meantime, here’s a little function I wrote that will get you the lowest ticket price for a given event → https://gist.github.com/momnt/194139341b16b6f29da8
If you add this function and use it in whatever theme templates whose normal price display you want to override, it should help. For help with overriding theme templates in general, check out our official “Themer’s Guide” here → http://tri.be/support/documentation/events-calendar-themers-guide/
Let us know if this helps!
Thanks,
GeorgeMarch 3, 2015 at 5:16 pm #945796GeorgeParticipantHi Sergio,
If my answer to Daniel is helpful, use what you can from that answer. If you have other things you want or need to address on your site, please up a new ticket so we can keep things organized and give your own unique issue proper attention and focus.
Thanks!
GeorgeMarch 5, 2015 at 6:03 am #946131DanielParticipantHi George
Thanks for the function which did what I needed.
I did a bit more testing of the possible delete bug and what I noticed is if you add your first ticket via the Events Calendar WooCommerce extension it creates two records in wp_postmeta, one of which has a blank meta_value. If I delete the ticket in the Event edit screen, it deletes only the row with a value for meta_value. If I click the link to Edit in WooCommerce and I delete it permanently from there it doesn’t remove any records from wp_postmeta. This therefore can create issues with your default cost display function.
This is the SQL I am using:
SELECT * FROM
wp_postmetaWHERE
meta_key= '_EventCost'
Hope that helps.
March 5, 2015 at 9:46 am #946216GeorgeParticipantHey Daniel,
I’m glad that function helped – keep a backup of it and/or a bookmark to this support topic in case you need to reference the original code down the road. The bad thing about custom code is that you risk losing it if you auto-update your theme (assuming that’s where you’ll add the code…).
As for the post-meta issue, I will investigate this and see what’s going on in person.
Thanks!
GeorgeMarch 5, 2015 at 9:53 am #946220GeorgeParticipantHey Daniel,
While I did not find that two records were ever created for ‘_EventCost’, I did find that deleting the tickets in the metabox would not clear the SQL record for the ‘_EventCost’ postmeta unless you then also manually clicked “Update Post”.
I will report my findings as a potential bug ticket and, if this is indeed a bug, then hopefully we can get a fix into an upcoming plugin release.
Thanks for your feedback here!
Cheers,
GeorgeMay 28, 2015 at 12:39 pm #965839LeahMemberHi there,
Thanks again for your post. We wanted to get in touch and let you know that although we weren’t able to address this issue in our upcoming 3.10 release, it is still very much a priority. We have a ticket in our system and will be investigating a solution to be released in a future version. Thank you for your patience and support while we work on this!
Cheers,
The Events Calendar TeamMay 30, 2015 at 9:31 am #966220GeorgeParticipantStay tuned to the 3.10 and all future releases Daniel, thanks for your patience here! I’ll close up this thread for now, but if issues continue to happen, don’t hesitate to open a new thread 🙂
Cheers,
GeorgeSeptember 3, 2015 at 4:13 pm #1001889LeahMemberHello,
Thank you so much for reporting this. We are happy to tell you that a solution to this issue is part of our upcoming 3.12 release! We are doing the final testing and then the new version will be released. Keep an eye on your dashboard Updates page!
If you experience any difficulty with the update or find that the issue you reported in this thread is not resolved in 3.12, please open a new thread and we can help you. Thank you for your patience and support as we work to improve our plugins!
Best,
Leah
and The Events Calendar team- This reply was modified 8 years, 7 months ago by Leah.
September 4, 2015 at 3:28 pm #1002299GeorgeParticipant😀
-
AuthorPosts
- The topic ‘Show lowest cost ticket in Title and Details area’ is closed to new replies.