Lacoart Posted April 27, 2013 Posted April 27, 2013 Hi, I want to display the customer number in admin / orders.php someone tell me how should I do? thanks
Lacoart Posted April 27, 2013 Author Posted April 27, 2013 <tr> <td class="main"><b><?php echo ENTRY_ORDER_NUMBER; ?></b></td> <td class="main"><?php echo $oID; ?></td> works ----------------------------------------------------------------------------------------------------------------------------------- <td> </td> <td> </td> <td class="main"><b><?php echo ENTRY_CUSTOMERS_NUMBER; ?></b></td> <td class="main"><?php echo $cID; ?></td> <td> </td> does not work
Dan Cole Posted April 28, 2013 Posted April 28, 2013 @@Lacoart You didn't say what version you were running so if you are not running 2.2 RC2 take what I say with a grain of salt....if fact you might want to do that anyway. :D From what I can tell the customers_id it not available in orders.php, at least not in the stock version, so you'll need to modify the orders class to pick it up...after that you should access it as follows... $order->customer['customers_id'] Mess around with that and if you have any problems just ask... Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Lacoart Posted April 29, 2013 Author Posted April 29, 2013 Hello thanks for taking my call modify the orders class in ADMIN\INCLUDES\CLASSES\ORDER.php ???? thank you! Lacoart
Dan Cole Posted April 29, 2013 Posted April 29, 2013 Not sure what you are asking but if you're wondering if that is the correct file to modify....then yes it is. Post if you have problems modifying it. I'll help but I'm not doing it for you. Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Lacoart Posted April 29, 2013 Author Posted April 29, 2013 Hello, I'm sorry for my English is not very correct ...... I modified the file order.php $order_query = tep_db_query("select customers_id, $this->customer = array('customer' => $order['customers_id'], I modified the file orders.php $order->customer['customers_id'] does not work :sweating: Lacoart
Dan Cole Posted April 29, 2013 Posted April 29, 2013 Try... $this->customer = array('customer_id' => $order['customers_id'], Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Dan Cole Posted April 29, 2013 Posted April 29, 2013 Oppss...looks like the "s" is missing too...try... $this->customer = array('customers_id' => $order['customers_id'], Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Lacoart Posted April 29, 2013 Author Posted April 29, 2013 now it works thank you very much you can also view gender and fax number? thanks Lacoart
Dan Cole Posted April 30, 2013 Posted April 30, 2013 I haven't looked at that specifically but you should be able too...have fun.... :thumbsup: Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Lacoart Posted April 30, 2013 Author Posted April 30, 2013 I tried to change so ...... in order.php $order_query = tep_db_query("select customers_gender, customers_fax " . TABLE_CUSTOMERS . "' and customers_id != '" . (int)$customers_id . "'"); $this->customer = array('gender' => $order['customers_gender'], ('fax' => $order['customers_fax'], in orders.php <td class="main"><b><?php echo ENTRY_GENDER; ?></b></td> <td class="main"><?php echo $order->customer['gender']; ?></td> </tr> <td class="main"><b><?php echo ENTRY_FAX_NUMBER; ?></b></td> <td class="main"><?php echo $order->customer['fax']; ?></td> </tr> but unfortunately it does not work :'( Lacoart
Dan Cole Posted April 30, 2013 Posted April 30, 2013 I don't see anything obvious but I do wonder if you have any information in those fields for the order you're looking at and/or testing? The other thing that strikes me is whether you have the $order_query correct....I assume that you just posted a snippet but if you do have information in those fields and it still isn't working, post the full query and I'll have another look. Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Lacoart Posted April 30, 2013 Author Posted April 30, 2013 The complete query is this: $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_piva, billing_cf, 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 . " customers_gender, customers_fax " . TABLE_CUSTOMERS . "' and customers_id != '" . (int)$customers_id . "'"); This query does not show any error online................... :wacko:
Dan Cole Posted April 30, 2013 Posted April 30, 2013 I don't think that query is going to work....you need to move the customers_gender, customers_fax up into the SELECT portion of the query....put them between say the customers_telephone and customers_email_address and put the WHERE part of the query back to the way it was. I think that should do it. Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Lacoart Posted May 2, 2013 Author Posted May 2, 2013 this is the original query: $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_piva, billing_cf, 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 . "'"); data customers_gender and customers_fax are not present in TABLE_ORDERS data present in TABLE_CUSTOMERS you can do the same or is it a problem???? Lacoart
Dan Cole Posted May 2, 2013 Posted May 2, 2013 That is not a problem but you'll need to add or join the Customer Table to the query....my query was modified for SPPC and looks like this.... $order_query = tep_db_query("select customers_id, customers_name, customers_dob, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, o.customers_telephone, o.customers_email_address, customers_address_format_id, customers_group_name, 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, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " o left join " . TABLE_CUSTOMERS . " using(customers_id) left join " . TABLE_CUSTOMERS_GROUPS . " using(customers_group_id) where orders_id = '" . (int)$order_id . "'"); You probably don't have the Customer Groups Table so you'll need to remove that join from the query... Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Lacoart Posted May 4, 2013 Author Posted May 4, 2013 Hi Dan I was able to change the query that you sent me now it works thank you very much Lacoart
Dan Cole Posted May 5, 2013 Posted May 5, 2013 You are very welcome Luca....glad I could be of some help... Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.