From e51c32556b8d701cc4020f30cbcdee456c9609cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hlav=C3=A1=C4=8Dek?= Date: Sat, 30 Dec 2023 14:19:24 +0100 Subject: [PATCH] Remove unneeded check --- ps_mainmenu.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/ps_mainmenu.php b/ps_mainmenu.php index 1aa89bd..0d0cf81 100644 --- a/ps_mainmenu.php +++ b/ps_mainmenu.php @@ -848,11 +848,9 @@ class Ps_MainMenu extends Module implements WidgetInterface $join_shop = ''; $where_shop = ''; - if (Tools::version_compare(_PS_VERSION_, '1.6.0.12', '>=') == true) { - $join_shop = ' INNER JOIN `' . _DB_PREFIX_ . 'cms_category_shop` cs - ON (bcp.`id_cms_category` = cs.`id_cms_category`)'; - $where_shop = ' AND cs.`id_shop` = ' . (int) $id_shop . ' AND cl.`id_shop` = ' . (int) $id_shop; - } + $join_shop = ' INNER JOIN `' . _DB_PREFIX_ . 'cms_category_shop` cs + ON (bcp.`id_cms_category` = cs.`id_cms_category`)'; + $where_shop = ' AND cs.`id_shop` = ' . (int) $id_shop . ' AND cl.`id_shop` = ' . (int) $id_shop; if ($recursive === false) { $sql = 'SELECT bcp.`id_cms_category`, bcp.`id_parent`, bcp.`level_depth`, bcp.`active`, bcp.`position`, cl.`name`, cl.`link_rewrite` @@ -893,11 +891,6 @@ class Ps_MainMenu extends Module implements WidgetInterface $id_shop = ($id_shop !== false) ? (int) $id_shop : (int) Context::getContext()->shop->id; $id_lang = $id_lang ? (int) $id_lang : (int) Context::getContext()->language->id; - $where_shop = ''; - if (Tools::version_compare(_PS_VERSION_, '1.6.0.12', '>=') == true) { - $where_shop = ' AND cl.`id_shop` = ' . (int) $id_shop; - } - $sql = 'SELECT c.`id_cms`, cl.`meta_title`, cl.`link_rewrite` FROM `' . _DB_PREFIX_ . 'cms` c INNER JOIN `' . _DB_PREFIX_ . 'cms_shop` cs @@ -906,8 +899,8 @@ class Ps_MainMenu extends Module implements WidgetInterface ON (c.`id_cms` = cl.`id_cms`) WHERE c.`id_cms_category` = ' . (int) $id_cms_category . ' AND cs.`id_shop` = ' . (int) $id_shop . ' - AND cl.`id_lang` = ' . (int) $id_lang . - $where_shop . ' + AND cl.`id_lang` = ' . (int) $id_lang . ' + AND cl.`id_shop` = ' . (int) $id_shop . ' AND c.`active` = 1 ORDER BY `position`';