Posted: February 14, 2017 at 8:36 am
|
Hi there. I’m auto-loading events into the cart using [ESPRESSO_CART_LINK event_id=”5-8-9″ anchor=’CLICK HERE’ direct_to_cart=1 moving_to_cart=’Loading Registration …’] The list of events that generates in the cart allows you to specify “0” as the number of each one if you want, but when you click on the registration button it throws up an error that says you must also DELETE those “0” events. I’m actually auto-loading some 40 events, and going through to delete half of those is a chore. Is there any way to disable the error? And if I disable it, will that mess things up on the back end? For example, will there be a bunch of “0” events appearing in the attendee lists on the back end, or something? Thanks! |
Hi there, Currently its not possible to disable that error, the events with 0 tickets would need to be manually removed from the cart for the registration to continue. Another option would be to use the Event Table template to output a list of events which allows your users to select the events they actually want to add and then continue to the cart rather than adding them all and removing the events they don’t want. Would that work? This is the events table: https://eventespresso.com/wiki/events-table-view-template-add-on/ It include a Register and ‘Add to cart’ link for each event shown. |
|
|
I’m thinking about implementing an onclick function on the submit button that will delete the “0” items automatically. I think that will bypass the error. Thanks for the suggestion, though! 🙂 |
How comfortable are you with PHP? I did a little more digging into this and the function that controls the output of that page is pluggable which basically means you can override the original function with your own custom version. So what you can do is copy the We can’t provide support for customizations but if you take a look at the function called when the delete icon is click you should be able to figure out what you need to do based on that. |
|
|
Hi there. If I delete the following code, it seems to work the way that I want, WITHOUT even adding code to actually delete the “0” items automatically. Original behavior: Throws up an error for each item with “0” attendees in the cart. Modified behavior: It goes straight to the payment page with no error. Furthermore, there are no “0” events listed in the payment overview there. And if I check the back end after registering, there are no weird “0” events listed as attendees or anything. So, my question is, would I be messing up anything on the back end by just removing the error code below? wp-content/plugins/event-espresso/includes/functions/cart.php
|
Did you follow the steps I posted above to override that function? Modifying the core function within EE is not something we can support.
It shouldn’t, but its not something we support so you would need to fully test this to confirm as your modifying the code. Although EE is not saving those additional events they are within the session during the checkout so the potential to cause issues is still there. I’d recommend removing them from the session rather than just removing that code. Something like: unset( $_SESSION['espresso_session']['events_in_session'][$event_id] ); $show_checkout_button = true; |
|
The support post ‘Delete Required for "0" Events’ 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.