Delete spam users hikashop

  • Posts: 37
  • Thank you received: 0
6 years 11 months 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: 82863
  • Thank you received: 13372
  • MODERATOR
6 years 11 months 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
6 years 11 months 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: 82863
  • Thank you received: 13372
  • MODERATOR
6 years 11 months 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.

  • Posts: 158
  • Thank you received: 5
2 years 6 months ago #341392

I had the same issue and I used the mass action tool to get rid of all but Customers with orders. This deleted over 260000 Hikashop users, but they are still showing up in the SQL database. How do I get rid of these please? Which field do I need to use in the Db?

Thank you.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 6 months ago #341395

Hi,

Well, if you deleted these users in hikashop_user then they are not there.
Do you mean that they still show up in Joomla's user manager ?
Please provide more details on the situation.

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

  • Posts: 158
  • Thank you received: 5
2 years 6 months ago #341401

My mistake, I had left the limitation field in the mass action set to the default value so it was only looking at the first 500 records!

Deleting 260,000 users took quite a while.

The following user(s) said Thank You: nicolas

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

Time to create page: 0.074 seconds
Powered by Kunena Forum