Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2012
    Location
    Melbourne, Australia
    Posts
    10
    Plugin Contributions
    0

    help question total sales on customer profile

    I have had a look at the customers.php page under admin and would like some advice as to how i should go about adding one field in on the customers page for total_sales (it could replace the GV balance as my store wont offer this service anyway and isnt really needed at this early stage.

    Then on the edit customer page how I would best add the total_sales from phporders table on this page? (if the customer has more than one purchase it will need to add this up so it is a true total sales). It can be view only as it doesn't need to be edited.

    Pretty much need to add the report customer orders total into the customers page so I can see totals to easily apply discounts based on the total sales.

    I hope someone could help point me in the right direction.
    Last edited by purple-heart; 20 Mar 2012 at 11:32 AM. Reason: added info

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: total sales on customer profile

    You can get the data by using the same select from the stats_customers.php and adapt it for the info that you want, example:
    Code:
    <?php
      $customers_total_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 ='" . $customers->fields['customers_id'] . "' and c.customers_id = o.customers_id and o.orders_id = op.orders_id group by c.customers_id order by ordersum DESC";
      $customers_total = $db->Execute($customers_total_query_raw);
    ?>
                    <td class="dataTableContent" align="right"><?php echo $currencies->format($customers_total->fields['ordersum']); ?></td>
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Mar 2012
    Location
    Melbourne, Australia
    Posts
    10
    Plugin Contributions
    0

    Default Re: total sales on customer profile

    Thanks Ajeh! I was going on that track myself but hadn't found what I was looking for in what query to use from that script yet but this helps thanks!

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: total sales on customer profile

    You are most welcome ... that should also give you additional info if you need it or a way to pull it up ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Mar 2012
    Location
    Melbourne, Australia
    Posts
    10
    Plugin Contributions
    0

    Default Re: total sales on customer profile

    thanks so much that is exactly what I was after thank-you!

 

 

Similar Threads

  1. v151 Customer Profile
    By thornhillguy in forum Customization from the Admin
    Replies: 1
    Last Post: 26 Feb 2013, 04:08 AM
  2. v150 How can I see Total sales of the customer in money terms?
    By purple-heart in forum General Questions
    Replies: 3
    Last Post: 20 Mar 2012, 12:37 PM
  3. Getting customer's profile
    By jacobmas in forum General Questions
    Replies: 0
    Last Post: 8 Apr 2011, 04:18 AM
  4. Customer profile
    By geobentley in forum PayPal Website Payments Pro support
    Replies: 1
    Last Post: 19 Feb 2011, 08:39 PM
  5. Disable Customer Profile logoin
    By HevvieEvvie in forum General Questions
    Replies: 2
    Last Post: 16 Sep 2008, 11:13 AM

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