Jump to content

Edit History

SmartPlugs

SmartPlugs

I do that in one of mines.

I first declare and leave empty the getContent() method (module main file) :

public function getContent() {}

This will force PrestaShop to display the "configure" button.

Then i plug the module on the "actionDispatcher" hook and add the following code (example) in the hookActionDispatcher() méthod :

public function hookActionDispatcher($args)
{
	if (defined('_PS_ADMIN_DIR_')) {
		if (isset($args['controller_class']) && $args['controller_class'] == 'AdminModulesController') {
			if (Tools::getValue('configure') == '_your_module_name_') {
				$link = new Link();
				Tools::redirectAdmin($link->getAdminLink('_your_controller_tab_name_'));
			}
		}
	}
}

 

SmartPlugs

SmartPlugs

I do that in one of mines.

I first decla and leave empty the getContent() method (module main file) :

public function getContent() {}

This will force PrestaShop to display the "configure" button.

Then i plug the module on the "actionDispatcher" hook and add the following code (example) in the hookActionDispatcher() méthod :

public function hookActionDispatcher($args)
{
	if (defined('_PS_ADMIN_DIR_')) {
		if (isset($args['controller_class']) && $args['controller_class'] == 'AdminModulesController') {
			if (Tools::getValue('configure') == '_your_module_name_') {
				$link = new Link();
				Tools::redirectAdmin($link->getAdminLink('_your_controller_tab_name_'));
			}
		}
	}
}

 

×
×
  • Create New...