Custom line item fields in Create an Order page I have successfully added the custom line item fields in the cart through Views and modified the new total using a hook, but how do I do the same thing in Create an Order page (admin/commerce/orders/add)?


The custom line item field was added in
admin/commerce/config/line-items/product/fields
I'm using inline
entity form and I can see the custom field, but the custom field is
not visible in line items table.
Sounds like you just need to alter the commerce_line_item_table View. Edit this view and add your fields so that they show up when it is embedded when the line item reference field formatter is used.

You'll want to take some extra steps, however, to save your customizations since that view is provided by the module. I would clone that view and update your field formatter's to use that view (it's customizable from the display options!)

Or, implement hook_views_default_views_alter and completely override the view with your own export.

EDIT: Some info on the line item manager widget

In order to get fields to show up in the line item manager widget table, you're going to need to override the widget's theme function. See commerce_line_item_field_widget_form and theme_commerce_line_item_manager.

Essentially you may need to invoke hook_field_widget_form_alter to added your field's value, and then override theme_commerce_line_item_manager to place it properly.

Snippet of a theme override that could be used, to add length

// Add each line item to the table.
foreach (element_children($form['line_items']) as $line_item_id) {
  $row = array(
    drupal_render($form['line_items'][$line_item_id]['remove']),
    drupal_render($form['line_items'][$line_item_id]['title']),
    drupal_render($form['line_items'][$line_item_id]['length']),
    drupal_render($form['line_items'][$line_item_id]['line_item_label']),
    drupal_render($form['line_items'][$line_item_id]['commerce_unit_price']),
    drupal_render($form['line_items'][$line_item_id]['quantity']),
    drupal_render($form['line_items'][$line_item_id]['commerce_total']),
  );

  $rows[] = $row;
}