Forums / Customization from the Admin / Add Fax field in the Admin's Order page

Add Fax field in the Admin's Order page

Locked

Views: 2,800

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
26 Nov 2006, 2:42 AM
#1
mikex avatar

mikex

New Zenner

Join Date:
Mar 2006
Posts:
31
Plugin Contributions:
0

Add Fax field in the Admin's Order page

Hi everyone,

I need to display customers fax in the order page, in the admin (that one where you can see all the customers details like address, email, phone, etc).

I have tried the following, but still no success. I really apreciate your help.

In admin/orders.php, I added this code:

"%' or o.customers_fax like '%" 

Also this:

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

After these changes, in my order page, it appears "Fax number:" text:yes:, but not the actual fax.

So, in admin/includes/classes/order.php I basicaly added fax. I replaced this:

    function query($order_id) {
      global $db;
      $order = $db->Execute("select cc_cvv, customers_name, customers_company, customers_street_address,
                                    customers_suburb, customers_city, customers_postcode,
                                    customers_state, customers_country, customers_telephone,
                                    customers_email_address, customers_address_format_id, delivery_name,
                                    delivery_company, delivery_street_address, delivery_suburb,
                                    delivery_city, delivery_postcode, delivery_state, delivery_country,
                                    delivery_address_format_id, billing_name, billing_company,
                                    billing_street_address, billing_suburb, billing_city, billing_postcode,
                                    billing_state, billing_country, billing_address_format_id,
                                    coupon_code, payment_method, payment_module_code, shipping_method, shipping_module_code,
                                    cc_type, cc_owner, cc_number, cc_expires, currency,
                                    currency_value, date_purchased, orders_status, last_modified,
                                    order_total, order_tax, ip_address
                             from " . TABLE_ORDERS . "
                             where orders_id = '" . (int)$order_id . "'");

by this:

    function query($order_id) {
      global $db;
      $order = $db->Execute("select cc_cvv, customers_name, customers_company, customers_street_address,
                                    customers_suburb, customers_city, customers_postcode,
                                    customers_state, customers_country, customers_telephone, customers_fax,
                                    customers_email_address, customers_address_format_id, delivery_name,
                                    delivery_company, delivery_street_address, delivery_suburb,
                                    delivery_city, delivery_postcode, delivery_state, delivery_country,
                                    delivery_address_format_id, billing_name, billing_company,
                                    billing_street_address, billing_suburb, billing_city, billing_postcode,
                                    billing_state, billing_country, billing_address_format_id,
                                    coupon_code, payment_method, payment_module_code, shipping_method, shipping_module_code,
                                    cc_type, cc_owner, cc_number, cc_expires, currency,
                                    currency_value, date_purchased, orders_status, last_modified,
                                    order_total, order_tax, ip_address
                             from " . TABLE_ORDERS . "
                             where orders_id = '" . (int)$order_id . "'");

And this:

      $this->customer = array('name' => $order->fields['customers_name'],
                              'company' => $order->fields['customers_company'],
                              'street_address' => $order->fields['customers_street_address'],
                              'suburb' => $order->fields['customers_suburb'],
                              'city' => $order->fields['customers_city'],
                              'postcode' => $order->fields['customers_postcode'],
                              'state' => $order->fields['customers_state'],
                              'country' => $order->fields['customers_country'],
                              'format_id' => $order->fields['customers_address_format_id'],
                              'telephone' => $order->fields['customers_telephone'],
                              'email_address' => $order->fields['customers_email_address']);

by this:

      $this->customer = array('name' => $order->fields['customers_name'],
                              'company' => $order->fields['customers_company'],
                              'street_address' => $order->fields['customers_street_address'],
                              'suburb' => $order->fields['customers_suburb'],
                              'city' => $order->fields['customers_city'],
                              'postcode' => $order->fields['customers_postcode'],
                              'state' => $order->fields['customers_state'],
                              'country' => $order->fields['customers_country'],
                              'format_id' => $order->fields['customers_address_format_id'],
                              'telephone' => $order->fields['customers_telephone'],
							  'fax' => $order->fields['customers_fax'],
                              'email_address' => $order->fields['customers_email_address']);

After that, I get this error when I enter my customer order page:

1054 Unknown column 'customers_fax' in 'field list'

Can anyone help me with this or give me a hint where to go? please,

Thanks,
MikeX

26 Nov 2006, 6:39 AM
#2
johnsony avatar

johnsony

New Zenner

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

Re: Add Fax field in the Admin's Order page

ha another thread about fax. All I can say is take a seat and wait for help there no sloution so far. As Ajeh mention there no such as customers_fax in the database. I think Zen-Cart team will work on it on later verson

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

27 Nov 2006, 1:32 AM
#3
webomat avatar

webomat

Zen Follower

Join Date:
Jan 2005
Location:
Minneapolis MN, USA
Posts:
128
Plugin Contributions:
0

Re: Add Fax field in the Admin's Order page

MikeX:

Hi everyone,

I need to display customers fax in the order page, in the admin (that one where you can see all the customers details like address, email, phone, etc).

I have tried the following, but still no success. I really apreciate your help.

In admin/orders.php, I added this code:

I don't have the solution, but I can point you in the right direction... I think. "-)

customers_fax is in the Customers table, so you have to query it from that table based on the customer ID before you can display it. Look at customers.php for ideas, if you need them.

Hope that makes sense... I'm on a marathon ZC customization myself right now so lack of sleep may contribute to my confusing the issue for you! :D

Cheers,

Becky

27 Nov 2006, 2:58 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Add Fax field in the Admin's Order page

The customers table has the field customers_telephone and customers_fax but only customers_telephone is added to the orders table in the field customers_telephone ...

To add the customers_fax to the orders table, you would need to add the field:
customers_fax

Then, follow along in the code for where customers_telephone or telephone is referenced ...

Developer's Tool Kit can help track those two down for you ...

Where you see customers_telephone you would need to address customers_fax ...

More than likely, you can manage the Catalog side in the:
/includes/classes/order.php

Note: there isn't an overrides file for this

Then in the Admin you would want to update the class as well as the main display for:
/admin/includes/classes/order.php
/admin/orders.php
/admin/includes/languages/english/orders.php

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!

28 Nov 2006, 5:23 PM
#5
johnsony avatar

johnsony

New Zenner

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

Re: Add Fax field in the Admin's Order page

wow all useful tips I already finish the edit. another tips. there not only the admin selection also the zen-cart/inculde need to edit as well. Later on today after I back home I may write a guide to show how to edit. Thanks for all the information and tips.

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