Forums / Templates, Stylesheets, Page Layout / Pulling additional product_order info into tpl_account_history_info_default.php

Pulling additional product_order info into tpl_account_history_info_default.php

Started by ailtait on 20 Jun 2012, 6:37 PM · Views: 683

Results 1 to 2 of 2
20 Jun 2012, 6:37 PM
#1
ailtait avatar

ailtait

New Zenner

Join Date:
May 2012
Posts:
22
Plugin Contributions:
0

Pulling additional product_order info into tpl_account_history_info_default.php

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.

15 Jan 2013, 11:46 PM
#2
honeypot avatar

honeypot

New Zenner

Join Date:
Jan 2007
Posts:
55
Plugin Contributions:
0

Re: Pulling additional product_order info into tpl_account_history_info_default.php

ailtait:

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.

Hi, Did you manage to locate this $order->products[$i]['name'] as I am having a similar issue