update recommendation section update process

This commit is contained in:
Shreesh Arora
2023-10-13 14:40:51 +05:30
parent ce93a9826f
commit e6964d7258
5 changed files with 70 additions and 42 deletions

View File

@@ -23,7 +23,7 @@ class AdminModulesCatalogControllerCore extends AdminController
public $modules;
const CATALOG_RECOMMENDATION_CONTENT = '/cache/catalog_recommendation.html';
const RECOMMENDATION_CONTENT = '/cache/catalog_recommendation.html';
const ELEMENT_TYPE_MODULE = 1;
const ELEMENT_TYPE_THEME = 2;
@@ -240,17 +240,6 @@ class AdminModulesCatalogControllerCore extends AdminController
);
}
public function getRecommendationContent()
{
if (!Tools::isFresh(self::CATALOG_RECOMMENDATION_CONTENT, _TIME_1_DAY_, false)) {
@file_put_contents(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT, Tools::addonsRequest('catalog-recommendation'));
}
if (file_exists(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT)) {
return Tools::file_get_contents(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT);
}
return false;
}
public function sortList(&$list, $type)
{