Jump to content

list of customers who bought items from specific category


tanse

Recommended Posts

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

obrazek.thumb.png.221acfa66096584b47779482a21f30a9.png

Edited by 4you.software (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...