@@ -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
@@ -100,6 +100,7 @@ public function install($delete_params = true)
100100 !$ this ->registerHook ('actionObjectProductDeleteAfter ' ) ||
101101 !$ this ->registerHook ('actionObjectProductAddAfter ' ) ||
102102 !$ this ->registerHook ('actionCategoryUpdate ' ) ||
103+ !$ this ->registerHook ('actionMetaPageSave ' ) ||
103104 !$ this ->registerHook ('actionShopDataDuplication ' ) ||
104105 !$ this ->registerHook ('displayTop ' )) {
105106 return false ;
@@ -136,7 +137,10 @@ public function installDb()
136137 `label` VARCHAR( 128 ) NOT NULL ,
137138 `link` VARCHAR( 128 ) NOT NULL ,
138139 INDEX ( `id_linksmenutop` , `id_lang`, `id_shop`)
139- ) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8mb4; ' );
140+ ) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8mb4; ' ) &&
141+ Db::getInstance ()->execute ('
142+ INSERT IGNORE INTO ` ' . _DB_PREFIX_ . 'hook` (`name`, `title`, `description`) VALUES
143+ ( \'actionMainMenuModifier \', \'Modify main menu view data \', \'This hook allows to alter main menu data \'); ' );
140144 }
141145
142146 public function uninstall ($ delete_params = true )
@@ -987,6 +991,11 @@ public function hookActionCategoryUpdate($params)
987991 $ this ->clearMenuCache ();
988992 }
989993
994+ public function hookActionMetaPageSave ($ params )
995+ {
996+ $ this ->clearMenuCache ();
997+ }
998+
990999 protected function getCacheDirectory ()
9911000 {
9921001 $ dir = _PS_CACHE_DIR_ . 'ps_mainmenu ' ;
@@ -1489,8 +1498,12 @@ public function getWidgetVariables($hookName, array $configuration)
14891498
14901499 public function renderWidget ($ hookName , array $ configuration )
14911500 {
1501+ $ menu = $ this ->getWidgetVariables ($ hookName , $ configuration );
1502+
1503+ Hook::exec ('actionMainMenuModifier ' , ['menu ' => &$ menu ]);
1504+
14921505 $ this ->smarty ->assign ([
1493- 'menu ' => $ this -> getWidgetVariables ( $ hookName , $ configuration ) ,
1506+ 'menu ' => $ menu ,
14941507 ]);
14951508
14961509 return $ this ->fetch ('module:ps_mainmenu/ps_mainmenu.tpl ' );
0 commit comments