- Posts: 640
- Thank you received: 16
Address id field doesn't appear in onAfterAddressCreate
- PeterChain
-
Topic Author
- Offline
Less
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
-- 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.
8 years 4 months ago #292480
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Address id field doesn't appear in onAfterAddressCreate
Hello,
Indeed, the "address_id" is not populate in the HikaShop address class.
You need to edit the file and replace
By
Be sure that we will also include the patch in our end.
Regards,
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 ) );
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.
- PeterChain
-
Topic Author
- Offline
Less
More
- Posts: 640
- Thank you received: 16
8 years 4 months ago #292492
by PeterChain
Replied by PeterChain on topic Address id field doesn't appear in onAfterAddressCreate
Thanks a lot for the answer!
Now it works!
--
Victor
Now it works!
--
Victor
Please Log in or Create an account to join the conversation.
Time to create page: 0.173 seconds