tanse Posted November 22, 2022 Share Posted November 22, 2022 Hello everyone! Is there a way to create a list of customers who only bought products from a specific products catergory? Thanks for the help. Link to comment Share on other sites More sharing options...
Daresh Posted November 23, 2022 Share Posted November 23, 2022 It should be possible with some SQL query of medium complexity, rather not something that you can find in the back office. Link to comment Share on other sites More sharing options...
ps8modules Posted November 23, 2022 Share Posted November 23, 2022 (edited) Hi. Also functional in SQL Manager Prestashop admin->Advanced Parameters->Database->SQL Manager E.g. for id category = 4: SELECT a.id_customer, a.firstname, a.lastname, a.email FROM ps_customer a LEFT JOIN ps_orders o ON a.id_customer = o.id_customer LEFT JOIN ps_order_detail b ON o.id_order = b.id_order LEFT JOIN ps_category_product c ON b.product_id = c.id_product WHERE c.id_category = 4 GROUP BY a.id_customer Edited November 23, 2022 by 4you.software (see edit history) Link to comment Share on other sites More sharing options...
tanse Posted November 23, 2022 Author Share Posted November 23, 2022 2 hours ago, 4you.software said: I added the SQL here, but again the post is senselessly blocked 😄 Thank you. It gives me Undefined "checkedForm" error Link to comment Share on other sites More sharing options...
ps8modules Posted November 23, 2022 Share Posted November 23, 2022 (edited) And please, where does it give an error? Can you make a screenshot? Did you change the table prefix ps_ to your table prefix ? Thank you Edited November 23, 2022 by 4you.software (see edit history) Link to comment Share on other sites More sharing options...
tanse Posted November 23, 2022 Author Share Posted November 23, 2022 Link to comment Share on other sites More sharing options...
ps8modules Posted November 23, 2022 Share Posted November 23, 2022 Link to comment Share on other sites More sharing options...
ps8modules Posted November 23, 2022 Share Posted November 23, 2022 What is your version of Prestashop please? Link to comment Share on other sites More sharing options...
tanse Posted November 23, 2022 Author Share Posted November 23, 2022 1.7.5.2 Thank you for your help Link to comment Share on other sites More sharing options...
ps8modules Posted November 23, 2022 Share Posted November 23, 2022 (edited) I tested on my version 1.7.5.6 and everything works. When you put sql in phpMyAdmin, does it work? Edited November 23, 2022 by 4you.software (see edit history) Link to comment Share on other sites More sharing options...
tanse Posted November 23, 2022 Author Share Posted November 23, 2022 Not working 🤔 Nnot Link to comment Share on other sites More sharing options...
knacky Posted November 23, 2022 Share Posted November 23, 2022 Please, you must first select the database and then insert the sql. Link to comment Share on other sites More sharing options...
ps8modules Posted November 23, 2022 Share Posted November 23, 2022 Thank you @knacky, I just wanted to write the same thing. Link to comment Share on other sites More sharing options...
tanse Posted November 23, 2022 Author Share Posted November 23, 2022 It worked! Thank you! 1 Link to comment Share on other sites More sharing options...
ps8modules Posted November 24, 2022 Share Posted November 24, 2022 Hi. You can see that it is not a complicated sql 😉 You just edit the category id. I gladly helped. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now