Report for first time customers

  • Posts: 75
  • Thank you received: 5
  • Hikashop Business
2 months 3 weeks ago #336460

-- HikaShop version -- : 4.4.3

We would like to reach out to customers who have purchased for the first time. I'm having trouble finding out how to get a report for that. Any suggestions? It could just be a report for customers with a confirmed order value of 1.

Thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 74542
  • Thank you received: 11497
  • MODERATOR
2 months 3 weeks ago #336474

Hi,

You could get a listing of all the customers with their number of orders with a report with the display mode "listing" on "customers" with the "ordering" setting set to "orders". However, the first customers of the listing will be the ones with the most sales.
And if you have a lot of customers, you might not be able to display them all to export the CSV of all the data so that you can then open the CSV in Excel to remove the rows with a count greater than one.
A simple alternative would be to just run a MySQL query in your PHPMyAdmin to get the data.
Something like that:

SELECT u.user_email,count(o.order_id) AS number_of_orders FROM #__hikashop_user AS u LEFT JOIN #__hikashop_order AS o ON o.order_user_id = u.user_id WHERE o.order_status IN ('confirmed','shipped') GROUP BY u.user_id ORDER BY number_of_orders ASC
where #__ needs to be replaced by the prefix of tables available in your Joomla configuration.

Last edit: 2 months 3 weeks ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 75
  • Thank you received: 5
  • Hikashop Business
2 months 3 weeks ago #336507

First of all, you are awesome. The SQL query works if I change the end to "ORDER BY u.user_id DESC". This essentially shows me the latest users and I can pick out the ones who have an order number of 1.

Thanks!

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum