@@ -69,7 +69,7 @@ public function __construct()
6969 {
7070 $ this ->name = 'ps_mainmenu ' ;
7171 $ this ->tab = 'front_office_features ' ;
72- $ this ->version = '2.3.4 ' ;
72+ $ this ->version = '2.3.5 ' ;
7373 $ this ->author = 'PrestaShop ' ;
7474 $ this ->imageFiles = null ;
7575
@@ -136,7 +136,10 @@ public function installDb()
136136 `label` VARCHAR( 128 ) NOT NULL ,
137137 `link` VARCHAR( 128 ) NOT NULL ,
138138 INDEX ( `id_linksmenutop` , `id_lang`, `id_shop`)
139- ) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8mb4; ' );
139+ ) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8mb4; ' ) &&
140+ Db::getInstance ()->execute ('
141+ INSERT IGNORE INTO ` ' . _DB_PREFIX_ . 'hook` (`name`, `title`, `description`) VALUES
142+ ( \'actionMainMenuModifier \', \'Modify main menu view data \', \'This hook allows to alter main menu data \'); ' );
140143 }
141144
142145 public function uninstall ($ delete_params = true )
@@ -1489,8 +1492,12 @@ public function getWidgetVariables($hookName, array $configuration)
14891492
14901493 public function renderWidget ($ hookName , array $ configuration )
14911494 {
1495+ $ menu = $ this ->getWidgetVariables ($ hookName , $ configuration );
1496+
1497+ Hook::exec ('actionMainMenuModifier ' , ['menu ' => &$ menu ]);
1498+
14921499 $ this ->smarty ->assign ([
1493- 'menu ' => $ this -> getWidgetVariables ( $ hookName , $ configuration ) ,
1500+ 'menu ' => $ menu ,
14941501 ]);
14951502
14961503 return $ this ->fetch ('module:ps_mainmenu/ps_mainmenu.tpl ' );
0 commit comments