Support

Home Forums Multiple Event Registration Add-on How can I force a refresh of the cart when an event is deleted

How can I force a refresh of the cart when an event is deleted

Posted: January 25, 2013 at 4:13 pm


Byron

January 25, 2013 at 4:13 pm

I am customizing the shopping_cart.php template to add instructions for users. I am also dynamically adding links (using do_shortcode) to suggest they add related events to their cart,(if the event is not already in the cart) by checking the $results array when the shopping_cart.php is called.

All that is working, except, when they remove a related event from the cart, the section for that event collapses. However, since I am checking for the event ids that are loaded when the shopping_cart.php is first loaded (or refreshed), my link to add the related event that was just removed does not display.

So, if someone accidentally deletes an event and wants to add it back, the link is not displayed because the shopping_cart.php is not called again, the section for that event simply collapses form the form.

So i need to either force a refresh of the page when they delete an event, or somehow hook into the “delete from cart” code to add the “add to cart” link back. Where should I look to find that code?

Any help would be greatly appreciated. Trying to launch this in a couple of days and this is my last sticking point.

Thanks.


Josh

  • Support Staff

January 25, 2013 at 5:15 pm

Hi Byron,

If you refresh the page, then it will wipe out any quantity selections they’ve made. What you might try is adding some custom JavaScript and bind to event when the delete from cart button is clicked. You could look in espresso_cart_functions.js to find that code. To be honest, I’m not much of a JavaScript developer, so I’m not really able to help much more than that.

The support post ‘How can I force a refresh of the cart when an event is deleted’ 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