Home › Forums › Ticket Products › Event Tickets Plus › Need a way to set a custom or
- This topic has 2 replies, 3 voices, and was last updated 9 years, 11 months ago by
Support Droid.
-
AuthorPosts
-
May 6, 2016 at 7:37 am #1111439
Christopher
ParticipantHi
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 listedJoint Hole Sponsorship
Exclusive Hold Sponsorship
Single Player Registration
Team Registrationthey need to be listed as follows
Team
Single
Exclusive
JointThis is reverse of what it currently is.
Please helpMay 6, 2016 at 7:55 am #1111460George
ParticipantHey 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.phpThen, 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!
GeorgeMay 21, 2016 at 9:35 am #1117383Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Need a way to set a custom or’ is closed to new replies.
