test query

fetchAll();
print_r($result[0]->order_id);
$order = commerce_order_load($result[0]->order_id);
foreach ($order->commerce_line_items[‘und’] as $line) {
$line_item = commerce_line_item_load($line[‘line_item_id’]);
$product_id = $line_item->commerce_product[‘und’][0][‘product_id’];
}
//Load first product from order line item and fetch author uid
$product_item = commerce_product_load($product_id);
$project = node_load($product_item->field_project[‘und’][0][‘target_id’]);

print_r($project->title);

Scroll to top