How to render a field collection? How can I properly render a field collection ? Is there any specific function for that ? I tried field_view_field but it does not output children fields. 

My field collection is attached to a line item entity, and I want to display it in a Commerce checkout pane review. 

function mymodule_pane_review($form, $form_state, $checkout_pane, $order) {
  //loading line item
  $line_item = commerce_line_item_load($order-&gt;commerce_line_items['und'][0]['line_item_id']);
  //loading field_collection from its id
  $paxsup = entity_load('field_collection_item', array($line_item-&gt;field_paxsup['und'][0]['value']));

  return drupal_render(field_attach_view('field_collection_item',$paxsup, 'full'));
}


but get an error EntityMalformedException: Missing bundle property on entity of type field_collection_item

EDIT : I got a step forward, with the use either of 

$paxsups = entity_load('field_collection_item', array($line_item-&gt;field_paxsup['und'][0]['value']));
$paxsup = end($paxsups);
//or shortcut, as per Marcvangend
$paxsup = field_collection_field_get_entity($line_item-&gt;field_paxsup['und'][0]);


dsm($paxsup) now returns



So I can output a child field with 

$view = field_view_field('field_collection_item', $paxsup, 'field_paxsup_civilite', $display);
return drupal_render($view);


EDIT 2: I ended chaining #markup

$display = array('label' =&gt; 'hidden');
$cv = field_view_field('field_collection_item', $paxsup, 'field_paxsup_civilite', $display);
$nom = field_view_field('field_collection_item', $paxsup, 'field_paxsup_nom', $display);
$prenom = field_view_field('field_collection_item', $paxsup, 'field_paxsup_prenom', $display);
$date = field_view_field('field_collection_item', $paxsup, 'field_paxsup_datenaiss', $display);
$view .= $cv[0]['#markup'] .' '. $nom[0]['#markup'] .' '. $prenom[0]['#markup'] .t(', né(e) le '). $date[0]['#markup'] ;


But I'm not happy with this "old style" solution, would have preferred to find a more elegant and Drupal way to output that field collection
You may want to have a look how the field_collection module itself renders field collections in the field_collection_field_formatter_view function. I think it's important to note that is uses field_collection_field_get_entity() to load a field collection.

Looking at the code (not tested) I think you can do something like this:

if ($field_collection = field_collection_field_get_entity($line_item-&gt;field_paxsup['und'][0])) {
  return $field_collection-&gt;view('full');
}