Support

Home Forums Multiple Event Registration Add-on Zero total price when cart loads

Zero total price when cart loads

Posted: December 30, 2013 at 5:51 pm

Viewing 2 reply threads


Stichting Festival Aangeschoten Wild

December 30, 2013 at 5:51 pm

Hi EventEspresso,

Re-configuring my webshop for next years’ event, I am faced with an old problem. Having a little more time this time, I am having another go at trying to fix it. The situation is as follows:

As I’m selling both tickets and merchandise through the system (as separate events), users buy these products by clicking a link that adds all the available items to the cart. By customizing the event_espresso_multi_qty_dd-function (in /includes/functions/cart.php, current release around ll. 937 – 964), I have configured the dropdown-menu’s to start at one. This prevents people from getting the ‘select number of attendees’-error when they, instead of removing the item from their cart, select 0 attendees. This works fine.

Problem is that when users are redirected to this page (using the ESPRESSO_CART_LINK-shortcode), the grand total at the bottom of the cart shows 0. I would either
a) like to set a default value for that output; or
b) update the value / force a refresh on page load.

The problem is also discussed on the discontinued predecessor to these forums (at https://eventespresso.com/forums/2011/10/total-is-always-zero-in-multi-cart-until-i-click-refresh-cart/), but as these forums are deprecated and I suppose EE has been updated quite a lot since then, I am hereby raising the question again. Help, of course, is much appreciated!

Kind regards,
Bram


Josh

  • Support Staff

December 31, 2013 at 3:41 pm

Hi Bram,

Instead of hacking the function, you can use jQuery to accomplish what you’re looking to do. Here is some example jQuery that can be added to the shopping_cart.php template:

<script>jQuery(document).ready(function(){
    jQuery(".price_id").val(1);
    jQuery('#event_espresso_refresh_total').trigger('click');
});
</script>


Stichting Festival Aangeschoten Wild

January 7, 2014 at 4:19 am

It works perfectly! Thanks for the code!

Viewing 2 reply threads

The support post ‘Zero total price when cart loads’ 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