Support

Home Forums Event Espresso Premium How do I change Stripe's accepted_message?

How do I change Stripe's accepted_message?

Posted: July 15, 2016 at 11:24 am

Viewing 4 reply threads


MoDiva

July 15, 2016 at 11:24 am

Hi, is there a way to change Stripe’s accepted_message from within my child theme’s function.php file instead of from within EE_PMT_Stripe_Onsite.pm.php (the message on line 224) so my changes don’t get lost when I update that plugin?

Thank you!


Lorenzo Orlando Caum

  • Support Staff

July 15, 2016 at 12:14 pm

Hello,

That string is translation ready:

‘Payment Accepted. Please click “Proceed to Finalize Registration” if not forwarded automatically.’, ‘event_espresso’

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


Lorenzo


MoDiva

July 15, 2016 at 12:57 pm

Thank you for your prompt reply.

I’m looking for a very specific answer. Please tell me exactly what this should say. This is what I tried and obviously it is not working:


function mycustom_filter_gettext( $translated, $original, $domain ) {
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        // Add some more strings here
	'accepted_message' => 'Payment Accepted. Please click "View and Print Your Ticketss" if not forwarded automatically.', 'event_espresso' ,
    );
 
    // See if the current string is in the $strings array
    // If so, replace its translation
    if ( isset( $strings[$original] ) ) {
        // This accomplishes the same thing as __()
        // but without running it through the filter again
        $translations = get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
 
    return $translated;
}
 
add_filter( 'gettext', 'mycustom_filter_gettext', 10, 3 ); 

Thank you!


Lorenzo Orlando Caum

  • Support Staff

July 15, 2016 at 1:57 pm

Hello,

Please try this instead:

https://gist.github.com/anonymous/973e0206f6df2d12b40d5e7819151ba4

Adding it to a site specific plugin (https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/) or a child theme’s functions.php file is recommended.


Lorenzo


MoDiva

July 20, 2016 at 5:25 pm

That worked perfectly! Thank you for taking the time to respond so concisely.

Viewing 4 reply threads

The support post ‘How do I change Stripe's accepted_message?’ 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