How to invoke mass action externally

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #231007

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8

I want a button or a link in frontend to invoke the execution of a mass action.

Is there a simple way to obtain a URL for this?

I donw't want a cron configuration, just to call the mass action on demand.

Thank you.

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
8 years 1 month ago #231018

Hi,

It would require a new system plugin implementing the trigger onMassactionTableTriggersLoad(&$table, &$triggers, &$triggers_html, &$loadedData) (to add a new trigger for your link URL) like we do in the plugins/system/hikashopmassaction plugin with the cron task triggers.
Then in your plugin add a second trigger onAfterRoute and look at $_REQUEST to identify the parameters of your specific URL and call the massactionClass->_trigger function like in the onHikashopCronTrigger of the system hikashopmassaction plugin.

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

Time to create page: 0.056 seconds
Powered by Kunena Forum