Jump to content
shep68

Obtenir la liste des clients qui ont commandés produit x

Recommended Posts

Posted (edited)

Bonjour 🙂

J'aimerai obtenir le liste des clients (e-mail en particulier) en fonction du produit. Dans l'objectif d’envoyer un email à tous les clients qui ont choisit le produit x (au moins il peut y avoir d"autres produits YZ inclus)

Je pense pouvoir faire cela avec le Gestionnaire SQL de Prestashop 1.6.1.24 ?

Merci

 

 

Edited by shep68
précision (see edit history)

Share this post


Link to post
Share on other sites
Posted (edited)

Essayez ceci :

 

SELECT c.email
FROM ps_customer c
LEFT JOIN ps_orders o ON (c.id_customer = o.id_customer)
LEFT JOIN ps_order_detail od ON (o.id_order = od.id_order)
WHERE od.product_id =  2 //Set your product ID
GROUP BY 1

 

Edited by idnovate.com (see edit history)
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Le 05/04/2020 à 6:40 PM, idnovate.com a dit :

Essayez ceci :

 


SELECT c.email
FROM ps_customer c
LEFT JOIN ps_orders o ON (c.id_customer = o.id_customer)
LEFT JOIN ps_order_detail od ON (o.id_order = od.id_order)
WHERE od.product_id =  2 //Set your product ID
GROUP BY 1

 

merci ça à l'air de fonctionner :) j'ai changé les tables "ps_" par "pss_" 

Merci encore

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More