To force saving related triggers

  • Posts: 634
  • Thank you received: 16
7 years 10 months ago #258290

-- 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?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 10 months ago #258296

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:

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.052 seconds
Powered by Kunena Forum