I was workin on this contrib a little bit in my spare time trying to get Product Attributes to also show up in the overlib window. I got some interesting results, but I think I'm on the right track. I will continue to look at it and wondered if you would care to look at it as well.
Currently it shows the attribs for every 4th product starting with the first, so I think my while loop is errored but not sure where as I'm using the same logic as the code used on the normal orders page to show the product attribs for each product. But if I have an order with one item ordered, it shows it fine (partially). But if I have an order with 2 or 3 items in it, it only shows for the first order. And if I have an order with 5 items in the order, it will show the attribs for the 1st and 4th items only.
I am also unsure how to retrieve the values for attribs that have different value settings because they are stored in some encoded number format. I just created a new query to pull the attribs based on the order_id by copying your query and added a while loop within each product to show the attribs for that order on a per product basis.
Here is the code:
$artikel = "";
$result_artikels = $db->Execute("select products_name, products_quantity, orders_products_id from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . zen_db_input($orders->fields['orders_id']) . "' ");
$result_artikels_attrib = $db->Execute("select products_options, orders_products_id from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . zen_db_input($orders->fields['orders_id']) . "' ");
while(!$result_artikels->EOF) {
$artikel .= ($result_artikels->fields["products_quantity"]) . "x " . ($result_artikels->fields["products_name"]) . "<br />";
//echo $result_artikels_attrib->Recordcount();
Do {
if ($result_artikels->fields["orders_products_id"] == $result_artikels_attrib->fields["orders_products_id"]) {
$artikel .= ' <i> - ' . $result_artikels_attrib->fields["products_options"] . ': ' . $result_artikels->fields["products_options"] . '</i></nobr><br />';
}
$result_artikels_attrib->MoveNext();
} while(!$result_artikels_attrib->EOF);
$result_artikels->MoveNext();
}