Possibly a silly question, but I'd like to know where the relevant SQL script is that allows $order->products[$i]['name']; to be populated on tpl_account_history_info_default.php.
We've built a custom product type, and we'd like the new product fields to be output onto both the customer invoice and customer account history page. To do this, we want to add a snapshot of the product type info into the orders_products table. That way we can reference it easily within invoicing etc (or so we thought).
We've managed to add the extra columns to the DB, and even managed to populate them when an order completes.
But we just can't get the info to spit out into the account history page. We have 2 options as we can see it ...
1) Run a separate MySQL script, pulling that field based on the orders_products_id ... but we don't know how to get that within the loop?
2) Use the same $order->products[$i]['name'] variable, modifying to something like $order->products[$i]['Our-New-Column'] ... but it doesn't work.
I presume that a MySQL script runs somewhere that allows $order->products[$i]['name'];, $order->products[$i]['qty']; etc to be populated. Can anyone tell me where this is so I know if we can add our new column to that script?
We're trying to add the new column data within tpl_account_history_info_default.php just after it writes the product name. And we want to pull out additional info (from a new column) from the same row as that product name.
All help appreciated.