DisComChris Posted November 30, 2004 Share Posted November 30, 2004 I am trying to add the customers fax numbers on the /admin/orders.php under the customers telephone number. Please help.. Link to comment Share on other sites More sharing options...
DisComChris Posted December 2, 2004 Author Share Posted December 2, 2004 No one knows how? Link to comment Share on other sites More sharing options...
Guest Posted December 2, 2004 Share Posted December 2, 2004 find this: <tr> <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td> <td class="main"><?php echo $order->customer['telephone']; ?></td> </tr> and add this below it: <tr> <td class="main"><b><?php echo ENTRY_FAX_NUMBER; ?></b></td> <td class="main"><?php echo $order->customer['fax']; ?></td> </tr> -jared Link to comment Share on other sites More sharing options...
DisComChris Posted December 3, 2004 Author Share Posted December 3, 2004 That doesn't seem to be working.. Link to comment Share on other sites More sharing options...
Guest Posted December 3, 2004 Share Posted December 3, 2004 Where, exactly, do you want to see it? On the invoice? packing slip? while editing the order? -jared Link to comment Share on other sites More sharing options...
DisComChris Posted December 6, 2004 Author Share Posted December 6, 2004 Where, exactly, do you want to see it? On the invoice? packing slip? while editing the order? -jared <{POST_SNAPBACK}> Here Link to comment Share on other sites More sharing options...
Guest Posted December 7, 2004 Share Posted December 7, 2004 Ah. Right you are. The field shows up, but no value. I'll see if I can fix that. gimme a few minutes. -jared Link to comment Share on other sites More sharing options...
Guest Posted December 7, 2004 Share Posted December 7, 2004 Ok. Got it. The orders table doesn't contain the fax number, just the telephone number. So, we've got to get it from the customers table and match it up via customers_id with the orders table. Here's what we do (starting from scratch): find <tr> <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td> <td class="main"><?php echo $order->customer['telephone']; ?></td> </tr> and add the following right afterwards: <tr> <td class="main"><b><?php echo ENTRY_FAX_NUMBER; ?></b></td> <td class="main"> <?php $fax_query = tep_db_query("select customers_id, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . $order->customer['id'] . "'" ); $fax_results = tep_db_fetch_array($fax_query); echo $fax_results['customers_fax']; ?> </td> </tr> Then, in catalog/admin/includes/classes/orders.php, find the following: function query($order_id) { $order_query = tep_db_query("select 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, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); and change it to: function query($order_id) { $order_query = tep_db_query("select customers_id, 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, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); next, in the same orders class file, find $this->customer = array('name' => $order['customers_name'], 'company' => $order['customers_company'], 'street_address' => $order['customers_street_address'], 'suburb' => $order['customers_suburb'], 'city' => $order['customers_city'], 'postcode' => $order['customers_postcode'], 'state' => $order['customers_state'], 'country' => $order['customers_country'], 'format_id' => $order['customers_address_format_id'], 'telephone' => $order['customers_telephone'], 'email_address' => $order['customers_email_address']); and change it to $this->customer = array('name' => $order['customers_name'], 'company' => $order['customers_company'], 'street_address' => $order['customers_street_address'], 'suburb' => $order['customers_suburb'], 'city' => $order['customers_city'], 'postcode' => $order['customers_postcode'], 'state' => $order['customers_state'], 'country' => $order['customers_country'], 'format_id' => $order['customers_address_format_id'], 'telephone' => $order['customers_telephone'], 'email_address' => $order['customers_email_address'], 'id' => $order['customers_id']); We just added customers_id to the query in order to use it more easily in admin/orders.php, which will make our initial changes work. There may be a better way to do this. This is how I made it work. I can make it a contrib if'n you like it, and if'n it works for you. -jared Link to comment Share on other sites More sharing options...
DisComChris Posted December 7, 2004 Author Share Posted December 7, 2004 Works Perfect! Exactly what I needed. I think by the things you added to get that, I think i'll be able to do some other similar things that I've wanted to do but didn't know how to get it out of the database.. Thanks! Link to comment Share on other sites More sharing options...
Guest Posted December 8, 2004 Share Posted December 8, 2004 Great! Be sure to tell us what you did so that we can all learn from it! -jared Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.