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

Make Company Name Primary in Orders

Locked

Started by charmedbytina2 on 26 Nov 2008, 5:27 PM · Views: 2,604

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:04 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Make Company Name Primary in Orders

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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