Forums / Customization from the Admin / Guide to show Fax # on Order page?

Guide to show Fax # on Order page?

Started by johnsony on 29 Nov 2006, 3:00 AM · Views: 4,462

Results 1 to 10 of 10
29 Nov 2006, 3:00 AM
#1
johnsony avatar

johnsony

New Zenner

Join Date:
Oct 2006
Posts:
43
Plugin Contributions:
0

Guide to show Fax # on Order page?

The first step of edit alway BACKUP data and the files you need to edit.

After backup database login to you Zen-cart Admin page

Tools-> Install SQL Patches
paste the SQL Command above and press Send

ALTER TABLE orders ADD customers_fax varchar(32) NOT NULL default '';

Open Yourzencartroot/admin/orders.php

Search: (around Line 294)

 
             <tr>
                <td class="main"><strong><?php echo ENTRY_TELEPHONE_NUMBER; ?></strong></td>
                <td class="main"><?php echo $order->customer['telephone']; ?></td>
              </tr>

Replace:

              <tr>
                <td class="main"><strong><?php echo ENTRY_TELEPHONE_NUMBER; ?></strong></td>
                <td class="main"><?php echo $order->customer['telephone']; ?></td>
              </tr>
              <tr>
                <td class="main"><strong><?php echo ENTRY_FAX_NUMBER; ?></strong></td>
                <td class="main"><?php echo $order->customer['fax']; ?></td>
              </tr>

Search: (around Line 615)

o.customers_telephone like '%" . $keywords . "%' 

Replace:

o.customers_telephone like '%" . $keywords . "%' or o.customers_fax like '%" . $keywords . "%' 

Save and Close

Open Yourzencartroot/admin/includes/classes/order.php

Search: (around Line 40)

customers_state, customers_country, customers_telephone,

Replace:

customers_state, customers_country, customers_telephone, customers_fax,

Search: (around Line 97)

'telephone' => $order->fields['customers_telephone'],

Replace:

'telephone' => $order->fields['customers_telephone'],
'fax' => $order->fields['customers_fax'],

Save and Close

Open Yourzencartroot/includes/classes/order.php

Search: (around Line 46)

customers_telephone, 

Replace:

customers_telephone, customers_fax, 

Search: (around Line 127)

'telephone' => $order->fields['customers_telephone'],

Replace:

'telephone' => $order->fields['customers_telephone'],
'fax' => $order->fields['customers_fax'],

Search: (around Line 232)

c.customers_telephone,

Replace:

c.customers_telephone, c.customers_fax,

Search: (around Line 384 )

'telephone' => $customer_address->fields['customers_telephone'],

Replace:

'telephone' => $customer_address->fields['customers_telephone'],
'fax' => $customer_address->fields['customers_fax'],

Search: (around Line 575)

'customers_telephone' => $this->customer['telephone'],

Replace:

'customers_telephone' => $this->customer['telephone'],
'customers_fax' => $this->customer['fax'],

Search: (around Line 985)

$this->customer['telephone']

Replace:

$this->customer['telephone'], $this->customer['fax']

Save and Close

OK It should work now :laugh:

We are Wholesaler for Bead
Please take a look if you are intrested

29 Nov 2006, 3:29 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Guide to show Fax # on Order page?

Thanks for breaking this down for others who need to add the Fax or perhaps another field to their orders ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Sep 2009, 10:39 AM
#3
aatech avatar

aatech

New Zenner

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

Re: Guide to show Fax # on Order page?

Thank you for this amazingly easy to follow contribution.

One quick Question though. I did this and everything works. When new orders are placed it inserts the fax number into the customers_fax database field under orders.

Now is there a way to get all the old orders' fax number into this field?

I'm sure there has to be some SQL Command to do this...

Thank you in advance.

21 Sep 2009, 10:05 PM
#4
aatech avatar

aatech

New Zenner

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

Re: Guide to show Fax # on Order page?

Can someone please reply to this? I need to know if we have to actually do this manually.

Thanks...

24 May 2011, 10:53 PM
#5
drbyday avatar

drbyday

New Zenner

Join Date:
Mar 2008
Posts:
50
Plugin Contributions:
0

Re: Guide to show Fax # on Order page?

Just wanted to let everyone know I had to edit page:

/includes/modules/checkout_process.php

FIND:

customers_telephone' => $order->customer['telephone'],

ADD:

customers_telephone' => $order->customer['telephone'], customers_fax' => $order->customer['fax'],

1 Sep 2011, 8:38 PM
#6
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: Guide to show Fax # on Order page?

While I go back and triple check, does anybody have ideas on where I should look for the potential problem. Here' the info:

I know this is an extremely old post but because it looked like a simple fix I was hoping it would work for zc1.3.9h which is what I'm using. Any reason it shouldn't

-Issue is if I populate my cart, click "go to checkout", I get an internal server error 500.
-I double checked all the code in my files to that posted in #1 and it matches.
-I looked in the admin>customers>orders and if I open up an order I can see the heading for the new field I added
-I went into the database and populated one of my older test orders and then refreshed the admin>customers>orders and the heading still shows but not the data for that field.
-I did not do the coding listed by DrbyDay because I did not see that line of code in the file listed.

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

2 Sep 2011, 3:52 PM
#7
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: Guide to show Fax # on Order page?

OK I keep forgetting about using the cache log to help identify the problems, but here is the error I've gotten:

[02-Sep-2011 08:42:09] PHP Parse error: syntax error, unexpected ',' in /includes/classes/order.php on line 1028

Line 1027-
// $extra_info=email_collect_extra_info('','', $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], $this->customer['telephone']);

Line 1028-
$extra_info=email_collect_extra_info('','', $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], $this->customer['telephone']), $this->customer['dac_code']);

If I //Line1028 and un// line 1027 it seems to let me through to the next page. I've changed the last ; to a , as well as omitting it altogether. The addition of , $this->customer['dac_code']); seems to break it.

Any thoughts out there?

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

6 Sep 2011, 6:39 PM
#8
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: Guide to show Fax # on Order page?

idc1:

Line 1028-
$extra_info=email_collect_extra_info('','', $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], $this->customer['telephone']), $this->customer['dac_code']);

I had an extra )

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

6 Sep 2011, 6:41 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Guide to show Fax # on Order page?

Thanks for the update and for posting the solution ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

7 Sep 2011, 2:26 PM
#10
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: Guide to show Fax # on Order page?

I got the extra field 'dac_code' to show up in the order that is sent to the admin. The problem is that it shows as:

Office Use Only:
From:
Email:
Login Name: correct info
Login Email: correct info
Telephone: correct info
Fax: AB1234
IP Address: correct info
Host Address: correct info
Date and Time: correct info

instead of

Office Use Only:
From:
Email:
Login Name: correct info
Login Email: correct info
Telephone: correct info
DAC Code: AB1234
IP Address: correct info
Host Address: correct info
Date and Time: correct info

I traced back the fax logic and made the following changes.
**
includes/functions/functions_email.php**
/**

  • Function to build array of additional email content collected and sent on admin-copies of emails:

*/
function email_collect_extra_info($from, $email_from, $login, $login_email, $login_phone='', $login_fax='', $login_dac_code='') {
// get host_address from either session or one time for both email types to save server load
if (!$_SESSION['customers_host_address']) {
if (SESSION_IP_TO_HOST_ADDRESS == 'true') {
$email_host_address = @gethostbyaddr($_SERVER['REMOTE_ADDR']);
} else {
$email_host_address = OFFICE_IP_TO_HOST_ADDRESS;
}
} else {
$email_host_address = $_SESSION['customers_host_address'];
}

// generate footer details for "also-send-to" emails
$extra_info=array();
$extra_info['TEXT'] =
  OFFICE_USE . "\t" . "\n" .
  OFFICE_FROM . "\t" . $from . "\n" .
  OFFICE_EMAIL. "\t" . $email_from . "\n" .
  (trim($login) !='' ? OFFICE_LOGIN_NAME . "\t" . $login . "\n"  : '') .
  (trim($login_email) !='' ? OFFICE_LOGIN_EMAIL . "\t" . $login_email . "\n"  : '') .
  ($login_phone !='' ? OFFICE_LOGIN_PHONE . "\t" . $login_phone . "\n" : '') .
  ($login_fax !='' ? OFFICE_LOGIN_FAX . "\t" . $login_fax . "\n" : '') .

($login_dac_code !='' ? OFFICE_LOGIN_DAC_CODE . "\t" . $login_dac_code . "\n" : '') .
OFFICE_IP_ADDRESS . "\t" . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . "\n" .
OFFICE_HOST_ADDRESS . "\t" . $email_host_address . "\n" .
OFFICE_DATE_TIME . "\t" . date("D M j Y G:i:s T") . "\n\n";

$extra_info['HTML'] = '<table class="extra-info">' .
  '<tr><td class="extra-info-bold" colspan="2">' . OFFICE_USE . '</td></tr>' .
  '<tr><td class="extra-info-bold">' . OFFICE_FROM . '</td><td>' . $from . '</td></tr>' .
  '<tr><td class="extra-info-bold">' . OFFICE_EMAIL. '</td><td>' . $email_from . '</td></tr>' .
  ($login !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_NAME . '</td><td>' . $login . '</td></tr>' : '') .
  ($login_email !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_EMAIL . '</td><td>' . $login_email . '</td></tr>' : '') .
  ($login_phone !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_PHONE . '</td><td>' . $login_phone . '</td></tr>' : '') .
  ($login_fax !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_FAX . '</td><td>' . $login_fax . '</td></tr>' : '') .
  ($login_dac_code !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_DAC_CODE . '</td><td>' . $login_dac_code . '</td></tr>' : '') .
  '<tr><td class="extra-info-bold">' . OFFICE_IP_ADDRESS . '</td><td>' . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . '</td></tr>' .
  '<tr><td class="extra-info-bold">' . OFFICE_HOST_ADDRESS . '</td><td>' . $email_host_address . '</td></tr>' .
  '<tr><td class="extra-info-bold">' . OFFICE_DATE_TIME . '</td><td>' . date('D M j Y G:i:s T') . '</td></tr>' . '</table>';
return $extra_info;

}
**
includes/language/english/YOUR_TEMPLATE/email_extras.php**
define('OFFICE_USE','<strong>Office Use Only:</strong>');
define('OFFICE_LOGIN_NAME','<strong>Login Name:</strong>');
define('OFFICE_LOGIN_EMAIL','<strong>Login Email:</strong>');
define('OFFICE_LOGIN_PHONE','<strong>Telephone:</strong>');
define('OFFICE_LOGIN_FAX','<strong>Fax:</strong>');
define('OFFICE_LOGIN_DAC_CODE','<strong>DAC Code:</strong>');
define('OFFICE_IP_ADDRESS','<strong>IP Address:</strong>');
define('OFFICE_HOST_ADDRESS','<strong>Host Address:</strong>');
define('OFFICE_DATE_TIME','<strong>Date and Time:</strong>');

Any idea where I went wrong? I'm using ZC1.3.9h

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3