ecclesr Posted June 30, 2009 Posted June 30, 2009 Hi I am testing my installation. I have 6 customers in my database. When I view my admin/customer screen I see 6 "at a Glance comment bubbles" but I don not see the expect 6 rows of customer information If I double click on a customers Glance comment bubble I get the customers details listing screens Has anyone had a similar issue Thanking you all in advance
ecclesr Posted July 18, 2009 Author Posted July 18, 2009 A challenge to all you oscommerce developers Can someone please point out the sections of code in customer.php that 1) select the customer data 2) code that displays the rows of customer data 3) where it is recommended I place debug statements Has anyone had a similar issue where customer data is not displayed Thanking you all in advance
ecclesr Posted July 18, 2009 Author Posted July 18, 2009 Debugging so far 1) Debugging Test 1 if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) { $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search'])); $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%'"; } // BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_group_id, c.customers_group_ra, a.entry_country_id, a.entry_company, cg.customers_group_name from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join customers_groups cg on c.customers_group_id = cg.customers_group_id " . $search . " order by $order"; $customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows); $customers_query = tep_db_query($customers_query_raw); echo '<pre>'; print_r(tep_db_fetch_array($customers_query)); echo '</pre>'; The debugged info is Array ( [customers_id] => 9 [customers_lastname] => Cxx [customers_firstname] => jxxx [customers_email_address] => [email protected] [customers_group_id] => 0 [customers_group_ra] => 0 [entry_country_id] => 153 [entry_company] => [customers_group_name] => Retail ) 2) Debugging Test 2 while ($customers = tep_db_fetch_array($customers_query)) { $info_query = tep_db_query("select customers_info_date_account_created as date_account_created, customers_info_date_account_last_modified as date_account_last_modified, customers_info_date_of_last_logon as date_last_logon, customers_info_number_of_logons as number_of_logons from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customers['customers_id'] . "'"); $info = tep_db_fetch_array($info_query); echo '<pre>'; print_r($info); echo '</pre>'; The debugged info is Array ( [date_account_created] => 2009-06-11 21:47:48 [date_account_last_modified] => [date_last_logon] => [number_of_logons] => 0 ) 3) Debugging Test 3 $customer_info = array_merge((array)$country, (array)$info, (array)$reviews); $cInfo_array = array_merge((array)$customers, (array)$customer_info); $cInfo = new objectInfo($cInfo_array); echo '<pre>'; print_r($cInfo_array); echo '</pre>'; The debugged info is Array ( [customers_id] => 9 [customers_lastname] => Cxx [customers_firstname] => jxxx [customers_email_address] => [email protected] [customers_group_id] => 0 [customers_group_ra] => 0 [entry_country_id] => 153 [entry_company] => [customers_group_name] => Retail [countries_name] => New Zealand [date_account_created] => 2009-06-11 21:47:48 [date_account_last_modified] => [date_last_logon] => [number_of_logons] => 0 [number_of_reviews] => 0 ) 4) Debugging Test 4 if (isset($cInfo) && is_object($cInfo) && ($customers['customers_id'] == $cInfo->customers_id)) { echo '<tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '\'">' . "\n"; } echo '<pre>'; print_r($customers); echo '</pre>'; // BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer ?> <?php // ====> BOF: ORDERS AT-A-GLANCE / CUSTOMERS EDITION <==== ?> <td class="dataTableContent"><?php; $artikel = ""; $num = 1; $result_artikels = tep_db_query("select op.products_model, op.products_name, op.products_quantity, o.date_purchased from " . TABLE_ORDERS_PRODUCTS . " op left join " . TABLE_ORDERS . " o on (op.orders_id = o.orders_id) where o.customers_id = '" . tep_db_input($customers['customers_id']) . "' "); while($row_artikels = tep_db_fetch_array($result_artikels)) { $artikel .= ($row_artikels["date_purchased"]) . ":<br>" . "item #: " . ($row_artikels["products_model"]) . " qty: " . ($row_artikels["products_quantity"]) . "x " . ($row_artikels["products_name"]) . "<br><br>"; $num++; } if ($artikel['products_name'] != '') { $parsedComment = explode("\r", $artikel); $cleanComment = ""; $i=0; while($i < count($parsedComment)) { $cleanComment .= trim($parsedComment[$i]); $i++; if ($i < count($parsedComment)) $cleanComment .= '<br \> '; } ?> <script language="javascript"><!-- document.write('<?php echo '<a href="java script:void(0);" onmouseover="return overlib(\\\'' . $cleanComment . '\\\');" onmouseout="return nd();"><img src="images/icons/comment2.gif" align="top" border=0></a> '; ?>'); --></script> <?php } ?> </b></a> <?php // ====> EOF: ORDERS AT-A-GLANCE / CUSTOMERS EDITION <==== ?> <td class="dataTableContent"><?php if (strlen($customers['entry_company']) > 16 ) { print ("<acronym title=\"".$customers['entry_company']."\">".substr($customers['entry_company'], 0, 16)." </acronym>"); } else { echo $customers['entry_company']; } ?></td> The debugged info is Array ( [customers_id] => 9 [customers_lastname] => Cxxx [customers_firstname] => jxxx [customers_email_address] => [email protected] [customers_group_id] => 0 [customers_group_ra] => 0 [entry_country_id] => 153 [entry_company] => [customers_group_name] => Retail ) Array ( [customers_id] => 8 [customers_lastname] => smith [customers_firstname] => Ari [customers_email_address] => [email protected] [customers_group_id] => 0 [customers_group_ra] => 0 [entry_country_id] => 153 [entry_company] => [customers_group_name] => Retail )
ecclesr Posted July 19, 2009 Author Posted July 19, 2009 Solution found A line of code was missed. Customers.php now working as required
Recommended Posts
Archived
This topic is now archived and is closed to further replies.