Adding specific columns to Customers page in admin
Hi,
I'm trying to customise the columns displayed in MY-ADMIN/customers.php so that it shows the customer's email address, telephone number and fax number.
I've managed to get the email and telephone number to show, but not the fax number.
Here's the existing code of MY-ADMIN/customers.php which controls this (line 1221 onwards)
PHP Code:
<td class="dataTableContent" align="right"><?php echo $customers->fields['customers_id'] . ($zc_address_book_count == 1 ? TEXT_INFO_ADDRESS_BOOK_COUNT . $zc_address_book_count : '<a href="' . zen_href_link(FILENAME_CUSTOMERS, 'action=list_addresses' . '&cID=' . $customers->fields['customers_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . TEXT_INFO_ADDRESS_BOOK_COUNT . $zc_address_book_count . '</a>'); ?></td>
<td class="dataTableContent"><?php echo $customers->fields['customers_lastname']; ?></td>
<td class="dataTableContent"><?php echo $customers->fields['customers_firstname']; ?></td>
<td class="dataTableContent"><?php echo $customers->fields['entry_company']; ?></td>
<td class="dataTableContent"><?php echo zen_date_short($info->fields['date_account_created']); ?></td>
<td class="dataTableContent"><?php echo zen_date_short($customers->fields['customers_info_date_of_last_logon']); ?></td>
<td class="dataTableContent"><?php echo $group_name_entry; ?></td>
I changed this to the following which inserts the email, phone and fax after the company name and before the date the account was created:
PHP Code:
<td class="dataTableContent" align="right"><?php echo $customers->fields['customers_id'] . ($zc_address_book_count == 1 ? TEXT_INFO_ADDRESS_BOOK_COUNT . $zc_address_book_count : '<a href="' . zen_href_link(FILENAME_CUSTOMERS, 'action=list_addresses' . '&cID=' . $customers->fields['customers_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . TEXT_INFO_ADDRESS_BOOK_COUNT . $zc_address_book_count . '</a>'); ?></td>
<td class="dataTableContent"><?php echo $customers->fields['customers_lastname']; ?></td>
<td class="dataTableContent"><?php echo $customers->fields['customers_firstname']; ?></td>
<td class="dataTableContent"><?php echo $customers->fields['entry_company']; ?></td>
<td class="dataTableContent"><?php echo $customers->fields['customers_email_address']; ?></td>
<td class="dataTableContent"><?php echo $customers->fields['customers_telephone']; ?></td>
<td class="dataTableContent"><?php echo $customers->fields['customers_fax']; ?></td>
<td class="dataTableContent"><?php echo zen_date_short($info->fields['date_account_created']); ?></td>
<td class="dataTableContent"><?php echo zen_date_short($customers->fields['customers_info_date_of_last_logon']); ?></td>
<td class="dataTableContent"><?php echo $group_name_entry; ?></td>
The email address and telephone are now showing up in the table, but not the fax number. I checked in phpMyAdmin and 'customers_fax' is in the 'customers' table (as are 'customers_email_address' and 'customers_telephone'), so I'm not sure what I'm doing wrong - any ideas?
Many thanks
Lee
Re: Adding specific columns to Customers page in admin
You'll need to add your additional fields to the $customers_query_raw query string if you want it to retrieve that data from the database table.
Re: Adding specific columns to Customers page in admin
Re: Adding specific columns to Customers page in admin
Quote:
Originally Posted by
igi2011
Fixed... thanks DrByte!
HI, I am running: Zen Cart 1.5.0
Database Patch Level: 1.5.0
v1.5.0 [2012-06-19 14:08:50] (Fresh Installation)
v1.5.0 [2012-06-19 14:08:50] (Fresh Installation)
And, I am getting the same error. My customer registration form requires a telephone number but during the order/payment process when the customer address details are displayed, the phone number filed is not showing and the error, "Your Telephone Number a minimum of 10 characters." is displayed and the order cannot be completed.
HELP!
Thank you,
- Deservingdog
Re: Adding specific columns to Customers page in admin
Hi Guys/Dr. Byte,
We are trying to add a new drop down field after the customer Authorization box (green/red), where it will simply say if a customer is Consumer, International or Wholesale (save it to a table in the database). What's easiest way to go by this, any add ons similar to this we can edit and use?
Thanks.
Quote:
Originally Posted by
Deservingdog
HI, I am running: Zen Cart 1.5.0
Database Patch Level: 1.5.0
v1.5.0 [2012-06-19 14:08:50] (Fresh Installation)
v1.5.0 [2012-06-19 14:08:50] (Fresh Installation)
And, I am getting the same error. My customer registration form requires a telephone number but during the order/payment process when the customer address details are displayed, the phone number filed is not showing and the error, "Your Telephone Number a minimum of 10 characters." is displayed and the order cannot be completed.
HELP!
Thank you,
- Deservingdog