Plugin that implements onUserAfterSave not firing

  • Posts: 26
  • Thank you received: 2
22 hours 26 minutes ago #366782

-- HikaShop version -- : 5.1.5
-- Joomla version -- : 4.4.13
-- PHP version -- : 8.1.32

Hello,
I (vibe)coded a plugin to update my Mailchimp contacts with a new tag. My intention was that if they purchase on my site using Hikashop, they get tagged as a client.
The plugin implements the onUserAfterSave event and works if I save the user using the com_users component.
But the plugin won't fire after Hikashop creates a new user on my site, for instance during the order process.
My understanding is that Hikashop implements its own user API with onAfterUserCreate(&$element)
Does this mean I need to explicitly call this function in my plugin, if I want full integration with Hikashop?
Thanks in advance,
Brett

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

  • Posts: 83604
  • Thank you received: 13535
  • MODERATOR
8 hours 19 minutes ago #366785

Hi,

Please note that we developed a plugin to do exactly this and released it a bit more than 1 month ago. It's available on our marketplace here:
www.hikashop.com/marketplace/product/288...-with-mailchimp.html
This might be an easy solution for you instead of developing something from scratch.

And yes, onUserAfterSave is a Joomla event. So, if you save a user in HikaShop that event won't be called because HikaShop is not modified the Joomla user information. Only the HikaShop user information is modified.
So you would need to implement the onAfterUserCreate event so that your plugin is called when a user is saved in HikaShop, if that's what you need.

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

Time to create page: 0.053 seconds
Powered by Kunena Forum