[Skip to main content](#vessel-content)

#   Deleting users in Joomla

##

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile") Topic Author
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 8 months ago [\#9093](#9093) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  *[Deleting users in Joomla](/forum/3-bug-report/9093-deleting-users-in-joomla#9093 "I seem to recall something about this elsewhere, but could not find it.  Registered 2 users in registration screen (cart empty, neither purchased anything).  Deleted both users in Joomla User admin.  Row deleted from Hikasop users table but not from the address table.  Tried again this time deleting through Hikashop customers - again records in address table not deleted.")* was created by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")*

I seem to recall something about this elsewhere, but could not find it.

Registered 2 users in registration screen (cart empty, neither purchased anything).

Deleted both users in Joomla User admin.

Row deleted from Hikasop users table but not from the address table.

Tried again this time deleting through Hikashop customers - again records in address table not deleted.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC85MDkzLWRlbGV0aW5nLXVzZXJzLWluLWpvb21sYT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14267
-
-

15 years 8 months ago [\#9105](#9105) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Deleting users in Joomla](/forum/3-bug-report/9093-deleting-users-in-joomla#9105 "I seem to recall something about this elsewhere, but could not find it.  Registered 2 users in registration screen (cart empty, neither purchased anything).  Deleted both users in Joomla User admin.  Row deleted from Hikasop users table but not from the address table.  Tried again this time deleting through Hikashop customers - again records in address table not deleted.")*

It's possible that there is a piece of code missing in order to handle that. No one reported it so far since it doesn't create any bug on the interface.

We'll look at that...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC85MDkzLWRlbGV0aW5nLXVzZXJzLWluLWpvb21sYT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14267
-
-

15 years 8 months ago [\#9112](#9112) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Deleting users in Joomla](/forum/3-bug-report/9093-deleting-users-in-joomla#9112 "I seem to recall something about this elsewhere, but could not find it.  Registered 2 users in registration screen (cart empty, neither purchased anything).  Deleted both users in Joomla User admin.  Row deleted from Hikasop users table but not from the address table.  Tried again this time deleting through Hikashop customers - again records in address table not deleted.")*

If you edit the file adminsitrator/components/com_hikashop/classes/user.php and add the code:
if($result){
$address = hikashop::get('class.address');
$addresses = $address-&gt;loadUserAddresses($el);
$address-&gt;delete(array_keys($addresses));
}
after the line:
$result = parent::delete($el);
that should solve the problem.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC85MDkzLWRlbGV0aW5nLXVzZXJzLWluLWpvb21sYT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile") Topic Author
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 8 months ago [\#9146](#9146) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: Deleting users in Joomla](/forum/3-bug-report/9093-deleting-users-in-joomla#9146 "I seem to recall something about this elsewhere, but could not find it.  Registered 2 users in registration screen (cart empty, neither purchased anything).  Deleted both users in Joomla User admin.  Row deleted from Hikasop users table but not from the address table.  Tried again this time deleting through Hikashop customers - again records in address table not deleted.")*

Almost worked, wrong parameter passed to address-&gt;delete().
Also added another message - testing Hikashop with other components which output their own "user has been deleted messages", so looks better having a Hikashop message as well.
Code:

$result = parent::delete($el); if($result){ $address = hikashop::get('class.address'); $addresses = $address-&gt;loadUserAddresses($el); foreach ($addresses as $a) { $address-&gt;delete($a-&gt;address_id); } $app =&amp; JFactory::getApplication(); $app-&gt;enqueueMessage('User deleted from Hikashop.'); }

Would it be possible to add a configuration option so that when selected deleting a customer via the customer screen will also delete the Joomla user? Need to be careful here that someone does not accidently delete an administrator / super administrator account - I think there was another post about prevent certain users being Hikashop customers - I have been registering test users but someone else went in as themselves (administrator) and tested order creation - something I would like to see prevented.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC85MDkzLWRlbGV0aW5nLXVzZXJzLWluLWpvb21sYT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14267
-
-

15 years 8 months ago [\#9156](#9156) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Deleting users in Joomla](/forum/3-bug-report/9093-deleting-users-in-joomla#9156 "I seem to recall something about this elsewhere, but could not find it.  Registered 2 users in registration screen (cart empty, neither purchased anything).  Deleted both users in Joomla User admin.  Row deleted from Hikasop users table but not from the address table.  Tried again this time deleting through Hikashop customers - again records in address table not deleted.")*

Indeed, the parameter should be an int and not the array of ids. We corrected on our end. We won't add the specific message. It should be enough to just have the main message. We want to try to keep the language file as small as possible. ( it's already more than 1000 lines )
Besides, there is already a message displayed when you delete a user in hikashop so you would have to add a check to display only the message when not in hikashop.
For the deletion of the joomla user when deleting a customer in HikaShop, we'll add that to the todo list but as a low priority... There are already loads of options in HikaShop and users already get lost in them so adding one more just for that doesn't feel like a plus.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC85MDkzLWRlbGV0aW5nLXVzZXJzLWluLWpvb21sYT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.139 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
