Support

Home Forums Event Espresso Premium Customizing Button text and return to calendar instead of events list

Customizing Button text and return to calendar instead of events list

Posted: October 15, 2015 at 8:14 pm

Viewing 1 reply thread


denise

October 15, 2015 at 8:14 pm

For the following buttons, how could I customize the text/page it goes to:

Could you share the button customization code for changing the text of the “Proceed to Registration” button?

For the “RETURN TO EVENTS LIST” button text there is this override code:
function ee_my_custom_return_to_events() {
return ‘Custom text to return to events’;
}
add_filter( ‘FHEE__EED_Multi_Event_Registration__return_to_events_list_btn_txt’, ‘ee_my_custom_return_to_events’ );

Can I change the link this button goes to? I would rather return back to the full calendar which is easier to read.


Tony

  • Support Staff

October 16, 2015 at 4:09 am

Hi Denise,

Just to confirm, do you mean ‘Proceed to Payment Options’?

If so you’ll need to use something like this:

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 );

Then change this line:

 $submit_button_text = sprintf( __( 'Proceed to Payment Options', 'event_espresso' ), $checkout->next_step->name() );

To use the phrasing you prefer.

Can I change the link this button goes to?

Not currently. There is no filter available to change that link but I will check in with the developers to see if there is another way to change it.

Viewing 1 reply thread

The support post ‘Customizing Button text and return to calendar instead of events list’ 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