I need category_id in onAfterCategoryCreate event
- progreccor
-
Topic Author
- Offline
- SEO, webdesign
Less
More
9 years 5 months ago #267105
by progreccor
Я не явлюсь официальной службой поддержки!
Я здесь добровольно!
Хочешь получить купон на скидку Hikashop? Спроси меня как!
I need category_id in onAfterCategoryCreate event was created by progreccor
I try to create my own plugin and read the docs about it.
here is:
I think that I can get category_id but when debug this event - I can't. It empty...
Why?
here is:
Code:
onAfterCategoryCreate(&$element)
This function will be triggered by HikaShop after a category is created successfully. The $element variable will be an object with the category information as attributes of the object including the category_id
I think that I can get category_id but when debug this event - I can't. It empty...
Why?
Я не явлюсь официальной службой поддержки!
Я здесь добровольно!
Хочешь получить купон на скидку Hikashop? Спроси меня как!
Please Log in or Create an account to join the conversation.
9 years 5 months ago #267120
by Jerome
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.
Replied by Jerome on topic I need category_id in onAfterCategoryCreate event
Hello,
Please modify the HikaShop category class in order to place the trigger call after the category_id is set in the object
Replacing
By
So you will have that information in the "onAfterCategoryCreate" event.
We will update the package in our side.
Regards,
Please modify the HikaShop category class in order to place the trigger call after the category_id is set in the object
Replacing
Code:
if($new)
$dispatcher->trigger( 'onAfterCategoryCreate', array( & $element ) );
else
$dispatcher->trigger( 'onAfterCategoryUpdate', array( & $element ) );
if(empty($element->$pkey)) {
$element->$pkey = $status;
if($ordering) {
/* ... */
}
}
Code:
if($new) {
$element->$pkey = $status;
$dispatcher->trigger( 'onAfterCategoryCreate', array( & $element ) );
} else
$dispatcher->trigger( 'onAfterCategoryUpdate', array( & $element ) );
if($new && $ordering) {
/* ... */
}
We will update the package in our side.
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: progreccor
Please Log in or Create an account to join the conversation.
Time to create page: 0.146 seconds