Events Calendar using same email template a Woocommerce Sensei

Home Forums Ticket Products Event Tickets Plus Events Calendar using same email template a Woocommerce Sensei

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1027850
    Chris
    Participant

    I’m using Woocommerce Sensei for online courses and Events Manager Pro + Wootickets for physical events – if a physical event is purchased the order confirmation email sent uses the Woocommerce Sensei email template even if a Sensei product isn’t present in the order.

    Is it possible to override this

    P.S. for the record Woocommerce passed the buck to Tribe!.

    Many thanks

    #1028212
    Nico
    Member

    Hey Chris,

    Thanks for reaching out to us! I’ll try to help you getting this right…

    Well, let me see if I get this right. When you install Sensei, and purchase tickets for an event instead of getting the tickets email in the ‘Events Calendar format’, you are getting it in the ‘Sensei format’. Strange thing because our plugin uses it’s own template to send ticket (located at ‘/plugins/the-events-calendar/src/views/tickets/email.php’) as far as I’am aware. You can check if there’s a ‘tribe-events’ folder in the theme containing a template override for the email.

    Please check on that and let me know,
    Best,
    Nico

    #1028233
    Chris
    Participant

    It’s not the ticket email – it’s the order confirmation email containing order details, payment details and the “course details will be send separately” message.

    #1028396
    Chris
    Participant

    Email confirmation example

    • This reply was modified 8 years, 5 months ago by Chris.
    #1028737
    Nico
    Member

    Hey Chris,

    Thanks for clarifying on this! I’m not able to see the attached screenshot (you can upload it to cloudup.com or other image sharing service and share the link here) but I think I get you. The email you are referring to, is the standard WooCommerce order email which Woo sends when a purchase is made. I guess ‘Sensei’ is overriding this email without checking if it’s a sensei purchase or just a regular purchase like in our case. I guess the solution might be to override he new order email in your own theme (https://docs.woothemes.com/document/template-structure/), with a copy of the Sensei template but with different text.

    Please let me know if this makes sense to you,
    Have a great weekend,
    Nico

    #1030518
    Chris
    Participant

    Thanks – I’ve got Woocommerce currently working on this as they’ve now confirmed there’s a bug at their end.

    Related to this I have a few more questions:

    1) I notice that when a refunded order is processed the message “You’ll receive your tickets in another email.” Still appears underneath the order table. Can this be removed?

    2) In your order confirmation emails when a product has been purchased you have the message “Your order is complete. Download your plugins at…” at the top of the order. Can you let me know how to add this to our emails (also Woocommerce)?

    3) All refund emails say “Your order has been partially refunded” even when fully refunded – is there a way around this or is this a Woocommerce issue?

    Many thanks

    #1030926
    Nico
    Member

    Hey Chris,

    Glad to hear this is being addressed by the Woo team 🙂

    1) I notice that when a refunded order is processed the message “You’ll receive your tickets in another email.” Still appears underneath the order table. Can this be removed?

    Not sure what you are referring to here. You mean a user purchases tickets, then you refund the order and in the refund email you see the “tickets” related text?

    2) In your order confirmation emails when a product has been purchased you have the message “Your order is complete. Download your plugins at…” at the top of the order. Can you let me know how to add this to our emails (also Woocommerce)?

    You can override Woo’s emails as shown here: https://docs.woothemes.com/document/template-structure/ – Have you tried it? Maybe you’ll need to do so in a child theme of Sensei? Not sure how that works for Woo/Sensei.

    3) All refund emails say “Your order has been partially refunded” even when fully refunded – is there a way around this or is this a Woocommerce issue?

    I’m mostly sure we are not modifying the refund email, so this is probably happening on the WooCommerce side. You can check so by disabling WooTickets and refunding the order. If you are not refunding all items in the order I guess this message makes sense!

    Please let me know if you have any other follow-up questions on this,
    Best,
    Nico

    #1030958
    Chris
    Participant

    Thanks Nico…

    1) Yes! I would ideally like to remove this message as it would not longer be relevant.

    2) OK – will take a look

    3) OK! It seems to be a common Woocommerce problem.

    #1032609
    Nico
    Member

    Nice Chris!

    1) Yes! I would ideally like to remove this message as it would not longer be relevant.

    Diving into the code revealed the message is added to the order email which is the same for a complete order or a refunded one. To remove the message from all emails use the code below.

    remove_action( 'woocommerce_email_after_order_table', array( 'Tribe__Events__Tickets__Woo__Main', 'add_tickets_msg_to_email' ) );

    If you want to keep the message for complete orders but not refunded ones, let me know and we can hook a modified add_tickets_msg_to_email to address this!

    Best,
    Nico

    #1032631
    Chris
    Participant

    Hi – thanks for this.

    Please can you look a the modified hook you mention – it really needs to keep the message for complete orders only so customers are not let guessing.

    Many thanks

    #1033443
    Nico
    Member

    Hey Chris,

    Thanks for you patience on this! The complete code is the following:

    if ( class_exists( 'Tribe__Events__Tickets__Woo__Main' ) ) {

    $woo_tickets = Tribe__Events__Tickets__Woo__Main::get_instance();

    remove_action( 'woocommerce_email_after_order_table', array( $woo_tickets, 'add_tickets_msg_to_email' ) );

    add_action( 'woocommerce_email_after_order_table','custom_add_tickets_msg_to_email', 10, 2 );

    function custom_add_tickets_msg_to_email( $order ) {

    $order_items = $order->get_items();

    // Bail if the order is empty or refunded
    if ( empty( $order_items) || $order->get_total_refunded() != NULL ) {
    return;
    }

    $has_tickets = false;

    // Iterate over each product
    foreach ( (array) $order_items as $item ) {

    $product_id = isset( $item['product_id'] ) ? $item['product_id'] : $item['id'];

    // Get the event this tickets is for
    $event_id = get_post_meta( $product_id, '_tribe_wooticket_for_event', true );

    if ( ! empty( $event_id ) ) {
    $has_tickets = true;
    break;
    }
    }

    if ( ! $has_tickets ) {
    return;
    }

    echo '<br/>' . apply_filters( 'wootickets_email_message', __( "You'll receive your tickets in another email.", 'tribe-wootickets' ) );
    }
    }

    Basically it detects if there’s a refunded amount other tan NULL, in which case it doesn’t display the message.

    Please give it a try and let me know if it works as expected,
    Best,
    Nico

    #1075871
    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 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Events Calendar using same email template a Woocommerce Sensei’ is closed to new replies.