Home › Forums › Ticket Products › Event Tickets Plus › Event Tickets Plus event date
- This topic has 7 replies, 4 voices, and was last updated 9 years, 8 months ago by
Jens Kirk.
-
AuthorPosts
-
July 19, 2016 at 6:03 am #1141410
Jens Kirk
ParticipantHi
Does the ticket hold the information about the event start date?
I need to work with woo commerce in order to send reminder emails. As this is not yet possible through Tribe products (as I understand it), I need to use a product such as Follow Ups. This plugin is only looking at the Woo product which is created by Event Tickets plus.
Is it therefore possible to pass Event start date automatically unto the ticket and woo product ?
What would be your advice?
Cheers,
July 19, 2016 at 11:13 am #1141621George
ParticipantHey @Jens,
Thanks for reaching out!
The “Product” object itself unfortunately does not include the start or end dates of the corresponding event. To see all of the properties on a WooCommerce “product” object, I have copied and pasted an example object into a Gist here ? https://git.io/vKoqj
In any context where you have the product ID, though, you should be able to get the event ID (and thus basically any event information you need!) by using code like the following:
// Let's assume you have a $product_id variable somewhere here.$Event_Tickets_Plus = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
$event_id = $Event_Tickets_Plus->get_event_for_ticket( $product_id );
That $event_id variable is now an actual event ID. You can then use this with any of The Events Calendar’s template tags and helper functions to extract specific bits of information about the information.
To find all of these functions, head to either of the following sets of files within your copy of The Events Calendar:
the-events-calendar/src/functions/template-tagsand/or:
the-events-calendar/common/src/functions/template-tags/☝️ In these folders, you will find all sorts of files with straightforward names that contain easy-to-use helper functions. For example, the “date.php” files contain functions related to event dates.
So you might explore those files and find the function tribe_get_start_date().
With the bit of code I shared above, then, you could write something like this to get the event start from a ticket/product ID:
// Let's assume you have a $product_id variable somewhere here.$Event_Tickets_Plus = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
$event_id = $Event_Tickets_Plus->get_event_for_ticket( $product_id );$start_date = tribe_get_start_date( $event_id );
I hope that helps!
GeorgeJuly 21, 2016 at 1:34 pm #1142685Jens Kirk
ParticipantHi George
Great answer!
What I am looking for is actually a requested feature, ranking nr. 4 on the requests and the most popular feature flagged as “Planned”.
My question is therefore, is there any way we can push for development? Would you be able to supply a quote on finishing the feature ?
The alternative for us is to work in an integration to Follow Ups which will eventually be redundant .. so the native solution would be highly preferred.
Thanks for a great plugin!
Cheers,-
This reply was modified 9 years, 9 months ago by
Jens Kirk. Reason: wording
July 21, 2016 at 1:41 pm #1142690George
ParticipantHey Jens,
Thank you for sharing this detail. While I can confirm that we are working actively on a set of tools for event promotion as described in that feature request you linked to, we unfortunately cannot be “paid” to speed it up and such.
I’m sorry to disappoint on that front, but do hope the code I shared above is helpful in some way.
Please let me know if you have any further thoughts or questions!
Sincerely,
GeorgeJuly 22, 2016 at 3:16 am #1142868Jens Kirk
ParticipantHi George, thanks for the clear and fast answer!
Unfortunate that we can’t push the development. Could you give a rough idea on when you aim to deploy these functions?
The answer is important to us regarding our effort to write a hack ourselves.Thanks for great plugin!
cheersJuly 22, 2016 at 10:33 am #1143076George
ParticipantHey Jens,
While I don’t have any specific ETA for those features, it will probably not be for at least another three months if all development goes exactly to plan.
I apologize for the vagueness, but just want to be honest because there are many projects in active development and so this will take several months before completion.
Sincerely,
GeorgeAugust 13, 2016 at 9:35 am #1151310Support 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. -
This reply was modified 9 years, 9 months ago by
-
AuthorPosts
- The topic ‘Event Tickets Plus event date’ is closed to new replies.
