Support

Home Forums Event Espresso Premium Adding multiple events to Cart – Not working as desired

Adding multiple events to Cart – Not working as desired

Posted: October 1, 2012 at 1:52 pm


rishitejo

October 1, 2012 at 1:52 pm

http://register.nithyananda.ca/uk/events-list/

Basically have a list of events with check boxes User checks all events he is interested in and presses Add Events to Cart

This is the onClick target URL:

http://register.nithyananda.ca/uk/?page_id=4&regevent_action=add_event_to_cart&event_id=“‘+ VALUES_OF_EVENT_IDS + ‘”&name_of_event=

Instead of adding all events to cart (in the format of event ids 1-3-6 etc), it goes to the registration page listing all events

how can this be done?

Thanks!


rishitejo

October 1, 2012 at 2:17 pm

Added to target URL string &

‘http://register.nithyananda.ca/uk/?page_id=4&regevent_action=add_event_to_cart&event_id=’+ c_value + ‘&name_of_event=’;

c_value is computed on_click from the checkbox selection


Seth Shoultes

  • Support Staff

October 1, 2012 at 3:44 pm

If you looks at the page source when using a shortcode like [ESPRESSO_CART_LINK event_id="3-4-5-6" direct_to_cart=1 moving_to_cart="Redirecting to cart..."], it has the classes ee_view_cart and ee_add_item_to_cart and an id of cart_link_3-4-5-6.

You can see that it creates a link like this:
<a class="ee_view_cart ee_add_item_to_cart" id="cart_link_3-4-5-6" href="http://www.espresso-3-1.dev/?page_id=4&regevent_action=add_event_to_cart&event_id=3-4-5-6" moving_to_cart="Redirecting+to+cart..." direct_to_cart="1" rel="nofollow">Add to cart</a>

You might want to add the cart_link_ somehow.

Also, it looks like your url is is outputting &amp; in the url:
http://register.nithyananda.ca/uk/?page_id=4&amp;regevent_action=add_event_to_cart&amp;event_id=1-6&amp;name_of_event=


rishitejo

October 2, 2012 at 9:10 am

Seth, Thanks it is clear.

We are building the URL for the form to submit, and replacing the href (document.form.action=’http://..’) based on event selections as above.
How would you pass the class and id paramters?

Is there any implementation you have done like this?

Thanks for your help!

The support post ‘Adding multiple events to Cart – Not working as desired’ 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