Address id field doesn't appear in onAfterAddressCreate

  • Posts: 634
  • Thank you received: 16
6 years 6 months ago #292472

-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.3

Hi,

I'm developing a Hikashop plugin using two triggers from the Address Api:

1. onAfterAddressCreate

2. onAfterAddressUpdate



Case A:

onAfterAddressCreate the $element variable is not retrieving the new address_id, but is returning a 0 instead.

In the address table (#__hikashop_address) the row it's saved with the correct id.



Case B:

onAfterAddressUpdate trigger works fine,

I'm proceeding the incorrect way?

Thanks in advance.

--
Victor

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 6 months ago #292480

Hello,

Indeed, the "address_id" is not populate in the HikaShop address class.
You need to edit the file and replace

		$dispatcher->trigger( 'onAfterAddressCreate', array( &$addressData ) );
By
		$addressData->address_id = (int)$status;
		$dispatcher->trigger( 'onAfterAddressCreate', array( &$addressData ) );

Be sure that we will also include the patch in our end.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: PeterChain

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

  • Posts: 634
  • Thank you received: 16
6 years 6 months ago #292492

Thanks a lot for the answer!

Now it works!

--
Victor

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

Time to create page: 0.043 seconds
Powered by Kunena Forum