Page 1 of 1

SQL: extract emails from customers who bought specific model (product)

Posted: Mon Jun 18, 2018 9:48 pm
by michael2820
PHPMyAdminn: I want to extract all emails from customers that bought certain model (product). Maybe I am lucky, that you know SQL and know the command to run ? I want to do this, because the Mail function in my OC 2.102 where you select Product as the receiver, does NOT work for me right now - I have issues with SMTP and Mail function in Settings

Re: PHPMyAdmin: extract emails from customers who bought specific model (product)

Posted: Mon Jun 18, 2018 10:41 pm
by MarketInSG

Code: Select all

SELECT email FROM `order` o LEFT JOIN order_product op ON op.order_id = o.order_id WHERE op.model = 'ABC'
The above will get you the emails for customers who purchased product model 'ABC'

Re: PHPMyAdmin: extract emails from customers who bought specific model (product)

Posted: Tue Jun 19, 2018 12:38 am
by michael2820
fantastic, thank you so much

Re: PHPMyAdmin: extract emails from customers who bought specific model (product)

Posted: Tue Jun 19, 2018 8:48 pm
by MarketInSG
glad to be of help :)

Re: PHPMyAdmin: extract emails from customers who bought specific model (product)

Posted: Sat Jun 23, 2018 3:36 am
by lovol2
I’m just at the testing stage of my mod/website that does this live. Eg 1 min after the purchase of a specific product. Then follow up with emails for up sells or down sells. Etc.

It’s worked amazing for me and got plenty of extra money. But most importantly my customers are getting the right combination of products.

Sometimes they just don’t read they need a specific cleaner to go with some of our products. .

Now they get an automatic email educating them. With buy links and coupons.

I only bring it up as it looks like your doing this as a one time manual thing.

I’ve a mod that automates this whole thing.

I’ll help you set it up no problem if you’re interested.

SQL extract emails customers who bought model FROM order_id 3.000 to order_id 4.000

Posted: Fri Jul 13, 2018 4:45 pm
by michael2820
Next question; what is SQL command to extract emails customers who bought model FROM order_id 3.000 to order_id 4.000?
Highly appreciated if you know that
Michael, Denmark

Re: SQL extract emails customers who bought model FROM order_id 3.000 to order_id 4.000

Posted: Tue Jul 17, 2018 10:22 pm
by MarketInSG
michael2820 wrote:
Fri Jul 13, 2018 4:45 pm
Next question; what is SQL command to extract emails customers who bought model FROM order_id 3.000 to order_id 4.000?
Highly appreciated if you know that
Michael, Denmark

Code: Select all

SELECT * email FROM oc_order o LEFT JOIN oc_order_product op ON op.order_id = o.order_id WHERE o.order_id >= 3000 AND o.order_id <= 4000 AND op.model = '1234'

Re: SQL: extract emails from customers who bought specific model (product)

Posted: Tue Jul 17, 2018 10:39 pm
by michael2820
thank U so much