Zen Cart Logo
Forums / General Questions / Adding specific columns to Customers page in admin

Adding specific columns to Customers page in admin

Views: 738

Results 1 to 5 of 5
25 Jul 2012, 3:07 PM
#1
igi2011 avatar

igi2011

New Zenner

Join Date:
Oct 2011
Location:
Kent, UK
Posts:
50
Plugin Contributions:
0

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)

<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:

<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

25 Jul 2012, 10:50 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.

26 Jul 2012, 2:09 PM
#3
igi2011 avatar

igi2011

New Zenner

Join Date:
Oct 2011
Location:
Kent, UK
Posts:
50
Plugin Contributions:
0

Re: Adding specific columns to Customers page in admin

Fixed... thanks DrByte!

1 Aug 2012, 2:14 PM
#4
deservingdog avatar

deservingdog

New Zenner

Join Date:
Aug 2012
Posts:
1
Plugin Contributions:
0

Re: Adding specific columns to Customers page in admin

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
8 Nov 2012, 7:01 PM
#5
aatech avatar

aatech

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

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.

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