Help Desk

Hide QR code IF a certain category

  • Posts: 9 Topics: 9
    | Permalink

    Hi,
    I know how to disable the QR code from all ticket emails; however I need to just hide it if the events that have been purchased are within a particular category (Online Events).
    Can you help me hide it in the emails IF the product category is Online Events?
    Thank you so much!

    Posts: 11242
    | Permalink

    Hi. Guess what… we just added a new filter for situations like this: tribe_tickets_plus_qr_enabled

    Here’s a code snippet that should do what you’re wanting (warning: this is untested code):

    Make sure to read the code’s comments, and please reference https://theeventscalendar.com/knowledgebase/implementing-custom-code-snippets/ for how to implement custom code snippets.

    Whenever customizing your site, it’s best to edit your wp-config.php file to enable WP_DEBUG and WP_DEBUG_LOG (which will create a file on your server at /wp-content/debug.log if there are any WP_DEBUG messages).

    Of course, we always recommend restorable database and file backups as well as performing modifications first on a staging site before modifying anything on your live/production site.

    Please let me know how this goes for you.

    Posts: 9 Topics: 9
    | Permalink

    WONDERFUL! This works!!
    That is great news.

    One more tiny question – is there a way to get some text to appear somewhere on the Ticket Email IF the ticket is within one of the no-QR categories? I’d like to tell these people that the login details for their event will be sent from GoToTraining within the next 24 hours and to contact us if they don’t receive them.

    Thanks so much!

    Posts: 11242
    | Permalink

    AWESOME! 🙂

    The email comes from /wp-content/plugins/event-tickets/src/views/tickets/email.php (note there are other email templates, too, like Non-Attendance or Moved Ticket — you’ll see them in that folder)

    You can follow our Themer’s Guide (our “how-to” walk-through video may prove helpful) to override any/all of this email’s content.

    The QR code part actually doesn’t come from that email template, though. The QR code gets injected via the tribe_tickets_ticket_email_ticket_bottom filter that’s in the email template — hooked in from wp-content/plugins/event-tickets-plus/src/Tribe/QR.php

    (Hopefully you’re still following along…)

    So you could adapt the code I gave you previously to do like the QR code does…

    add_action( 'tribe_tickets_ticket_email_ticket_bottom', 'your_function_name_here' );

    Doing it this way would not require any template override of the email content.

    Please let me know how this goes for you.

    Posts: 9 Topics: 9
    | Permalink

    Thanks Cliff! Sorry I am having trouble knowing where to put your ‘action’ code within the Git Snippet provided – are you able to tell me the line to put it? Im just not sure whether it goes within the function or just before/after the add_filter bit?

    THANK YOU!!!!!

    Posts: 11242
    | Permalink

    You’ll need to customize the one-liner code I shared, as “your_function_name_here” isn’t a real function… but this may help: https://theeventscalendar.com/knowledgebase/implementing-custom-code-snippets/

    If you need some coding help, you may want to ask your own developer or reference our Customizations Documentation, which includes a link to Hire A Freelancer.

    Please let me know how this goes for you.

    Posts: 65
    | Permalink

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

    | Permalink