Posted: March 24, 2014 at 4:59 pm
I have the multi event addon. I have 1 event with 2 ticket prices for adults and children. When I select 1 adult ticket and 1 child ticket, EE ask for info of adult and also for the child (with a “copy from” option). How can I avoid the questions for the child ticket? I have already set the field extra info for additional reg. set to No info required. |
|
Hello, This is a limitation of the Multi Event Registration Add-on in that each ticket type requires Personal information at least once. We have seen in the past that users have hidden these fields and then used JavaScript to copy over the information from the Primary attendee to work around this limitation. EE4 allows multiple ticket types to be purchased when providing only one single registrant’s information although this will depend on whether or not you need the functionality of the Add-on’s as EE4 currently does not support them. |
|
As long as there is no iDeal payment gateway, EE4 is useless in Holland. Everybody pays by iDeal, the solution of all banks in Holland. Pronamic has built a superb plugin for EE3, which works without any problems. Is there a standard Javascript to make the workaround to copy the info to the second and extra attendees? |
|
Hi Wim, Usually it’s something that they develop custom for their registration form. We provide and support the copy buttons. This is one example of a custom built JavaScript solution that copies the attendee info: https://github.com/sidharrell/eventespresso/blob/master/simplify-mer-attendee-page.js |
|
Sorry to bother you again, but somehow that script doesn’t seem to copy the info to the other attendees when there are 2 different ticket types. Is that possible, or do I do something wrong? Many thanks for your kind co-operation this far. |
|
Is there anyone who might answer this? see http://www.paleisconcerten.nl/overzicht and fill in some figures and click the button and you know what I mean when I want the copy to other attendees automated in a script. |
|
Hi Wim, Event Espresso includes the option to select an attendee you would like to copy the information from http://take.ms/VXsw2 The script Josh provided was to be used as an example, you may need to alter this to to fit your specific registration, although looking at the script it should work. Where/how did you add that script? |
|
I added the script of Josh to the file event-espresso/scripts/espresso_cart_functions.js I added the lines 2-7 of the script in the top of the file, and the rest I used to overwrite lines 374-419. Is that correct, or should I also delete lines 289-366 ? At this moment I reinstalled the old script, because it did not work. The total code of the file is then: if ( ! jQuery('#event_espresso_notifications').hasClass('no-hide') ) { jQuery.ajaxSetup({ var EECART = { progress: function(container){ jQuery(container).html(''); event_espresso_do_ajax( data, function(r){ params.container.html(r.html); }) ; }, delete_item : function(params){ //alert( 'params = ' + params.toSource() ); var _eecart = this; event_espresso_do_ajax( data, function(r){ params.main_container.slideUp('fast', function(){ }).delay(1500).queue(function() { }); }, calculate_total: function(grand_total){ if (grand_total){ var data = "action=event_espresso_calculate_total&" + jQuery("#event_espresso_shopping_cart").serialize(); event_espresso_do_ajax(data,function(r){ }); } }; jQuery('body').on('click', '.ee_add_item_to_cart',function(){ var data = { } EECART.add_item(data); return false; }); jQuery('.ee_delete_item_from_cart').on('click',function(){ var data = { } EECART.delete_item(data); return false; }); jQuery('#event_espresso_refresh_total').click(function(){ EECART.calculate_total() return false; }); jQuery('#event_espresso_checkout_form').submit(function(){ var data = "action=event_espresso_update_item&" + jQuery(this).serialize() //progress(jQuery('#event_total_price')); //return true; }); /*jQuery(this).validate({ submitHandler: function(form) { });*/ jQuery('#event_espresso_shopping_cart').submit(function(e){ //var data = "action=event_espresso_calculate_total&" + jQuery(this).serialize() //progress(jQuery('#event_total_price')); /* var temp_val =0; if (temp_val > 0) //remove all the <options> and reconstruct } } //Couppon codes var me = jQuery(this); if (me.prop('type') == "select-one"){ //only run the code if a select is modified //all selects have an id var num_selected_attendees = 0; //First, find total value of all selected elements. This is required if more than 2 prices are available for the event num_selected_attendees += Number(jQuery(this).val()); }); //find the number of available spaces left //loop through each element again and determine the number of options to give in each. populate_qty_dd(jQuery(this), open_spaces); }); EECART.calculate_total(); }); /* var data = "action=event_espresso_load_regis_form&" + jQuery('#event_espresso_shopping_cart').serialize() progress(jQuery('#event_espresso_multi_regis_form')); //return false; jQuery('#event_espresso_confirm_pay').click(function(){ var data = "action=event_espresso_confirm_and_pay&" + jQuery('#event_espresso_shopping_cart').serialize() progress(jQuery('#temp')); /* var from_attendee_no = '1'; jQuery('.multi_regis_wrapper_attendee-additional .event_form_field :input').each(function(){ var copy_field_name = name.replace(/(\[\d+\])(\[\d+\])(\[\d+\])/,"[" + from_event_id + "][" + from_price_id + "][" + from_attendee_no + "]"); var copy_from = jQuery(":input[name='" + copy_field_name + "']"); switch (input_type) { case 'text': case 'radio': default: } }); }); //Updated in Event Espresso 3.1.31 to suport Jquery 1.9 } function process_response(from_server, callback) if (from_server.code == 1) return; }) |
|
Almost right. Lines 1-7 need to be placed in the multi-registration_page_display.php template. So copy event-espresso/templates/multi_registration_page.php and multi_registration_page_display.php to wp-content/uploads/espresso/templates/ Then in that new location add <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#event_espresso_checkout_form div.multi-reg-page:not(:first)').css('display', 'none'); jQuery('.copy-all-button-wrapper').parent().parent().css('display', 'none') jQuery('.event_questions input').change(function() { jQuery('.copy-all-button').click(); }); }); </script> To the bottom of the page, like this: http://take.ms/e7QMx That will hide the ‘extra’ fields and call the new function we added to espresso_cart_functions.js every time we change the info. |
|
Hello Tony, thank you for your kind reply. I posted the files in github. https://github.com/wibro58/event-espresso.git Would you please be so kind to check if more than 1 price-type per event doesn’t work? |
|
I think the problem is that I work with 2 different prices. Is it possible that the new script does not look if the var from_price_id changes? And that therefore the data for price_type 2 don’t get filled? Thanks for any reply! Wim |
|
In the script I see 2 lines of code concerning price_type: What should I change so that also the data are copied to tickets with another price type? A reply would be more than welcome. Please take a few minutes to check. I would be very grateful if this problem could be solved…. |
|
|
I played around with it on your checkout pages, and it looks like the copy from dropdown is not functioning. I would suggest reverting back to the original version and see if the copy from dropdown is functioning. If it is not, then the cause is probably the same reason the customized copy from script is not working. |
Hello Sidney, With this suggestion you really helped me out!!! I corrected the espresso_cart_functions.js and now the second price type is no longer a problem with all my normal fields. I am very, very grateful for your comment!!! However, I have one problem: When I add a REQUIRED field of type radiobutton or checkbox to the question group suddenly the the automatic copy function does not work. If I make it MANDATORY everything works fine. It seems the radiobutton info is not copied to the other attendees. Is this related to your script, or is this another problem? |
|
|
I did a little debugging on your checkout page, and it looks like I should have put these lines: var id = jQuery(this).attr('name').split('['); var from_event_id = id[1].substring(0, id[1].length -1); var from_price_id = id[2].substring(0, id[2].length -1); up under this line: var from_attendee_no = '1'; otherwise, it’s picking up the event id and price id of the field in the additional attendee form instead of the primary attendee form. |
That small change in lines really did the trick! I am very, very grateful for your kind co-operation to make this thing work. Without you I would have been lost in the big big script world….. Now it works like a horse, we say in Holland. Thanks! |
|
The support post ‘One event, 1 adult and 1 child ticket, multi event asks for information of child’ 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.