3

I have created a custom module to sync product details. There is a cron job configured to run model "my_module/Cron::syncDetail". I would like to convert this to a manual job in admin menu.

The syncDetail function in Cron.php is executing

Mage::getModel('My_Module_Model_Product')->syncDetails();

i have managed to create the admin menu drop down, however i can't figure out what to put in the action of the menu.

my question is what is the correct action to directly call the model function?

liyakat
  • 3,995
  • 7
  • 27
  • 35
gUo
  • 51
  • 1

2 Answers2

4

Another option you may be interested in, which allows you to keep the current cron job setup, as well as run it manually, is to install AOE Scheduler. It is a highly regarded extension for working with cron jobs and one of its abilities is to run jobs directly from Magento Admin.

fantasticrice
  • 990
  • 9
  • 19
3

You can not call the model function directly from the admin menu. You need to implement a controller which calls the model function. Your menu entry should target the controller action. For moe information please refer to: http://alanstorm.com/magento_admin_controllers

luemic
  • 504
  • 3
  • 8