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:
Code:
"%' or o.customers_fax like '%"
Also this:
Code:
<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:
Code:
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:
Code:
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:
Code:
$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:
Code:
$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
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
Re: Add Fax field in the Admin's Order page
Quote:
Originally Posted by
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
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
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.