Hi
I was searching the forums to make another mod to customers.php, perhaps you could help. I've made a similar to change to the one above so that I can search by company name as most of our transactions are with companies. The let down of the the search results is that the tablet shows only the first/last name. I'd like to show the company name in the results.
I found the relevant parts of customers.php
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LASTNAME; ?></td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FIRSTNAME; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
</tr>
and modified to add a column heading as follows
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LASTNAME; ?></td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FIRSTNAME; ?></td>
<td class="dataTableHeadingContent">Company Name</td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
</tr>
and then about 40 rows further down my code, found the results
<td class="dataTableContent"><?php echo $customers['customers_lastname']; ?></td>
<td class="dataTableContent"><?php echo $customers['customers_firstname']; ?></td>
<td class="dataTableContent" align="right"><?php echo tep_date_short($info['date_account_created']); ?></td>
so I added in this line in (naive) hope
<td class="dataTableContent"><?php echo $address_book['entry_company']; ?></td>
but alas it does not work.
between the code for the table heading and tablet content there is a bunch of queries that (I assume) call the data to populate the tablet. So I recklessly added a.entry_company into the following query:
$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_company, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname";
I have no idea if I am making the correct approach or not but my steps seem logical. Perhaps I've added to the wrong query or need different syntax to display the field? Any help appreciated, I'm assuming someone with just a passing familiarity with the coding conventions here will spot what needs to be done and help me along my way.
Thanks in advance!