On Free Tickets, how change button text to "Register"

Home Forums Ticket Products Event Tickets Plus On Free Tickets, how change button text to "Register"

  • This topic has 7 replies, 3 voices, and was last updated 8 years, 1 month ago by wealthfollowsworth.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1467481
    wealthfollowsworth
    Participant

    Hello. I made a ticket, and left the amount as zero…. so it would show as “Free”.

    However, the button next to it still says, “Buy Now”. That is confusing for a free ticket. See screenshot.

    Is there a way to change the text of that button to say “Register” when it is a free event?

    Thanks.

    #1467942
    Jennifer
    Keymaster

    Hello,

    Thanks for reaching out! I definitely understand where you’re coming from. Can you try adding the following to the functions.php file of your child theme?

    /**
    * Changes Buy Now! button text
    */

    add_filter( 'tribe_tickets_buy_button', 'changes_button_text', 11, 2 );
    function changes_button_text( $html ) {
    $html = str_replace("Buy Now!", "Register", $html);
    return $html;
    }

    Let me know if this works!

    Thanks,

    Jennifer

    #1468550
    cdoyle1966
    Participant

    I’m actually interested in this as well. Jennifer, in the code snippet you offered wouldn’t that change all of the Buy Now buttons to Register? That might actually be OK for me, but wasn’t sure if you could change it for a single event or not?

    #1468691
    wealthfollowsworth
    Participant

    Yes, like cdoyle1966 said, that changes the button text for ALL events.

    How do you change it just for events that are $0 (free)?

    Thanks.

    #1469204
    wealthfollowsworth
    Participant

    Hello. Just following up on this…..

    Thanks.

    #1477636
    Jennifer
    Keymaster

    So sorry for the delayed response here – making this change only when events are free would be a bit more involved, as you would need to get the cost of the ticket, check if it is $0, and then apply this change if it meets that condition. I would recommend taking a look at our functions list if this is something you would like to add.

    Alternatively, an easier solution might be to change the text to something that would work for both ticket types, such as “Get tickets”.

    We are limited in the amount of support that we can provide for customizations, but if you get stuck or have any questions, please let me know! I’ll be happy to point you in the right direction.

    Thanks,

    Jennifer

    #1496475
    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 ‘On Free Tickets, how change button text to "Register"’ is closed to new replies.