Changing the word Ticket on Various pages

Home Forums Ticket Products Event Tickets Plus Changing the word Ticket on Various pages

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1365594
    joffrey
    Participant

    Hello,

    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.

    #1365597
    joffrey
    Participant

    This reply is private.

    #1366167
    Andras
    Keymaster

    Hey 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,
    Andras

    #1366170
    joffrey
    Participant

    Thank 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.

    #1366192
    Andras
    Keymaster

    Hey 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$s

    would become something like

    Order #%1$s: Auditions reserved by %3$s (%4$s) on %5$s

    and My Tickets for This %s

    to My Auditions for This %s

    and Update %s

    to Update Auditions

    As for ‘Ticket ID’ use the full string like Ticket ID and change it to what you need. (No need to open a new thread.)

    Let me know how this all works out.

    Cheers,
    Andras

    #1366207
    joffrey
    Participant

    Ok 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.

    #1366209
    joffrey
    Participant

    This reply is private.

    #1366216
    joffrey
    Participant

    This reply is private.

    #1366217
    joffrey
    Participant

    Sorry 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 );
     
    }
    
    #1366434
    Andras
    Keymaster

    Hey 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,
    Andras

    #1367958
    joffrey
    Participant

    This reply is private.

    #1368680
    Andras
    Keymaster

    This reply is private.

    #1368683
    joffrey
    Participant

    This reply is private.

    #1369074
    Andras
    Keymaster

    This reply is private.

    #1374474
    joffrey
    Participant

    The 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!

Viewing 15 posts - 1 through 15 (of 16 total)
  • The topic ‘Changing the word Ticket on Various pages’ is closed to new replies.