Other Documentations
How to add additional fields at checkout
July 16, 2018
Where do I put this code? — in functions.php file in your theme (recommended) or in any plugin folder index php file.
Code 1: Include new field in settings
1 2 3 4 5 6 |
add_filter('evotx_checkout_additional_fields_settings','evotx_2',10,1); function evotx_2($fields){ $fields['business'] = __('Business Name','evotx'); // you can add other fields like this similarly return $fields; } |
Code 2: Include at checkout stage
1 2 3 4 5 6 7 8 9 10 11 |
add_filter('evotx_additional_ticket_info_fields', 'evotx_1', 10,1); function evotx_1($fields){ // additonal field code block $fields['business'] = array( 'type'=>'text', 'label'=> evo_lang('Business Name'), 'required'=> false, ); // you can use same code block for more fields return $fields; } |
Code 3: Show the save information
1 2 3 4 5 6 7 8 9 10 |
add_filter('evotx_get_attendees_for_event', 'evotx_3',10, 3); function evotx_3($arr, $event_id, $_th){ if(!isset($_th['business'])) return $arr; $arr['oD']['business'] = $_th['business']; // the above 2 lines can be used for all other new fields return $arr; } |
Did this article help you? If not, send us a ticket via helpdesk