Results 1 to 2 of 2
  1. #1
    Join Date
    May 2012
    Posts
    13
    Plugin Contributions
    0

    Default 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.

  2. #2
    Join Date
    Jan 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: Pulling additional product_order info into tpl_account_history_info_default.php

    Quote Originally Posted by ailtait View Post
    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

 

 

Similar Threads

  1. Replies: 5
    Last Post: 9 Aug 2012, 09:57 PM
  2. Pulling Info From Customers Table On an Order
    By CyberWoolf in forum Managing Customers and Orders
    Replies: 7
    Last Post: 25 Apr 2008, 01:26 PM
  3. Pulling Sideboxes into non zencart pages
    By halfwitt in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 22 Aug 2007, 02:51 PM
  4. Pulling info from a new table?
    By lismith in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 2 Jul 2007, 06:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •