Skip to main content

Address id field doesn't appear in onAfterAddressCreate

More
8 years 4 months ago #292472 by PeterChain
-- 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.

More
8 years 4 months ago #292480 by Jerome
Hello,

Indeed, the "address_id" is not populate in the HikaShop address class.
You need to edit the file and replace
Code:
$dispatcher->trigger( 'onAfterAddressCreate', array( &$addressData ) );
By
Code:
$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.
The following user(s) said Thank You: PeterChain

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

More
8 years 4 months ago #292492 by PeterChain
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.173 seconds
Powered by Kunena Forum