Home › Forums › Ticket Products › Event Tickets Plus › How can I change the "Buy Now!" button to "Book Now!"
- This topic has 13 replies, 2 voices, and was last updated 8 years, 1 month ago by
Matt.
-
AuthorPosts
-
January 30, 2018 at 5:44 am #1439601
Matt
ParticipantI have identified that event-tickets/src/template-tags/tickets.php contains the text and I can change it here to modify it.
However, I am trying to add the changed file to my child theme to overide tickets.php but haven’t been able to work out where to put it. I have tried event-tickets/tribe-events/tickets.php but it doesn’t seem to work.
January 31, 2018 at 12:47 pm #1441031Brendan
KeymasterHi there,
Thanks for emailing support. Are you changing the text on line 237 of that file?
Thanks,
BrendanFebruary 1, 2018 at 12:54 am #1441388Matt
ParticipantYes, and that works but I do not want to change the original file because it will obviously get overwritten each time I upgrade to a new version.
I am asking where I should put the edited file in my child theme for the plugin to pick up the change.
February 1, 2018 at 3:35 pm #1442124Brendan
KeymasterHi there,
Most definitely you are correct you do not want to change the core file. You can check instructions in our themer’s guide on how to edit this without it getting overwritten. In short you would just recreated the file and directory structure inside your child theme.
https://theeventscalendar.com/knowledgebase/themers-guide/
Let me know if that helps.
Thanks,
BrendanFebruary 1, 2018 at 9:15 pm #1442242Matt
ParticipantBrendan,
As I explained I have already tried this following the instructions in the
themers guide and it didn’t work.Please can you give the the directory structure to show me where to put it.
February 2, 2018 at 1:50 pm #1442870Brendan
KeymasterHi Matt,
Lets try it as a function then if you have already done the themes guide.
In your functions.php file in your theme add this code:
/** * 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!", "Book Now!", $html); return $html; }Let me know if that works.
Thanks,
BrendanFebruary 6, 2018 at 3:04 am #1444899Matt
ParticipantBrendan, That works, thank you.
However, if I want to make any other changes where am I supposed to put the modified template file for event-tickets/src/template-tags/tickets.php in my child theme. Unlike most templates where instructions are given at the top of the file as to what location to place the file, event-tickets/src/template-tags/tickets.php doesn’t say.
February 6, 2018 at 3:07 pm #1445743Brendan
KeymasterHi Matt,
Glad that works. In regards, to where you would place the modified template file it goes in your child-theme following the path outlined above.
Thanks,
BrendanFebruary 7, 2018 at 2:32 am #1446040Matt
ParticipantBrendan,
I have tried putting the modified template in my_child_theme/event-tickets/src/template-tags/tickets.php as you suggested but it get’s ignored.
Could you please give me the path in the form my_child_theme/XXX/yyy/zzz etc. where I need to put the file for it to be implemented.
February 7, 2018 at 3:32 pm #1447023Brendan
KeymasterHi Matt,
You can also try /theme/tribe-events/tickets/src/template-tags/tickets.php
Let me know if that method works.
thanks,
BrendanFebruary 8, 2018 at 12:58 am #1447303Matt
ParticipantUnfortunately, that does not work either.
February 8, 2018 at 2:27 pm #1448366Brendan
KeymasterHi Matt,
So I apologize for the error. I spoke to one of our developers and they stated that particular file cannot be edited. In any case, that is why they gave us the function. The themer’s guide that I posted above as a list of the files that can be edited and where to place them.
Thanks,
BrendanMarch 2, 2018 at 8:35 am #1468318Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘How can I change the "Buy Now!" button to "Book Now!"’ is closed to new replies.
