Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,696
    Plugin Contributions
    123

    Default Re: Help needed for Mautic tracking code

    Just add an order by to your query.

    ORDER BY orders_id DESC LIMIT 1
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  2. #12
    Join Date
    Mar 2005
    Posts
    229
    Plugin Contributions
    0

    Default Re: Help needed for Mautic tracking code

    Quote Originally Posted by swguy View Post
    Just add an order by to your query.

    ORDER BY orders_id DESC LIMIT 1
    I think I misunderstood cause
    Code:
    SELECT
        customers.customers_id, 
        customers.customers_firstname, 
        customers.customers_lastname, 
        customers.customers_email_address, 
        customers_info.customers_info_date_of_last_logon, 
        customers_info.customers_info_number_of_logons, 
        customers_info.customers_info_date_account_last_modified, 
        customers_info.customers_info_date_account_created, 
        orders.order_total, 
        SUM(orders.order_total) AS zc_orders_tot, 
        SUBSTRING_INDEX(orders.ip_address,' - ',1) AS ip_address1, 
        SUBSTRING_INDEX(orders.ip_address,' - ',-1) AS ip_address2, 
        reward_customer_points.reward_points, 
        reward_customer_points.pending_points, 
        customers.customers_newsletter, 
        customers.customers_dob, 
        customers.customers_gender, 
        customers.customers_email_format, 
        orders.date_completed, 
        orders.date_purchased
    FROM
        customers
        LEFT JOIN
        customers_info
        ON 
            customers.customers_id = customers_info.customers_info_id
        LEFT JOIN
        orders
        ON 
            customers.customers_id = orders.customers_id
        LEFT JOIN
        reward_customer_points
        ON 
            customers.customers_id = reward_customer_points.customers_id
    GROUP BY
        customers.customers_id
    ORDER BY orders_id DESC
    still returns the amount of customers first order not last.

  3. #13
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,696
    Plugin Contributions
    123

    Default Re: Help needed for Mautic tracking code

    you don't need the GROUP BY
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #14
    Join Date
    Mar 2005
    Posts
    229
    Plugin Contributions
    0

    Default Re: Help needed for Mautic tracking code

    Quote Originally Posted by swguy View Post
    you don't need the GROUP BY
    I removed and the answer stays the same. Could you please elaborate or post your complete query.

    Thanks

  5. #15
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: Help needed for Mautic tracking code

    Shouldn't there be a WHERE clause within that query so that you're pulling the information for the currently-logged-in customer?

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 3
    Last Post: 13 Jul 2009, 05:19 AM
  2. Sales tracking code...HELP!
    By blackhalo in forum General Questions
    Replies: 3
    Last Post: 10 Jun 2008, 04:43 AM
  3. Sales tracking code for checkout success, please help!
    By boinkit in forum General Questions
    Replies: 0
    Last Post: 6 Mar 2008, 06:08 PM
  4. Code for Tracking Purposes
    By smartmomma in forum All Other Contributions/Addons
    Replies: 10
    Last Post: 17 Oct 2006, 10:13 PM
  5. Variables needed for Javascript - order tracking
    By smartmomma in forum Basic Configuration
    Replies: 0
    Last Post: 10 Sep 2006, 07:08 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