Skip to main content
1 of 3
Anil Sagar
  • 12.2k
  • 2
  • 31
  • 54

Yes, Commerce Module does store product amount of past order... You can retrieve using below details...

See below query in views order details which fetches order line item details provided line item id

SELECT commerce_line_item.line_item_id AS line_item_id, commerce_line_item.type AS commerce_line_item_type, commerce_line_item.line_item_label AS commerce_line_item_line_item_label, commerce_line_item.quantity AS commerce_line_item_quantity, commerce_line_item.line_item_id AS commerce_line_item_line_item_id, 'commerce_line_item' AS field_data_commerce_unit_price_commerce_line_item_entity_typ, 'commerce_line_item' AS field_data_commerce_total_commerce_line_item_entity_type
FROM 
{commerce_line_item} commerce_line_item
WHERE (( (commerce_line_item.line_item_id = '1' ) )AND(( (commerce_line_item.type IN  ('product')) )))
ORDER BY commerce_line_item_line_item_id ASC

To get full details of order

$order = commerce_order_load($order_id);
$view_mode = "administrator";
print entity_view('commerce_order', array($order->order_id => $order), $view_mode, NULL, TRUE);
Anil Sagar
  • 12.2k
  • 2
  • 31
  • 54