grafis Posted June 6, 2013 Share Posted June 6, 2013 How can I export users with name, address and state information? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 7, 2013 Share Posted June 7, 2013 Well, in a completely raw format, make a simple backup of the whole database. CubeCart has no built-in Report Writer. If you want a human-designed report, you will need to use a database manager. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 7, 2013 Share Posted June 7, 2013 This should be the SQL statement to get a recordset of your customers. Once you have the record set, you can have the database manager (phpMyAdmin, for example) export it to an XML or CSV file. SELECT C.title,C.first_name,C.last_name,C.phone,C.email, A.billing,A.description,A.title,A.company_name,A.first_name,A.last_name, A.line1,A.line2,A.town,GZ.name,A.postcode,GC.iso3 FROM CubeCart_customer C LEFT JOIN CubeCart_addressbook A ON C.customer_id = A.customer_id JOIN CubeCart_geo_zone GZ ON A.state = GZ.id JOIN CubeCart_geo_country GC ON A.country = GC.numcode; Quote Link to comment Share on other sites More sharing options...
grafis Posted June 7, 2013 Author Share Posted June 7, 2013 Thanks that query returns exactly what we want! But only returns 71 of our 847 customers. I checked and at least 790 of the Customer ID's are in the Address book. Looking for why so few are returned. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 7, 2013 Share Posted June 7, 2013 Please state how many records are in the CubeCart_customer table. It may be the case where, in the address book table, the state column holds the name of the state rather than the more recent id number of the state. In that case, try this: SELECT C.title,C.first_name,C.last_name,C.phone,C.email, A.billing,A.description,A.title,A.company_name,A.first_name,A.last_name, A.line1,A.line2,A.town,A.state,GZ.name,A.postcode,GC.iso3 FROM CubeCart_customer C LEFT JOIN CubeCart_addressbook A ON C.customer_id = A.customer_id LEFT JOIN CubeCart_geo_zone GZ ON A.state = GZ.id JOIN CubeCart_geo_country GC ON A.country = GC.numcode; Quote Link to comment Share on other sites More sharing options...
grafis Posted June 7, 2013 Author Share Posted June 7, 2013 State it was! We have 846 customers, 806 address book entries. The second query posted above pulls 806, looks very good!! Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 7, 2013 Share Posted June 7, 2013 I wonder what the 40 difference may be? Quote Link to comment Share on other sites More sharing options...
grafis Posted June 7, 2013 Author Share Posted June 7, 2013 The diff I believe is the CubeCart 5's new address book system - you can register but no address is required. The owners for this site want to send out print catalogs so addy's are very important to them. Customer doesn't have to put in an address when they register, there's no email notice when the customer registers, and you can't export Customer information or addresses... Thanks big time for the query, it's helped on a major issue for this little shop. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.