Support

Home Forums Event Espresso Premium Number of attendees set to 0 by default

Number of attendees set to 0 by default

Posted: January 17, 2014 at 5:26 pm

Viewing 3 reply threads


Matthew Prudente

January 17, 2014 at 5:26 pm

It doesn’t make sense that, when a user has clicked ‘Add to cart’, the quantity for that item is 0 by default when the cart is viewed. How can I change this so it defaults to 1?

Also, because I am only allowing one registration per event, I would like to remove/hide the ‘Attendee 1’ headings that appear on the checkout/registrant details page, as this is superfluous.

Thanks


Sidney Harrell

January 17, 2014 at 5:50 pm

In includes/functions/cart.php change line 1236 to be:

$att_qty = empty($_SESSION['espresso_session']['events_in_session'][$event_id]['price_id'][$result->id]['attendee_quantity']) ? '1' : $_SESSION['espresso_session']['events_in_session'][$event_id]['price_id'][$result->id]['attendee_quantity'];

If you have 2 or more prices on an event, however, then the dropdown for each price will default to 1 as well. That’s why they default to 0.
In the file templates/multi_registration_page.php, comment out line 75:

echo '<h3 class="section-heading">' . __('Attendee ', 'event_espresso') . $attendee_number . '</h3>';


Matthew Prudente

January 20, 2014 at 8:34 am

Thanks, Sidney. This works great… except that when you first view the cart, the total is blank (e.g. ‘Total £’) until/unless you click the ‘Refresh Total’ button. Is there anywhere I can call the javascript EECART.calculate_total() when the cart page is first loaded?


Dean

January 21, 2014 at 4:32 am

Hi Robin,

An alternative would be this thread which uses JavaScript to achieve what you are after https://eventespresso.com/topic/set-minimum-attendees-at-1-not-0-mulitple-registration/

Viewing 3 reply threads

The support post ‘Number of attendees set to 0 by default’ 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