Hello, I am trying to speed up a slow prestashop site and after a lot of debugging I have found that the blocktopmenu module takes about 3 seconds to run the displaytop hook. It is the makeMenu function that takes about 3 seconds but looking at the code it is supposed to cache it. However, it seems like the makemenu function is always runned and never taken from cache. I have made sure smarty cache is enabled. Any ideas on how to solve this or debug further? I appreciate any help I can get!
Here is the code:
public function hookDisplayTop($param) { $this->user_groups = ($this->context->customer->isLogged() ? $this->context->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP'))); $this->page_name = Dispatcher::getInstance()->getController(); if (!$this->isCached('blocktopmenu.tpl', $this->getCacheId())) { if (Tools::isEmpty($this->_menu)) { $this->makeMenu(); } $shop_id = (int)$this->context->shop->id; $shop_group_id = Shop::getGroupFromShop($shop_id); $this->smarty->assign('MENU_SEARCH', Configuration::get('MOD_BLOCKTOPMENU_SEARCH', null, $shop_group_id, $shop_id)); $this->smarty->assign('MENU', $this->_menu); $this->smarty->assign('this_path', $this->_path); } $html = $this->display(__FILE__, 'blocktopmenu.tpl', $this->getCacheId()); return $html; }