Support

Home Forums Event Espresso Premium Upgrade to v4.6.28 has broken my change to Proceed to Payment options button

Upgrade to v4.6.28 has broken my change to Proceed to Payment options button

Posted: May 24, 2015 at 6:20 pm


Adele Haswell

May 24, 2015 at 6:20 pm

I used the code on this page – http://eventespresso.com/wiki/customize-checkout-registration-button-text/ to change the text on the Proceed to Payment button but now it isn’t working anymore. The second function to change Payment Options to something else is no longer working.


Lorenzo Orlando Caum

  • Support Staff

May 25, 2015 at 9:26 am

Hi Adele, could you try this updated code snippet?

function ee_proceed_to_button() {
 return 'Go to';
}

add_filter ('FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_proceed_to_button');

function ee_payment_options_button( $translated, $original, $domain ) {
$strings = array(
 'Payment%sOptions' => ' Payment Processing'
 );
if ( isset( $strings[$original] ) ) {
 $translations = &get_translations_for_domain( $domain );
 $translated = $translations->translate( $strings[$original] );
 }
return $translated;
}

add_filter( 'gettext', 'ee_payment_options_button', 10, 3 );


Lorenzo


Adele Haswell

May 25, 2015 at 9:30 pm

Hi Lorenzo,
I have put the updated code in there and it replaces the text with “Go To” or whatever I put here
function ee_proceed_to_button() {
return ‘Go to’;
}


Lorenzo Orlando Caum

  • Support Staff

May 26, 2015 at 9:11 am

Hi, could you share what the button text should be changed to?


Lorenzo


Adele Haswell

May 26, 2015 at 7:27 pm

Hi Lorenzo,

I have managed to change the text to Confirm Registration by just using the top part of the code that you provided:
function ee_proceed_to_button() {
return ‘Confirm Registration’;
}

It does remove the Payment Options text but doesn’t put the text next to it in there.
function ee_payment_options_button( $translated, $original, $domain ) {
$strings = array(
‘Payment%sOptions’ => ‘ Payment Processing’
);


Lorenzo Orlando Caum

  • Support Staff

May 27, 2015 at 6:47 pm

Hi Adele,

Could you give this updated version a try? It should replace any existing code snippets for changing the button code including the old examples in the tutorial page:

function espresso_filter_spco_submit_button_text( $submit_button_text, EE_Checkout $checkout ) {
    if ( ! $checkout instanceof EE_Checkout || ! $checkout->current_step instanceof EE_SPCO_Reg_Step || ! $checkout->next_step instanceof EE_SPCO_Reg_Step ) {
        return $submit_button_text;
    }

    // $checkout->revisit - whether this is the first time thru SPCO or not : false = first visit, true = return visit (ie repay or edit)
    // details for the CURRENT SPCO Reg Step
    // $checkout->current_step->slug();  ex: 'attendee_information', 'payment_options', 'finalize_registration'
    // $checkout->current_step->name();
    // details for the NEXT SPCO Reg Step that follows the CURRENT SPCO Reg Step
    // $checkout->next_step->slug();
    // $checkout->next_step->name();

    if ( $checkout->next_step->slug() == 'finalize_registration' ) {
        $submit_button_text = __( 'Complete Registration', 'event_espresso' );
    } else if ( $checkout->current_step->slug() == 'attendee_information' && $checkout->revisit ) {
        $submit_button_text = sprintf( __( 'Welcome back. Proceed to %1$s', 'event_espresso' ), $checkout->next_step->name() );
    } else if ( $checkout->current_step->slug() == 'attendee_information' ) {
        $submit_button_text = sprintf( __( 'Proceed to Payment Options', 'event_espresso' ), $checkout->next_step->name() );
    } else {
        $submit_button_text = sprintf( __( 'Finished with %1$s? Go to %2$s', 'event_espresso' ), $checkout->current_step->name(), $checkout->next_step->name() );
    }
    return $submit_button_text;
}
add_filter( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'espresso_filter_spco_submit_button_text', 10, 2 );

Let us know if this helps!


Lorenzo


Lorenzo Orlando Caum

  • Support Staff

June 9, 2015 at 5:05 pm

Hello, did this updated example work for you?

https://eventespresso.com/topic/upgrade-to-v4-6-28-has-broken-my-change-to-proceed-to-payment-options-button/#post-158294


Lorenzo


Adele Haswell

June 12, 2015 at 7:29 pm

Hi Lorenzo,

This appears to be working.

Thanks

The support post ‘Upgrade to v4.6.28 has broken my change to Proceed to Payment options button’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Adele Haswell 4 years ago ago

Topic Tags

Notifications

This topic is:
pending
Do NOT follow this link or you will be banned from the site!