How to get custom line item's custom attribute's value after order complete Using this guide I added a custom line item type to my Drupal Commerce installation and have allowed the customer to add extra data when purchasing an item. When the order is complete I need to get hold of that extra data and use it to build some database rows that will grant them access to the service they have just purchased. I have implemented hook_commerce_checkout_complete($order) but I haven't been able to find the data within $order. I know it is there somewhere because I can view the order on the customer's account and have modified the View to show the data next to Unit price, Quantity and Total columns.
You can use the entity_metadata_wrapper on commerce_order

/**
 * Implements hook_commerce_checkout_complete
 */
function package_designer_commerce_checkout_complete($order) {

  $order_wrapper = entity_metadata_wrapper('commerce_order', $order);
  foreach ($order_wrapper-&gt;commerce_line_items as $line_item_wrapper) {
    if(isset($line_item_wrapper-&gt;field_package_configuration)){
      $package_configuration = $line_item_wrapper-&gt;field_package_configuration-&gt;value();  
      // You can also get the raw value like this:  
      // $package_configuration = $line_item_wrapper-&gt;field_package_configuration-&gt;raw();    
    }
  }

}