Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2007
    Location
    AZ
    Posts
    1,911
    Plugin Contributions
    2

    Default 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

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default 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.

  3. #3
    Join Date
    Mar 2007
    Location
    AZ
    Posts
    1,911
    Plugin Contributions
    2

    Default 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!

    Tina

  4. #4
    Join Date
    Mar 2007
    Location
    AZ
    Posts
    1,911
    Plugin Contributions
    2

    Default Re: Make Company Name Primary in Orders

    Ok. I finally got around to trying this and no success.

    No changes noted in admin display after the two files were changed and the database altered.

    Tina

  5. #5
    Join Date
    Mar 2007
    Location
    AZ
    Posts
    1,911
    Plugin Contributions
    2

    Default 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

  6. #6
    Join Date
    Mar 2007
    Location
    AZ
    Posts
    1,911
    Plugin Contributions
    2

    Default 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']; ?>&nbsp;&nbsp;</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']); ?>&nbsp;</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']; ?>&nbsp;&nbsp;</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']); ?>&nbsp;</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
    Last edited by charmedbytina2; 4 Jan 2009 at 07:01 PM.

 

 

Similar Threads

  1. v151 Displaying the company name in the admin orders
    By wekalegs in forum General Questions
    Replies: 5
    Last Post: 23 Apr 2013, 10:39 PM
  2. How to make Company Name required?
    By angelstubes in forum Managing Customers and Orders
    Replies: 1
    Last Post: 30 Oct 2009, 12:34 AM
  3. How to make Company Name Available but NOT required?
    By pettreatsplus in forum Managing Customers and Orders
    Replies: 12
    Last Post: 5 Sep 2009, 06:48 PM
  4. How to make "Company Name" a required field?
    By hllight in forum General Questions
    Replies: 4
    Last Post: 15 Feb 2009, 04:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR