Home › Forums › Ticket Products › Community Tickets › How to edit the submit an event form
- This topic has 7 replies, 2 voices, and was last updated 8 years, 3 months ago by Brian.
-
AuthorPosts
-
January 6, 2016 at 5:50 am #1050961MatthewParticipant
Hi,
I’ve browsed the forum but unfortunately can’t find the answer, should just be a quick question.
I want to edit the ‘submit an event’ form for my community users. Specifically I want to add ‘USD’ after ‘Price’ in the ‘Add New Ticket’ section of the submission form.
I can’t find the template for the community submission form or the add new ticket section of it. Where do I find it so I can edit it using the guidelines in the themers guide?
Thanks,
MatJanuary 7, 2016 at 8:40 am #1051983BrianKeymasterHi Mat,
Sorry for the delay in getting to you on this.
The files that controls this is an admin file here:
plugins/event-tickets/src/admin-views/meta-box.php
plugins/event-tickets-plus/src/admin-views/woocommerce-metabox-advanced.php
plugins/event-tickets-plus/src/admin-views/price-fields.php
So they cannot be directly edited or moved to the theme.
We have this guide instead that might help change a word:
https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/
The text domain is:
event-tickets-plus
and this might work for the custom text in the snippet on that guide:
$custom_text = array(
'Price:' => 'Price: (USD)',
);Cheers
January 8, 2016 at 6:30 am #1052569MatthewParticipantThanks for getting back to me Brian.
I put that snippet in my custom plugin (I use this instead of the functions.php) and unfortunately nothing has changed on the Submit an Event page. You can see where I put the code in this screenshot:
https://nimbus.everhelper.me/client/notes/share/366470/ZnbWbcwHI0usWcc09Zv2VpRVQVa33SgM/
Have I entered something incorrectly?
Thanks,
MatJanuary 8, 2016 at 8:31 am #1052618BrianKeymasterHi,
Please look at the snippet in the article I referenced.
It is a piece of that snippet.
Cheers
January 9, 2016 at 5:05 am #1052955MatthewParticipantHi Brian,
I had read that article 3 times, it’s not very easy to understand.
After trying a bunch of different stuff I found I already had that snippet in my site plugin:
If I paste the snippet again later the site breaks and it tells me I cant ‘redeclare function tribe_custom_theme_text’.
I tried modifying the code to include the snippet you gave me but that doesn’t do anything. I presume I need to specify the text domain somehow?
This is what I tried, the site didn’t break but nothing happens to ‘Price’:
/* * EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR * See the codex to learn more about WP text domains: * <a href="http://codex.wordpress.org/Translating_WordPress#Localization_Technology" rel="nofollow">http://codex.wordpress.org/Translating_WordPress#Localization_Technology</a> * Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'... */ function tribe_custom_theme_text ( $translations, $text, $domain ) { // Put your custom text here in a key > value pair // Example: 'Text you want to change' > 'This is what it will be changed to' // The text you want to change is the key, and it is case-sensitive // The text you want to change it to is the value // You can freely add or remove key > values, but make sure to separate them with a comma $custom_text = array( 'Location' => 'Enter a City, Zip or Postcode', 'Price:' => 'Price: (USD)', ); // If this text domain starts with "tribe-", and we have replacement text if(strpos($domain, 'tribe-') === 0 && array_key_exists($text, $custom_text) ) { $text = $custom_text[$text]; } return $text; } add_filter('gettext', 'tribe_custom_theme_text', 20, 3);
How do I change the word ‘Price’ and keep my changes to the word ‘Location’?
Thanks,
MatJanuary 9, 2016 at 8:06 am #1053178BrianKeymasterHi,
I can try to help clear up what is wrong here.
You cannot have a function with the same name and the text domain must match the text you are trying to change.
The text domain is different for Event Tickets Plus.
I got this to work for me:
/*
* EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
* See the codex to learn more about WP text domains:
* http://codex.wordpress.org/Translating_WordPress#Localization_Technology
* Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'...
*/
function tribe_price_wording_change ( $translations, $text, $domain ) {// Put your custom text here in a key > value pair
// Example: 'Text you want to change' > 'This is what it will be changed to'
// The text you want to change is the key, and it is case-sensitive
// The text you want to change it to is the value
// You can freely add or remove key > values, but make sure to separate them with a comma
$custom_text = array(
'Price:' => 'Price: (USD)',
);// If this text domain starts with "event-", and we have replacement text
if(strpos($domain, 'event-') === 0 && array_key_exists($text, $custom_text) ) {
$text = $custom_text[$text];
}return $text;
}
add_filter('gettext', 'tribe_price_wording_change', 20, 3);Notice the changes made here:
if(strpos($domain, 'event-')
and here:
function tribe_price_wording_change ( $translations, $text, $domain ) {
}
add_filter('gettext', 'tribe_price_wording_change', 20, 3);That worked with the other function present too on my site and should work for you.
Thanks
January 10, 2016 at 4:36 pm #1053600MatthewParticipantHi Brian,
That worked nicely.
Thanks mate,
MatJanuary 10, 2016 at 6:11 pm #1053616BrianKeymasterGreat, glad it helps, I am going to go ahead and close this ticket, but if you need help on this or something else please post a new ticket.
Thanks!
-
AuthorPosts
- The topic ‘How to edit the submit an event form’ is closed to new replies.