
Copy and paste the code in functions.php of your current theme.
remove_action( 'wpcfe_assign_form_content', 'wpcfe_assign_client_callback', 10, 1 ); remove_action( 'wpcfe_bulk_assign_form_content', 'wpcfe_assign_client_callback', 10, 1 );
How to make assign agent field required
Copy and paste the code in functions.php of your current theme.
function wpcfe_assign_agent_custom_callback( $shipment_id ){
$wpcargo_agent = wpcfe_get_users('cargo_agent');
if( can_wpcfe_assign_agent() ): ?>
<div class="form-group">
<div class="select-no-margin">
<label><?php esc_html_e('Agent','wpcargo-frontend-manager'); ?></label>
<select name="agent_fields" class="mdb-select mt-0 form-control browser-default" id="agent_fields" required = 'required'>
<option value=""><?php esc_html_e('-- Select Agent --','wpcargo-frontend-manager'); ?></option>
<?php if( !empty( $wpcargo_agent ) ): ?>
<?php foreach( $wpcargo_agent as $agentID => $agentName ): ?>
<option value="<?php echo $agentID; ?>" <?php selected( get_post_meta( $shipment_id, 'agent_fields', TRUE ), $agentID ); ?>><?php echo $agentName; ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
<?php endif;
}
remove_action( 'wpcfe_assign_form_content', 'wpcfe_assign_agent_callback', 10, 1 );
remove_action( 'wpcfe_bulk_assign_form_content', 'wpcfe_assign_agent_callback', 10, 1 );
add_action( 'wpcfe_assign_form_content', 'wpcfe_assign_agent_custom_callback', 10, 1 );
add_action( 'wpcfe_bulk_assign_form_content', 'wpcfe_assign_agent_custom_callback', 10, 1 );