Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding a field to order.php


pynchon

Recommended Posts

Hi

 

At present the customer detail on order.php is Name, Address Telephone and Email address ... I would like to add/display the data that we capture in the Fax field. (We capture the customers Mobile Number in this field)

I added the following to the page

 

 

<tr>
			<td class="main"><b>Mobile Number:</b></td>
			<td class="main"><?php echo $order->customer['fax']; ?></td>
		  </tr>

 

 

 

 

However all I get is a blank space where the number I want should be

 

Can anyone help me solve what I thought would be a simple amendment

 

Many Thanks

 

John K

Link to comment
Share on other sites

i am not quiet sure if i understand you right, but i think it should be something like this

 

$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_fax= $the_extra['customers_fax'];

 

i found this set of lines in admin/orders.php

l8ter

Link to comment
Share on other sites

i am not quiet sure if i understand you right, but i think it should be something like this

 

 

 

i found this set of lines in admin/orders.php

 

 

Many thanks for the reply.

Where do I put the code you have quoted ?

Link to comment
Share on other sites

i guess you are trying to get the fax no. displayed in the admin/order.php file right??

 

if so go to admin/orders.php

 

you will place that code right above include(DIR_WS_CLASSES . 'order.php');

 

and call it like this in

 

<tr>

<td class="main"><b><?php echo 'Mobile #:'; ?></b></td>

<td class="main"><?php echo $the_customers_fax; ?></td>

</tr>

l8ter

Link to comment
Share on other sites

i guess you are trying to get the fax no. displayed in the admin/order.php file right??

 

if so go to admin/orders.php

 

you will place that code right above include(DIR_WS_CLASSES . 'order.php');

 

and call it like this in

 

<tr>

<td class="main"><b><?php echo 'Mobile #:'; ?></b></td>

<td class="main"><?php echo $the_customers_fax; ?></td>

</tr>

 

 

Yep ... we have a lot of customers that give both their home numbers and a day-time mobile number ... it makes contacting the customer easier if the mobile number is displayed on the orders.php page when the order is opened for editing/processing. It saves having to look in the customer details record.

 

I'll try it just now and see what happens.

 

thanks again

 

:)

Link to comment
Share on other sites

:(

 

alas it doesn't appear to work

 

This is the code as it appears in my orders.php ... at least the last few lines

 

if (!tep_db_num_rows($orders_query)) {
  $order_exists = false;
  $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
}
 }

$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");
$the_extra= tep_db_fetch_array($the_extra_query);
$the_customers_fax= $the_extra['customers_fax'];

 include(DIR_WS_CLASSES . 'order.php');
?>

 

 

The orders page still works so the presence of the code isn't breaking anything that I can see ... just that the number still doesn't show

 

hmmmm

 

John K

Link to comment
Share on other sites

is it still showing blank? does the customer who you are testing for, does he have a fax number in the field

 

is there any error

 

 

I've checked it against a number of records .. all of which have a fax/mobile number .... and all are displayed without the number

 

There is no error .... all orders display as they should

Link to comment
Share on other sites

in your database in the customer table, the fax field is called customers_fax

 

just check to make sure

 

thanks for your help with this 'juniorprg'.

 

the table is called customers, and the field is called customers_fax

Link to comment
Share on other sites

i feel such a stupid now,,,right above the query i gave you put this aswell

 

$the_extra_query= tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_id= $the_extra['customers_id'];

 

so it should look like this

 

$the_extra_query= tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_id= $the_extra['customers_id'];

// Look up things in customers

$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_fax= $the_extra['customers_fax'];

echo $the_customers_fax;

l8ter

Link to comment
Share on other sites

i feel such a stupid now,,,right above the query i gave you put this aswell

 

$the_extra_query= tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_id= $the_extra['customers_id'];

 

so it should look like this

 

$the_extra_query= tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_id= $the_extra['customers_id'];

// Look up things in customers

$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_fax= $the_extra['customers_fax'];

echo $the_customers_fax;

 

 

gulp ... fingers crossed :)

Link to comment
Share on other sites

gulp ... fingers crossed :)

 

 

 

Wa' Hae

 

It works !!!!

 

Minor point though .... the number also displays above the logo top left of the page.

 

 

Thats brilliant .... though it would be good to get rid of the extra number ... lol

 

 

:thumbs up:

 

thanks you :)

Link to comment
Share on other sites

$the_extra_query= tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_id= $the_extra['customers_id'];

// Look up things in customers

$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_fax= $the_extra['customers_fax'];

echo $the_customers_fax;

 

 

could the extra number be because of the highlighted code ??

Link to comment
Share on other sites

oh just remove the line

echo $the_customers_fax;

 

$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_fax= $the_extra['customers_fax'];

echo $the_customers_fax;

 

replace to

 

$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_fax= $the_extra['customers_fax'];

l8ter

Link to comment
Share on other sites

oh just remove the line

echo $the_customers_fax;

 

$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_fax= $the_extra['customers_fax'];

echo $the_customers_fax;

 

replace to

 

$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");

$the_extra= tep_db_fetch_array($the_extra_query);

$the_customers_fax= $the_extra['customers_fax'];

 

 

sweet !

 

It works perfectly.

 

many many thanks ... I've been pulling my hair out over this (whats left of it that is)

 

:) you're a star

Link to comment
Share on other sites

thanks enjoy ur weather in scotland...which is the same as in toronto :)

 

 

its a balmy -2 degrees here just now.

 

your night-time temperatures look terrifying though .... -13 to -18 ... and without wind-chill :o

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...