Support

Home Forums Event Espresso Premium Modify function ee_finalize_registration_button

Modify function ee_finalize_registration_button

Posted: September 25, 2019 at 12:59 pm

Viewing 10 reply threads


guiapenin

September 25, 2019 at 12:59 pm

We are using the function to replace the text of the End Registration button, and it works correctly, but we would like to know if it is possible to add a variable that only applies if the event name does not contain a specific name, or by the event id.

The problem is because we have people who pay the entrance and others do not, for example, visitors and exhibitors, and since their accreditation is different we use two different events.

Visitors, in the registration form, the CONTINUE button appears and in the next one, in payment options, PAY appears to them.

The exhibitors, having no awarded price, at the end of the registration form, go directly to the end of the registration and the text of the button says PAY what is assigned to the final registration button, and that is the contradiction, since for them registration is free.


Josh

  • Support Staff

September 25, 2019 at 1:22 pm

Hi,

You would not actually need to add a variable to apply to an event name or ID, because the hooks have the data to know whether the next step is a payment step or not. Here’s a link to the documentation that shows examples:

https://eventespresso.com/wiki/customize-checkout-registration-button-text/

If you need further help with making changes to your custom code, please add it to a wpbin or a github gist, then link here, and we can offer some additional guidance.


guiapenin

September 26, 2019 at 1:44 am

As we have said, that function is already implemented, what we do not want is to change the text of the button in all events, only in some …


Josh

  • Support Staff

September 26, 2019 at 7:26 am

If you’d like us to help you with changing that function so it doesn’t show “pay” in the button if it’s a free event, we can help. That’s what EE does by default, but it sounds the function you’ve implemented removes that feature.


guiapenin

September 26, 2019 at 8:58 am

If that is the idea, that in the free events it does not show the text to pay, but that in the other events, those of payment, the function of replacing the text of the button End registration works.


Josh

  • Support Staff

September 26, 2019 at 9:05 am

That’s correct. Do you still need help with the following?

The exhibitors, having no awarded price, at the end of the registration form, go directly to the end of the registration and the text of the button says PAY what is assigned to the final registration button, and that is the contradiction, since for them registration is free.


guiapenin

September 26, 2019 at 1:03 pm

Yes, because the PAY (End registration) button still appears even though the registration is free
How can I change that function so that it does not show “pay” on the button if it is a free event


Josh

  • Support Staff

September 26, 2019 at 1:49 pm

We’ll need to see the function to know where to change it. Can you copy the function into a wpbin.io or github gist?


guiapenin

September 27, 2019 at 1:43 am

It is the function proposed on your website

http://wpbin.io/90n14m


Tony

  • Support Staff

September 27, 2019 at 4:06 am

That function won’t work as-is, it looks like you have a combination of a couple of the functions we have on the page Josh mentioned.

Your callback function on the hook is ee_proceed_to_button (Line 1)

But the function you have created is ee_finalize_registration_button (Line 3)

Something like this should work for you:

https://gist.github.com/Pebblo/3a2a6bc12f73a7aeffcee59ade442370

This is the text used for the button when the cart has any paid tickets within it:

https://gist.github.com/Pebblo/3a2a6bc12f73a7aeffcee59ade442370#file-example-php-L11

This is the text used when the cart total is 0, meaning all of the tickets in the cart are free:

https://gist.github.com/Pebblo/3a2a6bc12f73a7aeffcee59ade442370#file-example-php-L14

You’ll likely want to change those to suit.


guiapenin

September 27, 2019 at 6:36 am

Thank you. We’re going to try it

Viewing 10 reply threads

The support post ‘Modify function ee_finalize_registration_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.

Event Espresso