Support

Home Forums Event Espresso Premium Easier Flow for Multiple Events Registration

Easier Flow for Multiple Events Registration

Posted: April 28, 2018 at 7:34 pm


Jarred

April 28, 2018 at 7:34 pm

Hi guys, I need some help.

We have the plugin for multiple events so when someone choose to add “1” event to the cart the pop-up appears with 3 options:

http://prntscr.com/jbgdzh

1) View event cart
2)proceed to registration
3) return to events list

This is not a good flow at all for visitors that want to enroll in many different events at once BECAUSE the “return to events” button just takes them to a page with the upcoming events.

I need that button that says “return to events” to say something like “add more classes” OR “add more events” AND when they click that button I want them to return to the EXACT same page they were on when they added the event to the cart.

Please advise.

Also, please let me know how to paste my website links on here privately because I don’t like how my support tickets show up in google search and I would rather not have my links be associated with search results for support.

Thanks for any help you can provide.


Jarred

April 28, 2018 at 7:36 pm

Oh, I guess I should add this info to get the best answer.
Our different classes are on their own pages and we just place the shortcode for those class categories.

That’s why I want the button to take them to exact page they were on because when they are enrolling for “Camps” for example, I want them to return to the camps page where they were when they added the first event to the cart. The bulk of traffic is mobile so its way to much work for them to just get back to the “camps” page. Thanks


Josh

  • Support Staff

April 30, 2018 at 3:20 pm

Hi Jarred,

You can change the link text and the link URL for the return to events button by using the filter hooks listed in the documentation’s customization section:

https://eventespresso.com/wiki/ee4-multiple-event-registration-add-on/#customizations

So for example you can add this code to change the URL so they don’t leave the page when they click the return button:

add_filter( 
  'FHEE__EED_Multi_Event_Registration__set_definitions__events_list_url',
  '__return_false' 
);

Then, to change the text:

add_filter(
  'FHEE__EED_Multi_Event_Registration__return_to_events_list_btn_txt',
  function(){return 'Add more';}
);

You can add the above to a functions plugin or into your WordPress theme’s functions.php file. We generally recommend adding code snippets like these to a plugin.


Josh

  • Support Staff

April 30, 2018 at 3:25 pm

With regards to posting private links, I’m afraid the support forums on this website do not have a private link posting feature. If you need to share a link to your site with us, we do have the domain from your activated support key, so maybe what you can do is just include the remainder of the URL.
e.g. if you need to share my.site/url-to-web-page, post only /url-to-web-page


Jarred

April 30, 2018 at 3:51 pm

Hi Josh,
Thank you for those very helpful explanations.

Another question regarding your code.

If I place that exact code, can you please tell me if this sounds correct to you?::

After placing the function, anyone who adds an event to the cart, will then see the MER pop-up, and if they click “Return to Events” (which will now say “Add More”) button, then they will always just land on the page they were already on?

So for example, of they are on the /camps page when the pop-up appears and they click “add more” they will remain on /camps page

Or if they were on the /youth-classes page and the pop up appears they will remain on the /youth-classes page.

Are both of those examples correct assuming I place the exact function you shared?


Josh

  • Support Staff

April 30, 2018 at 4:09 pm

You’ll also need to activate the plugin if the code is added to a plugin, then yes, they’ll be returned whichever page they were on when they clicked the button.


Jarred

April 30, 2018 at 4:23 pm

Can I just add the code to my child them custom.php?


Josh

  • Support Staff

April 30, 2018 at 4:32 pm

That may work, but it may also not work, depending on how that custom.php file is loaded by the theme. If you add the code to the custom.php file and find that nothing has changed, then that’s a good indication the custom.php file is loading too late for the changes to take effect. In which case the plugin will be the more reliable and more organized way to achieve this.


Jarred

May 3, 2018 at 1:04 pm

Hey guys, so the code above does work for them to click “add more” and it reloads to the exact page they were on when they added an event to the cart.

BUT

If they view the MER cart, that button also says “ADD MORE” now and it is just reloading the cart page instead of taking them to events.

http://prntscr.com/jdcszb


Jarred

May 3, 2018 at 1:24 pm

Also, in addition to my most recent question above. I have another issue.

Here is step by step to create it.

1) add “1” event and click “add to event cart”
2) click “add more” to return to the /camps page you were already on
3) notice that the “1”event you just added to cart still says “quantity 0” beside it so they might get confused and try and add another event

So these 2 most recent posts are what I need help with now. Thanks
Is there a way to fix this?


Jarred

May 3, 2018 at 1:31 pm

if it helps, the page that the MER cart is auto added to is /registration-checkout/ and obviously if they click “add more” from that page we want them going back to events


Josh

  • Support Staff

May 3, 2018 at 3:24 pm

You can remove this:

add_filter( 
    'FHEE__EED_Multi_Event_Registration__set_definitions__events_list_url', 
    '__return_false' 
);

and replace with this:

add_filter( 
    'FHEE__EED_Multi_Event_Registration__set_definitions__events_list_url', 
    'my_custom_url_change_for_cart' 
);
function my_custom_url_change_for_cart( $url ) {
    if(isset($_REQUEST['uts'])){
        $url = get_post_type_archive_link( 'espresso_events' );
    } else {
        $url = '';
    }
    return $url;
}

and that will conditionally change the URL for the Add more button depending on whether you’re on the cart page or not.

notice that the “1”event you just added to cart still says “quantity 0” beside it so they might get confused and try and add another event

The 0 you see there is not a count of registrations, it’s actually a quantity selector. So if that gets changed to anything other than a 0 there, it will add more tickets to their cart.


Jarred

May 3, 2018 at 3:34 pm

notice that the “1”event you just added to cart still says “quantity 0” beside it so they might get confused and try and add another event

The 0 you see there is not a count of registrations, it’s actually a quantity selector. So if that gets changed to anything other than a 0 there, it will add more tickets to their cart.

Is there a function or plugin to add that could put a notice beside events sayings something like

“1 ticket in the cart for this event already” or if they had 4 tickets it would dynamically tell them “4 tickets for this event currently in the cart”


Jarred

May 3, 2018 at 3:35 pm

You can remove this:

add_filter(
‘FHEE__EED_Multi_Event_Registration__set_definitions__events_list_url’,
‘__return_false’
);
and replace with this:

add_filter(
‘FHEE__EED_Multi_Event_Registration__set_definitions__events_list_url’,
‘my_custom_url_change_for_cart’
);
function my_custom_url_change_for_cart( $url ) {
if(isset($_REQUEST[‘uts’])){
$url = get_post_type_archive_link( ‘espresso_events’ );
} else {
$url = ”;
}
return $url;
}

and for the new code you showed me above,

Im not supposed to delete EVERYTHING that you had me add yesterday,, INSTEAD Im just supposed to remove the code that you had in the white box underneath “remove this”

and then I add all of the new code you showed me that will be in addition to what you showed me yesterday 🙂 🙂


Jarred

May 3, 2018 at 3:40 pm

So basically to do what I want the final changes to PHP would be this below

//* Change MER popup events button to return to same page
add_filter( 
    'FHEE__EED_Multi_Event_Registration__set_definitions__events_list_url', 
    'my_custom_url_change_for_cart' 
);
function my_custom_url_change_for_cart( $url ) {
    if(isset($_REQUEST['uts'])){
        $url = get_post_type_archive_link( 'espresso_events' );
    } else {
        $url = '';
    }
    return $url;
}
//* Change MER popup events button to add more
add_filter(
  'FHEE__EED_Multi_Event_Registration__return_to_events_list_btn_txt',
  function(){return 'Add more';}
);


Tony

  • Support Staff

May 4, 2018 at 4:30 am

Yes that’s correct, you remove the first block of code from Joshes reply here:

https://eventespresso.com/topic/easier-flow-for-multiple-events-registration/#post-268678

and add the second.

The code you posted above looks correct.

Is there a function or plugin to add that could put a notice beside events sayings something like

“1 ticket in the cart for this event already” or if they had 4 tickets it would dynamically tell them “4 tickets for this event currently in the cart”

You’d need some custom development for that, as far as I am aware we currently don’t have any examples of doing this.

The support post ‘Easier Flow for Multiple Events Registration’ 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  Tony 5 months, 3 weeks ago ago

Topic Tags

Notifications

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