Zen Cart Logo
Forums / Customization from the Admin / Make Company Name Primary in Orders

Make Company Name Primary in Orders

Locked

Views: 2,596

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
26 Nov 2008, 5:27 PM
#1
charmedbytina2 avatar

charmedbytina2

Totally Zenned

Join Date:
Mar 2007
Location:
AZ
Posts:
1,890
Plugin Contributions:
0

Make Company Name Primary in Orders

What do I need to change to have the customers/orders show the Company Name before the Customer Name in admin orders?

Thanks,

Tina

26 Nov 2008, 6:36 PM
#3
charmedbytina2 avatar

charmedbytina2

Totally Zenned

Join Date:
Mar 2007
Location:
AZ
Posts:
1,890
Plugin Contributions:
0

Re: Make Company Name Primary in Orders

YES! and I even looked at the thread BEFORE I posted this.

Senior moments are happening more and more often! :blush:

Tina

4 Jan 2009, 5:42 PM
#5
charmedbytina2 avatar

charmedbytina2

Totally Zenned

Join Date:
Mar 2007
Location:
AZ
Posts:
1,890
Plugin Contributions:
0

Re: Make Company Name Primary in Orders

Let's start this over....

I would like the COMPANY Name (not the CUSTOMER name)to display when viewing Best Customers Orders -Total page in admin.

The file referred to is admin/stats_customers.php

Thanks,

Tina

4 Jan 2009, 5:57 PM
#6
charmedbytina2 avatar

charmedbytina2

Totally Zenned

Join Date:
Mar 2007
Location:
AZ
Posts:
1,890
Plugin Contributions:
0

Re: Make Company Name Primary in Orders

Got it!~

Made two changes to the admin / stats_customers.php and all is good.

Changed this:

?>

<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo zen_href_link(FILENAME_CUSTOMERS, 'cID=' . $customers->fields['customers_id'], 'NONSSL'); ?>'"> <td class="dataTableContent" align="right"><?php echo $customers->fields['customers_id']; ?>  </td> <td class="dataTableContent"><?php echo '<a href="' . zen_href_link(FILENAME_CUSTOMERS, 'cID=' . $customers->fields['customers_id'], 'NONSSL') . '">' . $customers->fields['customers_firstname'] . ' ' . $customers->fields['customers_lastname'] . '</a>'; ?></td> <td class="dataTableContent" align="right"><?php echo $currencies->format($customers->fields['ordersum']); ?> </td> </tr>

to this:

?>

<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo zen_href_link(FILENAME_CUSTOMERS, 'cID=' . $customers->fields['customers_id'], 'NONSSL'); ?>'"> <td class="dataTableContent" align="right"><?php echo $customers->fields['customers_id']; ?>  </td> <td class="dataTableContent"><?php echo '<a href="' . zen_href_link(FILENAME_CUSTOMERS, 'cID=' . $customers->fields['customers_id'], 'NONSSL') . '">' . $customers->fields['entry_company'] . '</a>'; ?></td> <td class="dataTableContent" align="right"><?php echo $currencies->format($customers->fields['ordersum']); ?> </td> </tr>

and then changed this:

<?php if (isset($_GET['page']) && ($_GET['page'] > 1)) $rows = $_GET['page'] * MAX_DISPLAY_SEARCH_RESULTS_REPORTS - MAX_DISPLAY_SEARCH_RESULTS_REPORTS; $customers_query_raw = "select c.customers_id, c.customers_firstname, c.customers_lastname, sum(op.products_quantity * op.final_price)+sum(op.onetime_charges) as ordersum from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o where c.customers_id = o.customers_id and o.orders_id = op.orders_id group by c.customers_firstname, c.customers_lastname order by ordersum DESC"; $customers_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_REPORTS, $customers_query_raw, $customers_query_numrows); // fix counted customers $customers_query_m = $db->Execute("select customers_id from " . TABLE_ORDERS . " group by customers_id");

to this:

<?php if (isset($_GET['page']) && ($_GET['page'] > 1)) $rows = $_GET['page'] * MAX_DISPLAY_SEARCH_RESULTS_REPORTS - MAX_DISPLAY_SEARCH_RESULTS_REPORTS; $customers_query_raw = "select c.customers_id, c.customers_firstname, c.customers_lastname, b.entry_company, sum(op.products_quantity * op.final_price)+sum(op.onetime_charges) as ordersum from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o, " . TABLE_ADDRESS_BOOK . " b where c.customers_id = o.customers_id and o.orders_id = op.orders_id and c.customers_default_address_id = b.address_book_id group by b.entry_company order by ordersum DESC"; $customers_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_REPORTS, $customers_query_raw, $customers_query_numrows); // fix counted customers $customers_query_m = $db->Execute("select customers_id from " . TABLE_ORDERS . " group by customers_id");

Tina