Posted: September 25, 2019 at 12:59 pm
|
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. |
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. |
|
|
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 … |
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. |
|
|
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. |
That’s correct. Do you still need help with the following?
|
|
|
Yes, because the PAY (End registration) button still appears even though the registration is free |
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? |
|
|
It is the function proposed on your website |
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 But the function you have created is 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. |
|
|
Thank you. We’re going to try it |
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.