WiseWombat Posted December 23, 2004 Posted December 23, 2004 Hi I'm curious as if you can display all new customers in your admin from the latest customer to the oldest customer in your data base by date rather then name. This would save time looking through your new customer list from A to Z ??? Thanks .Martin :blink: ( WARNING ) I think I know what Im talking about. BACK UP BACK UP BACK UP BACK UP
boxtel Posted December 23, 2004 Posted December 23, 2004 Hi I'm curious as if you can display all new customers in your admin from the latest customer to the oldest customer in your data base by date rather then name.This would save time looking through your new customer list from A to Z ??? Thanks .Martin :blink: <{POST_SNAPBACK}> yes, but not easy as you need to join the normal customers table with the customers_info table because there the create date is stored. Treasurer MFC
TCwho Posted February 17, 2005 Posted February 17, 2005 I was wondering was this possible? Hey thanks Martin! Drop_Shadow How Did You Hear About Us Email HTML Order Link ---- GMT -5:00
boxtel Posted February 17, 2005 Posted February 17, 2005 I was wondering was this possible? Hey thanks Martin! <{POST_SNAPBACK}> replace this query in customers.php : $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname"; with this one : $customers_query_raw = " select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id, ci.customers_info_date_account_created from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " a, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id and c.customers_id = ci.customers_info_id " . $search . " order by ci.customers_info_date_account_created desc, c.customers_lastname, c.customers_firstname"; Treasurer MFC
burt Posted February 17, 2005 Posted February 17, 2005 There's really no need to look up the new table...you can get the same functionality by; $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_id DESC"; This assumes of course that you don't want/need to actually do anything with the "date account created".
gregy Posted February 17, 2005 Posted February 17, 2005 there is contribution for this .. it works .. i have tested it .. but you cannot do search for Customers with this contribution ! i already posted this in Contribution section, but there was no reply
TCwho Posted February 17, 2005 Posted February 17, 2005 Martin has a link in his signature: In catalog/admin/customers.php Find this (around line 719): $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname"; Replace with this (comments out exissting code and adds new code with new sort order): //<!--- $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname";---> $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id, ci.customers_info_date_account_created from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " a, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id and c.customers_id = ci.customers_info_id " . $search . " order by ci.customers_info_date_account_created desc, c.customers_lastname, c.customers_firstname"; Drop_Shadow How Did You Hear About Us Email HTML Order Link ---- GMT -5:00
TCwho Posted February 17, 2005 Posted February 17, 2005 there is contribution for this .. it works .. i have tested it .. but you cannot do search for Customers with this contribution ! i already posted this in Contribution section, but there was no reply <{POST_SNAPBACK}> Ahh Man! Your right! You must be talking about Martin's Contribution. I just tried to do a search and it gave me an error.... ...Maybe Burt or Amanda's code.....hmmmmmm Drop_Shadow How Did You Hear About Us Email HTML Order Link ---- GMT -5:00
gregy Posted February 17, 2005 Posted February 17, 2005 Ahh Man! Your right! You must be talking about Martin's Contribution. I just tried to do a search and it gave me an error.... ...Maybe Burt or Amanda's code.....hmmmmmm <{POST_SNAPBACK}> here you go click
gregy Posted February 17, 2005 Posted February 17, 2005 here you go click <{POST_SNAPBACK}> ops sorry .. i thought it gives you error when searching for this contribution :)))
TCwho Posted February 17, 2005 Posted February 17, 2005 Tried Boxtel's code and got error when I tried to do a search. Tried Burt's code and NO Error when I tried to do a search for a customer. Hey Burt I think many people would like to have this type of functionality in their admin>>customers ...maybe post in Tips&Tricks....or upload your code fixing Martin's contribution.... Thanks Burt! And Thanks Amanda! :::Edited::: I thought thats what you thought I meant. I had a small laugh... Use Burts code Greg..works without any problems. Drop_Shadow How Did You Hear About Us Email HTML Order Link ---- GMT -5:00
gregy Posted February 17, 2005 Posted February 17, 2005 Tried Boxtel's code and got error when I tried to do a search. Tried Burt's code and NO Error when I tried to do a search for a customer. Hey Burt I think many people would like to have this type of functionality in their admin>>customers ...maybe post in Tips&Tricks....or upload your code fixing Martin's contribution.... Thanks Burt! And Thanks Amanda! :::Edited::: I thought thats what you thought I meant. I had a small laugh... Use Burts code Greg..works without any problems. <{POST_SNAPBACK}> yeahh .. it really works .. thanx a lot.
burt Posted February 17, 2005 Posted February 17, 2005 No worries. Glad it helped. I did make a larger contribution a long time ago (since updated by others): http://www.oscommerce.com/community/contributions,223 ;)
WiseWombat Posted February 18, 2005 Author Posted February 18, 2005 No worries. Glad it helped. I did make a larger contribution a long time ago (since updated by others): http://www.oscommerce.com/community/contributions,223 ;) <{POST_SNAPBACK}> Thanks Burt! And Thanks Amanda! The original contribution was made be amanda I just thought I would post is as I thought it was a good idea to use this feature. I didnt release that there was an error in the customers search bar? I have tried burts code and it tests fine. I will up load the fix.. Thanks. ( WARNING ) I think I know what Im talking about. BACK UP BACK UP BACK UP BACK UP
Recommended Posts
Archived
This topic is now archived and is closed to further replies.