Support

Home Forums Event Espresso Premium Change Button Value "Confirm and go to payment page"

Change Button Value "Confirm and go to payment page"

Posted: June 19, 2013 at 12:13 pm


Cody Martens

June 19, 2013 at 12:13 pm

Is there a way to change the button text in the shopping cart without modifying the includes/cart.php file directly?


Josh

  • Support Staff

June 19, 2013 at 1:38 pm

Yes. You can add something like this to your theme’s functions.php file or if you have the custom files add-on’s custom_functions.php file uploaded to your /wp-content/uploads/espresso/ directory, you could copy/paste it in there too:

function mycustom_filter_gettext( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'Confirm and go to payment page' => 'Complete registration',
        // Add some more strings here
    );
 
    // See if the current string is in the $strings array
    // If so, replace it's 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 );

The support post ‘Change Button Value "Confirm and go to payment page"’ 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