How to get the price level at which order has been made?

One can give and take price level to the user… How does an admin can see at what price level that order has been priced?



Going to the user’s profile can only show his current price level association, perhaps, he was just given a wholesale level, but was his previous order done with retail prices?



One cannot even manually check the pricing against the invoice since the prices could change by then…



So, how does one know that that exact order was bought at group discount or not?

Seems like that this is cannot be done with regular means, I found a way to inject extra info into the order:



fn.cart.php has function fn_place_order that gets cart array.

Cart array has $cart[‘user_data’][‘usergroups’][int][‘usergroup_id’]

I get a list of these values, then query DB for string representation from id



then,



where $order_details = array (…



before that line I write $extra[‘pricegroup’]= a string that implodes names of the groups



Later its gets serialized and inserted into db automatically, no need to do anything else





then,



in skins/basic/admin/views/orders/details.php



in the table I put
{$oi.extra.pricegroup|unescape} around line 77



and VOLA! So easy…