- Posts: 640
- Thank you received: 16
To force saving related triggers
- PeterChain
-
Topic Author
- Offline
Less
More
9 years 9 months ago #258290
by PeterChain
To force saving related triggers was created by PeterChain
-- HikaShop version -- : 3.6.4
-- Joomla version -- : 3.6.5
I build an alternative method of editing products for a very certain procedure so I edit some fields from the product list via a from.
When the changes are saved the update related triggers are not called probably because my coder is notusing a standar HikaShop saving method.
Is there a way to force those triggers related with a saving process to be called?
-- Joomla version -- : 3.6.5
I build an alternative method of editing products for a very certain procedure so I edit some fields from the product list via a from.
When the changes are saved the update related triggers are not called probably because my coder is notusing a standar HikaShop saving method.
Is there a way to force those triggers related with a saving process to be called?
Please Log in or Create an account to join the conversation.
9 years 9 months ago #258296
by nicolas
Replied by nicolas on topic To force saving related triggers
Hi,
Sure. You can just use the same code that is used in the save function of the class.product file so that it triggers the triggers the same way:
Sure. You can just use the same code that is used in the save function of the class.product file so that it triggers the triggers the same way:
Code:
JPluginHelper::importPlugin('hikashop');
$dispatcher = JDispatcher::getInstance();
$do = true;
$dispatcher->trigger('onBeforeProductCreate', array( & $element, & $do) );
if(!$do)
return false;
// your code to store the data
$dispatcher->trigger( 'onAfterProductCreate', array( & $element ) );
The following user(s) said Thank You: PeterChain
Please Log in or Create an account to join the conversation.
Time to create page: 0.165 seconds