Hi,
I am trying to create a block view for recent sales, however I can't get it working properly. I want to add custom CCK fields such as field_date and field_venue. However I can't get them to display. The only items I can get to show up are $product->title and $product->price.
Here is my code:
<?php
$result = db_query("SELECT * FROM {uc_orders} ORDER BY created DESC LIMIT 5");
while ($order = db_fetch_object($result)) {
$product_result = db_query("SELECT * FROM {uc_order_products} WHERE order_id = %d", $order->order_id);
while ($product = db_fetch_object($product_result)) {
$product_node = node_load(array('nid' => $product->order_product_id));
$rows[] = array($product->title, $node->$field_date, $node->field_venue, $product->price);
}
}
print theme('table', array('ID #', 'Date', 'Venue', 'Sold Price'), $rows);
?>




Joined: 01/13/2008