Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add New Field to Admin Customer form


slimsteve

Recommended Posts

Hi,

 

Does anyone know how to add a new field to say the customer form in the admin area of oscommerce.

 

Bascially I have added a new field in the customers table called 'Notes' which allows the entry of notes about the customer (for admin use only i.e. the customer cannot see it.)

 

In the mysql database I have entered some test notes for testing purposes, but can I and if so how, add this new customers field to the customers.php form in the admin area of oscommerce.

 

At present I can edit the customer notes via mysql, but it would be nice to add it to the customer form in oscommerce admin.

 

Any ideas or links to relevant material would be greatly appreciated.

 

Slim :)

Link to comment
Share on other sites

Hi,

 

Does anyone know how to add a new field to say the customer form in the admin area of oscommerce.

 

Bascially I have added a new field in the customers table called 'Notes' which allows the entry of notes about the customer (for admin use only i.e. the customer cannot see it.)

 

In the mysql database I have entered some test notes for testing purposes, but can I and if so how, add this new customers field to the customers.php form in the admin area of oscommerce.

 

At present I can edit the customer notes via mysql, but it would be nice to add it to the customer form in oscommerce admin.

 

Any ideas or links to relevant material would be greatly appreciated.

 

Slim :)

 

 

 

 

in customers.php of the admin section :

 

you add the text area with :

 

<tr>

<td valign="top"><?php echo tep_draw_textarea_field('customers_notes', 'soft', 160, 15, $customers['customers_notes'], ''); ?></td>

</tr>

 

 

you look for the field $customers_lastname and in every query part where this field is used, you add a similar line for $customers_notes.

 

In every query where c.customers_lastname is used, you add c.customers_notes

 

as example :

 

$sql_data_array = array('customers_firstname' => $customers_firstname,

'customers_lastname' => $customers_lastname,

'customers_email_address' => $customers_email_address,

'customers_telephone' => $customers_telephone,

'customers_fax' => $customers_fax,

 

you add : 'customers_notes' => $customers_notes,

 

 

or a query :

 

$customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_groups_id, c.customers_default_address_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");

 

 

you add : c.customers_notes, so it looks like :

 

$customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_notes, c.customers_groups_id, c.customers_default_address_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");

Treasurer MFC

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...