New question about old thread

Home Forums Ticket Products Event Tickets Plus New question about old thread

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1203282
    Murray
    Participant

    I’m referring to this thread – https://theeventscalendar.com/support/forums/topic/getting-started/#post-1172675

    In October, I asked about removing the QR code from tickets and was given this code
    if ( class_exists( ‘Tribe__Tickets_Plus__QR’ ) ) {

    add_action( ‘init’, ‘tribe_remove_qr_codes_from_ticket_emails’ );

    function tribe_tickets_ticket_email_ticket_bottom() {
    remove_action( ‘tribe_tickets_ticket_email_ticket_bottom’, array( ‘Tribe__Tickets_Plus__QR’, ‘inject_qr’ ) );
    }
    }

    But, shouldn’t that be this?
    if ( class_exists( ‘Tribe__Tickets_Plus__QR’ ) ) {

    add_action( ‘init’, ‘tribe_remove_qr_codes_from_ticket_emails’ );

    function tribe_remove_qr_codes_from_ticket_emails() {
    remove_action( ‘tribe_tickets_ticket_email_ticket_bottom’, array( ‘Tribe__Tickets_Plus__QR’, ‘inject_qr’ ) );
    }
    }

    #1203393
    George
    Participant

    It should! Sorry about that Murray.

    Best of luck with this snippet!
    George

    #1203444
    Murray
    Participant

    Unfortunately, that doesn’t work either, although it now no longer generates an error message! Any idea why it might be failing? Also, would it be possible to ‘retrofit’ the earlier thread (which is now locked) with the corrections?

    #1203852
    George
    Participant

    Sorry to hear that Murray, you may have some better luck by removing the remove_action call from within init, so that the code is like this:

    if ( class_exists( 'Tribe__Tickets_Plus__QR' ) ) {
    	remove_action( 'tribe_tickets_ticket_email_ticket_bottom', array( 'Tribe__Tickets_Plus__QR', 'inject_qr' ) );
    }
    
    #1204044
    Murray
    Participant

    George, that still doesn’t work. The darn QR code is still there. I want to remove it because there is no function to it for the purpose of this event – there’s no need to check in. You come, you hand in your ticket, you sit in a seat, you’re done!

    #1204215
    George
    Participant

    I’m sorry to hear this, Murray! This snippet has worked for a long time so I’m investigating why it’s no longer working according to your claims. I have reached out to other folks on our team for some assistance on this and will post an update here as soon as we’ve learned more.

    Thanks for your patience!
    George

    #1206134
    Nico
    Member

    Hey Murray,

    First of all thanks for the patience while we looked into this! By George’s request I reviewed the code above and verified it’s not actually working as you reported. Hence I came up with a new version of the snippet that’s working for me:


    /* Tribe, remove QR code from tickets email */

    if ( class_exists( 'Tribe__Tickets_Plus__Main' ) && class_exists( 'Tribe__Tickets_Plus__QR' ) ) {

    $qr_instance = Tribe__Tickets_Plus__Main::instance()->qr();

    remove_action( 'tribe_tickets_ticket_email_ticket_bottom', array( $qr, 'inject_qr' ) );
    }

    Can you please give this new snippet a try and let us know if it works,
    Best,
    Nico

    #1206149
    Murray
    Participant

    Hmm – it still isn’t working for me. This is what I have –

    if ( class_exists( ‘Tribe__Tickets_Plus__Main’ ) && class_exists( ‘Tribe__Tickets_Plus__QR’ ) ) {
    $qr_instance = Tribe__Tickets_Plus__Main::instance()->qr();

    remove_action( ‘tribe_tickets_ticket_email_ticket_bottom’, array( $qr, ‘inject_qr’) );
    }

    #1206152
    Nico
    Member

    My bad Murray! The $qr_instance variable should be just $qr:


    /* Tribe, remove QR code from tickets email */

    if ( class_exists( 'Tribe__Tickets_Plus__Main' ) && class_exists( 'Tribe__Tickets_Plus__QR' ) ) {

    $qr = Tribe__Tickets_Plus__Main::instance()->qr();

    remove_action( 'tribe_tickets_ticket_email_ticket_bottom', array( $qr, 'inject_qr' ) );
    }

    Let me know if it works now!

    Thanks,
    Nico

    #1206167
    Murray
    Participant

    W00t! That one works! Thanks to Nico and George for hanging in there with me. My tickets no longer confuse people. ๐Ÿ™‚

    #1206810
    Nico
    Member

    Stocked to hear Murray! Thank YOU for the patience while we worked this out ๐Ÿ™‚

    Iโ€™ll go ahead and close out this thread, but if you need help with anything else please donโ€™t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘New question about old thread’ is closed to new replies.