Hide QR code IF a certain category

Home Forums Ticket Products Event Tickets Plus Hide QR code IF a certain category

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1635968
    gsna
    Participant

    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!

    #1637356
    Cliff
    Member

    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):

    https://gist.github.com/cliffordp/7a819ccf8343cc19a07fd74b9f9aa762

    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.

    #1637945
    gsna
    Participant

    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!

    #1638089
    Cliff
    Member

    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.

    #1639760
    gsna
    Participant

    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!!!!!

    #1640375
    Cliff
    Member

    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.

    #1651831
    Support Droid
    Keymaster

    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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Hide QR code IF a certain category’ is closed to new replies.