Merge pull request #858 from shreesh-webkul/gli-1542

Update: Recommendation section update process
This commit is contained in:
Rohit Jain
2024-04-09 13:25:12 +05:30
committed by GitHub
5 changed files with 71 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_FILE_PATH = '/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)
{