Need html code for purchased ticket info

Home Forums Calendar Products Events Calendar PRO Need html code for purchased ticket info

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1067402
    Tommy
    Participant

    Hello. This is a specific questions but here it goes. I’m using WooCommerce with Events Calendar. So once someone buys a ticket or “product” so to speak, we can manually click the “process” button and it send out a “order processed” email to the customer from the WooCommerce plugin. I want to customise this further by adding the name of the ticket (or “product”) that the’ve purchased in that “processed” email.

    Does anyone know how to do that? Is there some sort of “hook” or what ever you call it that i can add to the email html template that specifies what ticket they purchased?

    #1067908
    Brook
    Participant

    Howdy Tommy,

    That email is sent by WooCommerce, and the template is part of Woo’s email templates. It can still be overriden and include more detail.

    • How to override woo templates
    • I believe the template you’re looking for is the “Customer: Completed order” one: woocommerce/templates/emails/customer-completed-order.php

    You will notice that the details themselves are in the separate order details template, which is shared with a few other email templates. Inside of that template is yet another template, order items.

    • woocommerce/templates/emails/email-order-details.php
    • woocommerce/templates/emails/email-order-items.php

    One of those is the template you wish to modify. It really depends on where you want the title. Likely it is in the order-items.php one.

    If you wish to modify only the title, and do not mind modifying it in the email orders as well as the checkout screen, have a gander at this snippet:

    https://gist.github.com/elimn/9352efba6accd9dc21a1

    You could simply replace the usage of $event_start_date with $event_title. However, worth mentioning that there is a bug in the current version of Event Tickets Plus where tribe_events_get_ticket_event() does not actually work. 🙁 This is fixed in our next version 4.1. Or, you can fix it yourself by modifyingline 859 of /plugins/event-tickets-plus/src/Tribe/Commerce/WooCommerce/Main.php and swapping this:

    if ( in_array( get_post_type( $event ), Tribe__Tickets__Main::instance()->post_types ) ) {

    For this:

    if ( in_array( get_post_type( $event ), Tribe__Tickets__Main::instance()->post_types() ) ) {

    Does that all make sense? Does that answer your question? Please let me know.

    Cheers!

    – Brook

    #1067967
    Tommy
    Participant

    This reply is private.

    #1070905
    Brook
    Participant

    Howdy Tommy,

    I am sorry, I must not have been clear before. There is no code I shared that was meant to be copy/pasted into ‘customer completed order email’ template. I was sharing two separate solutions to your dilemma:

    1. How to create a theme override. This is the most customizable solution, but will require you to write your own code.
    2. A snippet that does something similar to what you want, and with a little tinkering can do exactly what you need. Paste the snippet at the top of your theme’s functions.php file. Replace the opening “<?php” with this snippet, as this snippet includes that opening tag.

    1. Custom override

    That email is sent by WooCommerce, and the template is part of Woo’s email templates. It can still be overriden and include more detail.

    • How to override woo templates
    • I believe the template you’re looking for is the “Customer: Completed order” one: woocommerce/templates/emails/customer-completed-order.php

    You will notice that the details themselves are in the separate order details template, which is shared with a few other email templates. Inside of that template is yet another template, order items.

    • woocommerce/templates/emails/email-order-details.php
    • woocommerce/templates/emails/email-order-items.php

    One of those is the template you wish to modify. It really depends on where you want the title. Likely it is in the order-items.php one.

    2. Snippet

    If you wish to modify only the title, and do not mind modifying it in the email orders as well as the checkout screen, have a gander at this snippet:

    https://gist.github.com/elimn/9352efba6accd9dc21a1

    You could simply replace the usage of $event_start_date with $event_title. However, worth mentioning that there is a bug in the current version of Event Tickets Plus where tribe_events_get_ticket_event() does not actually work.  This is fixed in our next version 4.1. Or, you can fix it yourself by modifyingline 859 of /plugins/event-tickets-plus/src/Tribe/Commerce/WooCommerce/Main.php and swapping this:

    if ( in_array( get_post_type( $event ), Tribe__Tickets__Main::instance()->post_types ) ) {

    For this:

    if ( in_array( get_post_type( $event ), Tribe__Tickets__Main::instance()->post_types() ) ) {

    Now that you know those are separate solutions does that help clarify things? Are you able to get it working, or could I perhaps clarify one of the methods further?

    Cheers!

    – Brook

    #1071079
    Tommy
    Participant

    Brook i really appreciate your help. But you need to be more clear. I want to understand you but i simply do not understand what you are asking of me. What exactly do you want me to do to fix this issue? Please tell me exactly “what” to put “where”

    • This reply was modified 10 years, 2 months ago by Tommy.
    #1071211
    Brook
    Participant

    Howdy Tommy,

    I will certainly do my best. As our TOS says we are only to give an overview of advice, it is up to you (or someone you hire) to have the technical expertise with PHP to take the advice and run with it, including customizing code snippets to fit your needs. If you do not feel you have enough experience with PHP and WordPress, don’t forget about the man freelancers out there who can help you with your dev needs: List of freelance customizers.

    I’m guessing you want to go with option 2, as it should be easier to follow. So let me expound a bit on that one. In order to add the title of the event to every ticket in the Woo order screens, including the “Customer completed order email”, do the following.

    1. Backup your site, just to be safe. Tutorial: Updating WordPress and Making Backups
    2. Paste this snippet at the top of your theme’s functions.php file. Replace the opening “<?php” with this snippet, as this snippet includes that opening tag.
    3. You need to modify that snippet some. Replace this line:
      $title .= ' - '.$event_start_date;
      with:
      <span class="pl-smi">$title</span> <span class="pl-k">.=</span> <span class="pl-s"><span class="pl-pds">'</span> - <span class="pl-pds">'</span></span><span class="pl-k">.</span><span class="pl-smi">$event_title</span>;
    4. Open up this file /plugins/event-tickets-plus/src/Tribe/Commerce/WooCommerce/Main.php and scroll down to line 859. replace this:
      if ( in_array( get_post_type( $event ), Tribe__Tickets__Main::instance()->post_types ) ) {
      with this:
      if ( in_array( get_post_type( $event ), Tribe__Tickets__Main::instance()->post_types() ) ) {

     

    Is that helping you make sense of things? If not, you should definitely checkout the list of freelancers. Anyone of them should be able to tackle this with great ease. The actual dev work can easily be done within an hour assuming I’m clear on what you need.

    Cheers!

    – Brook

    #1071227
    Tommy
    Participant

    OK i understand what your limitations are, but it seems if you just tell me what to put where, it will save so much time for you and for me…

    OK so in the last reply, you wrote: “You need to modify that snippet some. Replace this line:”

    What exactly are you talking about? Please be exact.. where do i have to go in order to find the file you want me to edit? The more exact you are, the better the chance i can follow your instructions because right there i don’t have a clue what you’re talking about.. you have told me what to do but you have not told me where to do it

    #1071228
    Tommy
    Participant

    This reply is private.

    #1072928
    Brook
    Participant

    This reply is private.

    #1083411
    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 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Need html code for purchased ticket info’ is closed to new replies.