Show lowest cost ticket in Title and Details area

Home Forums Ticket Products Event Tickets Plus Show lowest cost ticket in Title and Details area

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #945538
    Daniel
    Participant

    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.

    #945547
    Sergio
    Participant

    I have the same problem. did you solve this ?

    #945795
    George
    Participant

    Hi 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,
    George

    #945796
    George
    Participant

    Hi 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!
    George

    #946131
    Daniel
    Participant

    Hi 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 * FROMwp_postmetaWHEREmeta_key= '_EventCost'

    Hope that helps.

    #946216
    George
    Participant

    Hey 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!
    George

    #946220
    George
    Participant

    Hey 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,
    George

    #965839
    Leah
    Member

    Hi 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 Team

    #966220
    George
    Participant

    Stay 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,
    George

    #1001889
    Leah
    Member

    Hello,

    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.
    #1002299
    George
    Participant

    😀

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Show lowest cost ticket in Title and Details area’ is closed to new replies.