Delete spam users hikashop

  • Posts: 37
  • Thank you received: 0
9 months 2 weeks ago #283969

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.6.3

We have a hikashop store where we have total number of orders as 10854 but the total number of customers are 118555 which means there are a lot of spam users present in DB. Now, we have integrated captcha to prevent the spam in future.

We need to know the way of deleting the Hikashop users who have registered but didn't placed any orders in past 1 month. Could you please assist here. If you can share DB query to fetch & delete the users, it will also be helpful.

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

  • Posts: 63322
  • Thank you received: 9128
  • MODERATOR
9 months 2 weeks ago #283974

Hi,

You can use the mass action system for that:

You can for example create a mass action like that to delete all the customers without a confirmed order :
monosnap.com/file/JhFLXjNCpnxc9rAKKuUUNG7i5E5nyA
There is no way to set a "more than 1 month old" condition there though.
Actually, if you don't set any filter, it will delete only the users without an order as HikaShop will refuse to delete users with orders. The orders would have to be deleted first.
And note that while this will delete the "customer" entry in HikaShop, it won't delete the user account in Joomla (but "guest" users will be completely removed).

If you want to do it in MySQL and supposing that you want to delete the user accounts from Joomla, you'll have to have a DELETE query on the joomla users table with joins to the hikashop_user table on the users.id = hikashop_user.user_cms_id and on the hikashop_order table on the hikashop_user.user_id = hikashop_order.order_user_id, and a condition on hikashop_order.order_status if you want to take into account only non confirmed OR shipped orders, and a condition on hikashop_order.order_created if you want to have a "only less than 1 month old orders" condition.

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

  • Posts: 37
  • Thank you received: 0
9 months 2 weeks ago #284029

Hi,

Thanks for the update here. So, if we just want to delete the cusotmers (leave joomla users) who never placed any orders and if we choose mass actions, then how we can make sure that the guest users will not be deleted? Is there any way to keep them from mass actions delete?

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

  • Posts: 63322
  • Thank you received: 9128
  • MODERATOR
9 months 2 weeks ago #284042

Hi,

Yes. The guest users have their user_cms_id column at 0 in the hikashop_user table.
So in your mass action, you can add a filter on that column being different from 0 and it will only target customers with a user account.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum