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

    Default Re: zen cart delete customer by last login date

    That just puts an item in the menu. You need to edit the admin/delete_spam_customers.php and add a new query there.

    find the last $queries entry and right after it add:

    $queries[] = array(
    'name' => 'No login for 2 years',
    'string' => "SELECT customers_info_id as customers_id FROM " . TABLE_CUSTOMERS_INFO . " WHERE customers_info_date_of_last_logon < '" . date('Y-m-d', strtotime("-2 years")) . "'");

    Make a backup before you do this!
    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
    Jul 2011
    Posts
    47
    Plugin Contributions
    0

    Default Re: zen cart delete customer by last login date

    In order to do this to get rid of the customers with 'blank' last logins who still escaped the purge of that code, by switching it to people who haven't ordered in two years, I should simply change the above code to "WHERE customers_date_of_last_order < '" instead, is that right?

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

    Default Re: zen cart delete customer by last login date

    There's no such field as customers_date_of_last_order.
    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
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: zen cart delete customer by last login date

    Quote Originally Posted by Heresy Miniatures View Post
    In order to do this to get rid of the customers with 'blank' last logins who still escaped the purge of that code, by switching it to people who haven't ordered in two years, I should simply change the above code to "WHERE customers_date_of_last_order < '" instead, is that right?
    Quote Originally Posted by swguy View Post
    There's no such field as customers_date_of_last_order.
    To do that lookup requires a review of the orders table.

    This "other" group though of individuals. Saying that somehow they have an empty date of last login. Ok. But then to address removal of someone that hasn't ordered in the last 2 years? Can you explain the relationship you're trying to use? What about someone that just created their account yesterday or even 30 minutes ago. They may not have ordered yet, but also indicating that it seems such individuals have some sort of empty last login field. So... trying to understand what criteria are to be (further) met to address the data?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #15
    Join Date
    Jul 2011
    Posts
    47
    Plugin Contributions
    0

    Default Re: zen cart delete customer by last login date

    Good point - basically when I look at the list of customers, and sort it by Last Logon ASC, there are people who, says, created their account in 2012, made one order, in 2012, and then never logged in again after that. On the list of customers in Admin, they have a blank entry under Last Login, and if I check the side menu for more specific info, it says eg
    Last Logon: [blank space, no entry]
    Number of logons: 0
    I really shouldn't have any data kept on customers from 10 years ago, I expect GDPR comes into play or something

    So in an ideal world, i'd look to delete anybody with 0 logins whose account was also created before 2 years ago, maybe?
    Or somebody whose account was created more than 2 years ago with only 1 order on it, or 0 orders?

    My knowledge of coding is entirely based on what I read in, (and copy and paste from) these threads so thanks for any guidance

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Curious: Customer Account Create, but Last Login Blank
    By chadderuski in forum General Questions
    Replies: 4
    Last Post: 17 Feb 2013, 04:50 PM
  2. Delete customer carts older than date X (SQL help?)
    By bodyjewelrystores in forum General Questions
    Replies: 10
    Last Post: 1 Mar 2010, 03:36 PM
  3. Replies: 7
    Last Post: 25 Jan 2009, 06:00 AM
  4. Admin-Customer Last Login ip address lookup?
    By Justwade in forum General Questions
    Replies: 2
    Last Post: 20 Dec 2006, 08:01 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