// Add the branch selection dropdown to the checkout page add_action('woocommerce_after_order_notes','add_branch_selection_field');function add_branch_selection_field($checkout){echo '' . __('Branch Selection') . '';woocommerce_form_field('branch',array('type'=>'select','class'=>array('branch-selection-field form-row-wide'),'label'=>__('Select your branch'),'required'=>true,'options'=>array(''=>__('Please select a branch'),'brooklyn'=>__('Brooklyn'),'honeydew'=>__('Honeydew'),'centurion'=>__('Centurion'),),),$checkout->get_value('branch'));echo ''}// Save the branch selection to the order metadata add_action('woocommerce_checkout_update_order_meta','save_branch_selection_field');function save_branch_selection_field($order_id){if (!empty($_POST['branch'])){update_post_meta($order_id,'Branch',sanitize_text_field($_POST['branch']))}}// Display the branch selection in the order details add_action('woocommerce_admin_order_data_after_billing_address','display_branch_selection_in_admin_order_meta',10,1);function display_branch_selection_in_admin_order_meta($order){echo '' . __('Branch') . ': ' . get_post_meta($order->get_id(),'Branch',true) . ''}.book-online-consultation .form-row{margin-bottom:15px}.book-online-consultation .form-field{width:80%;padding:10px;margin-bottom:10px;box-sizing:border-box}.book-online-consultation .h2{margin-top:25px;margin-bottom:15px}.book-online-consultation .label{display:block;margin-bottom:5px}.book-online-consultation .required{color:red}.book-online-consultation .sub-field{margin-left:20px}