Need a way to set a custom or

Home Forums Ticket Products Event Tickets Plus Need a way to set a custom or

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1111439
    Christopher
    Participant

    Hi
    I have 4 tickets listed on an event, and my client wants them ordered a specific way. It is not alpha or by price.
    Can this be done.
    Currently they are listed

    Joint Hole Sponsorship
    Exclusive Hold Sponsorship
    Single Player Registration
    Team Registration

    they need to be listed as follows

    Team
    Single
    Exclusive
    Joint

    This is reverse of what it currently is.
    Please help

    #1111460
    George
    Participant

    Hey Christopher,

    Thanks for reaching out!

    Unfortunately, altering the order of the tickets would require you to dive into the plugin code on your site and modify the code directly. We cannot help with code modifications, so this is something you will have to take the reins on, or you can also hire a professional developer to help you. We have a list of great developers here → http://m.tri.be/18k1 (and have no affiliation with any of these folks–they’re simple some well-respected names in the community that we’ve compiled to share in situations like this one).


    While we cannot help with the code modification here, I would like to at least throw out some information to help you get going in the right direction if this is a code modification you are willing to make on your own:

    Head to this file within Event Tickets Plus:
    event-tickets-plus/src/Tribe/WooCommerce/Main.php

    Then, find the function called get_tickets_ids(). This function is what retrieves the tickets by IDs, and thus you should be able to manipulate it to alter the order.

    How so? Well, again, this is something you will have to tinker with and experiment with. But check out the main query that gets the tickets:


    public function get_tickets_ids( $event_id ) {
    if ( is_object( $event_id ) ) {
    $event_id = $event_id->ID;
    }

    $query = new WP_Query( array(
    'post_type' => 'product',
    'meta_key' => $this->event_key,
    'meta_value' => $event_id,
    'meta_compare' => '=',
    'posts_per_page' => -1,
    'fields' => 'ids',
    'post_status' => 'publish',
    ) );

    return $query->posts;
    }

    This is just a WP_Query! So you can use any of the order and orderby parameters for WP_Query like normal here. Not familiar with such parameters? Well, they’re all documented pretty extensively in the official WordPress documentation here → https://codex.wordpress.org/Class_Reference/WP_Query

    Check this all out and tinker around a bit—you should be able to tweak the ordering how you see fit.

    Cheers!
    George

    #1117383
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Need a way to set a custom or’ is closed to new replies.