Support

Home Forums Event Espresso Premium Observations and questions about the Wait List manager addon

Observations and questions about the Wait List manager addon

Posted: July 28, 2020 at 10:50 pm

Viewing 9 reply threads


Daniel

July 28, 2020 at 10:50 pm

Hello!

I am using the Wait List manager addon for the first time and I have a few observations to share:

1) The event must be in the Sold Out status. This stumped me for a long time since I created a Private event that (even though I was able to purchase tickets as an admin user) was never moved to the Sold Out status. This lack of Sold out status on the event (even though the registrations and ticket numbers and wait list numbers were lined up correctly) made it so the Wait list button never showed. No Joy. It was only when I published the event and the status got automatically set to Sold Out that the button appeared. Joy.

2) Testing this feature with heavy customizations to the theme = headache. So, if you are testing this, make sure you do a Theme Live Preview with a generic theme in the Customizer. This de-customizes everything all at once. Joy.

3) Now that it is “alive” amidst my heavily customized theme I am seeing the popup window squished and placed in a weird way. It also gets placed off the viewport on mobile. Is it possible to simply customize CSS to move this window so it shows correctly? That would be Joy.

4) After submit of my name and email the popup goes away but I am dropped into the homepage of the site. No Joy. Can I tell the Addon somehow to go to a specific page? Ideally, the system would just return the customer to the page for the event they were just registering for.

5) Can I customize any of the wording of the initial button, the description, the Submit button, the form field labels, the error/validation messages? I need to use specific words for our customers. That would be Joy.

Thank you very much for developing this. I looked at the code base and it is very advanced! Some really good work there keeping everything tight.


Tony

  • Support Staff

July 30, 2020 at 6:22 am

Hi Daniel,

Firstly, thanks for the feedback 🙂

1) The event must be in the Sold Out status. This stumped me for a long time since I created a Private event that (even though I was able to purchase tickets as an admin user) was never moved to the Sold Out status. This lack of Sold out status on the event (even though the registrations and ticket numbers and wait list numbers were lined up correctly) made it so the Wait list button never showed. No Joy. It was only when I published the event and the status got automatically set to Sold Out that the button appeared. Joy.

I can reproduce this and have created a ticket to investigate further.

2) Testing this feature with heavy customizations to the theme = headache. So, if you are testing this, make sure you do a Theme Live Preview with a generic theme in the Customizer. This de-customizes everything all at once. Joy.

This is a good heads up for other users but unfortunately, there isn’t much we can do to prevent this as the front end output is heavily dependant on the theme in use.

3) Now that it is “alive” amidst my heavily customized theme I am seeing the popup window squished and placed in a weird way. It also gets placed off the viewport on mobile. Is it possible to simply customize CSS to move this window so it shows correctly? That would be Joy.

It depends on what is happening, can you link me to an event I can view this on?
(Note you can set your reply to private so only EE staff can view the link)

4) After submit of my name and email the popup goes away but I am dropped into the homepage of the site. No Joy. Can I tell the Addon somehow to go to a specific page? Ideally, the system would just return the customer to the page for the event they were just registering for.

The default behaviour is to link back to the page you added the waitlist registration form using the HTTP_REFERER value.

Which PHP version are you running on?

The add-on uses filter_input(INPUT_SERVER, 'HTTP_REFERER') which it turns out can return nothing on PHP5.4 or older.

5) Can I customize any of the wording of the initial button, the description, the Submit button, the form field labels, the error/validation messages? I need to use specific words for our customers. That would be Joy.

The form itself is passed through a filter:

FHEE__EventEspresso_WaitList_domain_services_forms_WaitListForm__waitListFormOptions__form_options

You can change a lot through there, or, pretty much every string in Event Espresso is passed through some form of translation function so you could translate them.


Daniel

July 30, 2020 at 12:25 pm

Hi Tony!

Thanks for the notes.

1,2,3, and 5 are good to go (I haven’t tried the filter suggested, but I think I can use the filter to get the changes I need).

But #4 is confusing me. I am on PHP 7.4.4. I don’t see any log messages so the ‘catch’ is not running. But what about AJAX? That code just seems to exit() – which might cause the behavior of redirecting to the homepage of the site.

Let me know if you see anything odd about the logic there.

Here is the code I see handling the redirect:


/**
     * process_wait_list_form_for_event
     *
     * @throws Exception
     */
    public static function process_wait_list_form_for_event()
    {
        /** @var EventEspresso\core\services\request\RequestInterface $request */
        $request = LoaderFactory::getLoader()->getShared('EventEspresso\core\services\request\RequestInterface');
        $event_id        = absint($request->getMatch('event-wait-list-*[event_id]', 0));
        $redirect_params = array();
        try {
            $redirect_params = EED_Wait_Lists::getWaitListMonitor()->processWaitListFormForEvent($event_id);
        } catch (Exception $e) {
            EED_Wait_Lists::handleException($e, __FILE__, __FUNCTION__, __LINE__);
        }
        // todo submit form via AJAX and process return here
        if (defined('DOING_AJAX') && DOING_AJAX) {
            exit();
        }
        EEH_URL::safeRedirectAndExit(
            add_query_arg(
                $redirect_params,
                trailingslashit(
                    filter_input(INPUT_SERVER, 'HTTP_REFERER')
                )
            )
        );
    }


Tony

  • Support Staff

July 30, 2020 at 2:15 pm

We don’t process the waitlist submission using Ajax so it’s expected that it would just exit there, the above code looks fine.

You could try writing filter_input(INPUT_SERVER, 'HTTP_REFERER'); to a log file right before the call to EEH_URL::safeRedirectAndExit() to confirm it has a value as that seems to be the most likely issue.

Or try using:

filter_var( $_SERVER['HTTP_REFERER'], FILTER_SANITIZE_STRING )

In place of:

filter_input(INPUT_SERVER, 'HTTP_REFERER')

and see if that works better with your set up.


Daniel

July 30, 2020 at 2:24 pm


EEH_URL::safeRedirectAndExit(
            add_query_arg(
                $redirect_params,
                trailingslashit(
                    // filter_input(INPUT_SERVER, 'HTTP_REFERER')
                    filter_var( $_SERVER['HTTP_REFERER'], FILTER_SANITIZE_STRING )
                )
            )
        );

That worked! Thank you for the support.

I’d love to be able to put some kind of message inline on the event page to let them know the form submission went well. I know they get an email but that can take time to arrive.

Is there any way I can add something to the page post submit?

D


Tony

  • Support Staff

July 30, 2020 at 3:45 pm

There’s already a message displayed when a registration is added to the watlist:

https://monosnap.com/file/nlSYK8sxJID078BcdrDk5del3JQAxl

Do you not see that on your site?


Daniel

July 30, 2020 at 3:59 pm

Aha!
I do see it now but I’d like to make any (or all) of these changes to that functionality:

1) It should stay up longer – it disappears in about 7 seconds
2) It should be “embeddable” in a div somewhere like a validation message on a form field
3) It should be style-able (it disappears too fast for me to get the DOM to modify!)

Thanks!


Tony

  • Support Staff

July 31, 2020 at 3:36 am

1) It should stay up longer – it disappears in about 7 seconds

You’ll need to add your own code to change this, ee uses a fade-away class which calls slideUp() after a 10 second delay. So you could use your own jQuery to remove that class and then manage hiding the notices with your own JS.

2) It should be “embeddable” in a div somewhere like a validation message on a form field

The wrappers for EE notices is injects to the top of the content on all pages it needs to be on, then we inject content into those wrappers on the fly. If we embedded them on the page they in the way I think you mean they need to then be hidden anyway.

However, again you can change this if you wish.

3) It should be style-able (it disappears too fast for me to get the DOM to modify!)

??? It’s still in DOM so I don’t follow.

After submitting a waitlist registration, on the page that displays/displayed the notice just open up Chrome Dev Tools (or similar) and search in the elements tab for ‘You have been successfully added to the Wait List’ (or part of that string) and you’ll find the elements there.

Or, the parent element that all of the EE notices are added into is #espresso-notices, if you search for that you’ll find a #espresso-notices-success element, which holds the success notices (when there are any)


Daniel

July 31, 2020 at 7:46 am

Hi Tony!

Thank you for the notes about how to customize. This is very helpful.

Just two more questions…

1) You previously indicated that the form elements are customizable and gave several ways to accomplish this. What about this completion message? Is this success message able to be customized? Is there a separate hook or is it this one also?


FHEE__EventEspresso_WaitList_domain_services_forms_WaitListForm__waitListFormOptions__form_options

2) Will EE have a patch for the HTTP_REFERER update that fixed my redirect issue? I would like to avoid maintaining this modification in the EE core addon.

Thank you!
Cheers,
D


Tony

  • Support Staff

July 31, 2020 at 10:22 am

1) You previously indicated that the form elements are customizable and gave several ways to accomplish this. What about this completion message? Is this success message able to be customized? Is there a separate hook or is it this one also?

Whilst I don’t have any issues with letting you know where to find these, you’d likely be quicker searching the codebase (as I know you are already more than capable) as that’s pretty much all I’m doing.

EE uses place holders within its strings so its not always as easy as just searching for a full string but in this case I searched for ‘You have been ‘ in Sublime text:

https://monosnap.com/file/krTJEq780ZXTCQnoRxSSzok3mhHEJF

So in CreateWaitListRegistrationsCommandHandler.php:

https://monosnap.com/file/mX6F87T8diZZfLaOas20tz6SSYeqRu

So yeah, that text is filter and translatable, the filter is ‘quicker’ so FHEE_EventEspresso_WaitList_WaitListMonitor__processWaitListFormForEvent__success_msg allows you to change the text.

2) Will EE have a patch for the HTTP_REFERER update that fixed my redirect issue? I would like to avoid maintaining this modification in the EE core addon.

Most likely yes, although maybe not exactly the same one you are using now.

Viewing 9 reply threads

The support post ‘Observations and questions about the Wait List manager addon’ 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