Home › Forums › Ticket Products › Event Tickets Plus › Changing the word Ticket on Various pages
- This topic has 16 replies, 2 voices, and was last updated 8 years, 5 months ago by
joffrey.
-
AuthorPosts
-
October 18, 2017 at 12:00 pm #1365594
joffrey
ParticipantHello,
I’ve been looking through various threads for a solution and it is not working for me. I need to change the word Ticket on various of pages, email notifications and even order details.
I have used the extension you provided here: https://theeventscalendar.com/extensions/add-event-and-attendee-information-to-woocommerce-order-details/ to showcase my attendee data on order details and email notifications.
The above works great and I manage to change the attendee ticket_id from attendee product_id to ticket_id so it captures the right data i want to display. However I am trying to change the title “Ticket ID” to “Something Else ID”
I will also include screenshots to show the different areas I’ve found the word Tickets/ticket showing up.
I tried to use this code but it didn’t work.
function tribe_custom_theme_text ( $translation, $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 // This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events" $custom_text = array( 'Ticket' => 'Audition', ); // If this text domain starts with "tribe-", "the-events-", or "event-" and we have replacement text if( (strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) && array_key_exists($translation, $custom_text) ) { $translation = $custom_text[$translation]; } return $translation; } add_filter('gettext', 'tribe_custom_theme_text', 20, 3);Please advise.
October 18, 2017 at 12:01 pm #1365597joffrey
ParticipantThis reply is private.
October 19, 2017 at 2:02 pm #1366167Andras
KeymasterHey Joffrey,
Thanks for reaching out! Let me try to help you with this one.
The snippet you shared should work well is most cases.
Sometimes the strings also have a context with them. If that is the case then you (also) need to use this very similar looking snippet:
https://gist.github.com/andrasguseo/29903a974cb84060957881c17613c278
Also, the string needs to be an exact match, so ‘Ticket’ is different than ‘Tickets’. You will need to add both separately.
So the code would look like this:
$custom_text = array( 'Ticket' => 'Audition', 'Tickets' => 'Auditions', );As an alternative solution for the 2 snippets you can also try a plugin that basically does the same. It’s called Say what?
You can check these if they work for you.
As another alternative you could use template overrides for the files which handle the verbiage you would like to change. You can read more details on template overrides in our Themer’s Guide.
One of those files would be:
wp-content\plugins\event-tickets-plus\src\views\tickets-plus\orders-tickets.php
Let me know if you need further assistance.
Cheers,
AndrasOctober 19, 2017 at 2:08 pm #1366170joffrey
ParticipantThank you! I will give this a try and let you know my outcome.
If I have an issue with also Ticket ID and how it is being called and placed into a third party plugin, can I ask it here or do you suggest I start a new thread.
October 19, 2017 at 2:48 pm #1366192Andras
KeymasterHey Joffrey,
Just got some more info.
You might need to change the whole string where the word is used, not only the ‘Ticket’ word.
For example:
Order #%1$s: %2$s reserved by %3$s (%4$s) on %5$swould become something like
Order #%1$s: Auditions reserved by %3$s (%4$s) on %5$sand
My Tickets for This %sto
My Auditions for This %sand
Update %sto
Update AuditionsAs for ‘Ticket ID’ use the full string like
Ticket IDand change it to what you need. (No need to open a new thread.)Let me know how this all works out.
Cheers,
AndrasOctober 19, 2017 at 3:30 pm #1366207joffrey
ParticipantOk I will give this a try.
—
New question:
I am using WooCommerce PDF Invoices: https://wordpress.org/plugins/woocommerce-pdf-invoices/ to auto send our invoices/receipt to our Customer.With the Tribe Extension:https://theeventscalendar.com/extensions/add-event-and-attendee-information-to-woocommerce-order-details/ It also showcase my attendee data on this PDF. I will attach a sample.
My goal is to then repeat or re”call” the info for each product per event and showcase the ticket_id after the invoice total. Via CSS i will then create a look that will allow my customers to see the ticket id and print it. If you take a look at the screen shots, I’d like the second screenshot to be generated as well.
WooCommerce PDF Invoices has told me that I can grab meta keys from third party plugin such as yours using this code below. Replace {META_KEY} with the actual key.
<?php echo BEWPI()->templater()->get_meta( '{META_KEY}' ); ?>I’ve tried the following but it doesn’t work.
The below I’ve placed where I want the data to show up (body.php) of the plugin file.<?php $ticketIds = jbs_get_woo_tickets_ids($order->id); foreach ($ticketIds as $ticketId) { echo $ticketId; } ?>I also used theis on my child fucntions.php file:
<?php $ticketIds = jbs_get_woo_tickets_ids($order->id); foreach ($ticketIds as $ticketId) { echo $order->id; }But it doesn’t pull any data. I’m assuming I’m missing something because with retaining the code in functions.php and placing the following code on body.php it does generate the order number so I know its echo-ing it right, but I need to display the ticket_id data as well.
<?php echo $order->id; ?>The Ticket ID is the unique id that gets generated in a numbering system with the abbreviation of the event name per your plugins specs.
Please let me know if all of this makes sense.
October 19, 2017 at 3:32 pm #1366209joffrey
ParticipantThis reply is private.
October 19, 2017 at 3:39 pm #1366216joffrey
ParticipantThis reply is private.
October 19, 2017 at 3:41 pm #1366217joffrey
ParticipantSorry I meant to say I placed this on my functions.php file
/* Tribe, retrive Woo tickets ids for a give post_id - returns array or false if event tickets plus is not active */ function jbs_get_woo_tickets_ids ( $post_id ) { // bail if event tickets plus is not active if ( !class_exists('Tribe__Tickets_Plus__Commerce__WooCommerce__Main') ) return false; $tickets_provider = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); return $tickets_provider->get_tickets_ids ( $post_id ); }October 20, 2017 at 5:40 am #1366434Andras
KeymasterHey Joffrey,
Let me know how the string replacement works out.
As for your other question, please note that we are limited in doing and supporting customizations, especially ones with third party plugins.
I will ask the team if anyone has an idea about the above. It might take a couple of days as we are heavily overloaded at the moment. I ask for your kind patience on this.
If you need help faster, then I can share with you a list of independent developers from the community, who are not affiliated with us. They should be able to help you out.
Cheers,
AndrasOctober 24, 2017 at 4:11 am #1367958joffrey
ParticipantThis reply is private.
October 25, 2017 at 9:03 am #1368680Andras
KeymasterThis reply is private.
October 25, 2017 at 9:13 am #1368683joffrey
ParticipantThis reply is private.
October 26, 2017 at 4:20 am #1369074Andras
KeymasterThis reply is private.
November 3, 2017 at 2:41 am #1374474joffrey
ParticipantThe code provided helped us point to the right direction, we managed to generate the data using our own custom id that I’ve mentioned in another post as well.
Thanks for the help Andras!
-
AuthorPosts
- The topic ‘Changing the word Ticket on Various pages’ is closed to new replies.
