Support

Home Forums Event Espresso Premium Need help using the function to change text

Need help using the function to change text

Posted: February 10, 2017 at 12:53 pm

Viewing 4 reply threads


anotheropus

February 10, 2017 at 12:53 pm

Hello,

RE: https://eventespresso.com/topic/how-can-i-change-the-button-text-view-details-to-be-buy-tickets/#post-228899

I finally have time to tackle this, and I’m uncertain how to change that function so that it will modify the text “View Details” to be “Buy Tickets”.

The function you shared in that thread changes registration text.

https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#custom-function

I can hack code, but not write it, so I don’t know what to change in that function.

Can you share the snippets of that function to modify the text “View Details” to be “Buy Tickets”?

Thank you for the help.

Chris


Josh

  • Support Staff

February 10, 2017 at 1:51 pm

Hi Chris,

You change the array of original strings and what they should be replaced with. So in that example code you’ll see an array of strings that start on line 9 and end on line 12. Your array of strings will include:

'View Details' => 'Buy Tickets',

and you can add more to that array, just like the example has more than one set of strings to change.


anotheropus

February 10, 2017 at 5:47 pm

Thank you Josh!

It worked well.


anotheropus

February 11, 2017 at 6:09 am

Hello,

I saw that there are other text changes in this script, so I tried to change the text of another button and it failed.

After a person clicks the Buy Tickets button, the Add to Event Cart button appears.

I tried to change the text of this Add to Event Cart button and it fails.



// This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'View Details' => 'Buy Tickets',
        'Add to Event Cart' => 'Add Tickets to Cart',
        // Add some more strings here
    );

Can you help me understand what I’m missing?

Thank you,

Chris


Lorenzo Orlando Caum

  • Support Staff

February 13, 2017 at 6:18 am

Hi Chris,

Here is a tip to help you with the source messaging / text.

You can search GlotPress for a couple of the starting words in a phrase and it will return matches:

https://translate.eventespresso.com/projects/event-espresso-4/en/event-espresso-en_US?filters%5Bterm%5D=add+to&filters%5Buser_login%5D=&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filter=Filter&sort%5Bby%5D=translation&sort%5Bhow%5D=asc

The source text that you are looking for is:

Add to %s


Lorenzo

Viewing 4 reply threads

The support post ‘Need help using the function to change text’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso