Chitodlp Posted September 24 Share Posted September 24 Hola, buenas tardes. soy nuevo con mi tienda. El dueño anterior tenia la version 1.6 de prestashop. Yo actualice mi pagina de pruebas a 1.7.4 y el backoffice funciona pero la web de la tienda no. En el registro de errores sale esto y no se por que. 24-Sep-2024 17:30:08 Europe/Madrid] PHP Warning: Declaration of Tools::getPath($id_category, $path = '', $link_on_the_item = false, $category_type = 'products', ?Context $context = NULL) should be compatible with ToolsCore::getPath($url_base, $id_category, $path = '', $highlight = '', $category_type = 'catalog', $home = false) in /home/vinilosb/public_html/prueba.vinilosbaratos/override/classes/Tools.php on line 0 Alguien me puede ayudar? error_log (1) Link to comment Share on other sites More sharing options...
ExpertoPrestaShop Posted September 24 Share Posted September 24 Busca en el override de la clase Tools (/home/vinilosb/public_html/prueba.vinilosbaratos/override/classes/Tools.php) a que modulo pertenece el override de la funcion getPath y desactiva dicho modulo, porque no es compatible con tu version actual de Prestashop. Link to comment Share on other sites More sharing options...
Chitodlp Posted September 24 Author Share Posted September 24 No lo veo claro, os pongo el contenido de Tools.php. <?php class Tools extends ToolsCore { public static function getPath($id_category, $path = '', $link_on_the_item = false, $category_type = 'products', Context $context = null) { if (!$context) $context = Context::getContext(); $id_category = (int)$id_category; if ($id_category == 1) return '<span class="navigation_end">'.$path.'</span>'; $pipe = Configuration::get('PS_NAVIGATION_PIPE'); if (empty($pipe)) $pipe = '>'; $full_path = ''; if ($category_type === 'products') { $interval = Category::getInterval($id_category); $id_root_category = $context->shop->getCategory(); $interval_root = Category::getInterval($id_root_category); if ($interval) { $sql = 'SELECT c.id_category, cl.name, cl.link_rewrite FROM '._DB_PREFIX_.'category c LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category'.Shop::addSqlRestrictionOnLang('cl').') WHERE c.nleft <= '.$interval['nleft'].' AND c.nright >= '.$interval['nright'].' AND c.nleft >= '.$interval_root['nleft'].' AND c.nright <= '.$interval_root['nright'].' AND cl.id_lang = '.(int)$context->language->id.' AND c.active = 1 AND c.level_depth > '.(int)$interval_root['level_depth'].' ORDER BY c.level_depth ASC'; $categories = Db::getInstance()->executeS($sql); $n = 1; $n_categories = count($categories); foreach ($categories as $category) { $full_path .= (($n < $n_categories || $link_on_the_item) ? '<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title"><a itemprop="url" href="'.Tools::safeOutput($context->link->getCategoryLink((int)$category['id_category'], $category['link_rewrite'])).'" title="'.htmlentities($category['name'], ENT_NOQUOTES, 'UTF-8').'">' : ''). htmlentities($category['name'], ENT_NOQUOTES, 'UTF-8'). (($n < $n_categories || $link_on_the_item) ? '</span></a></div>' : ''). (($n++ != $n_categories || !empty($path)) ? '<span class="navigation-pipe">'.$pipe.'</span>' : ''); } return $full_path.$path; } } else if ($category_type === 'CMS') { $category = new CMSCategory($id_category, $context->language->id); if (!Validate::isLoadedObject($category)) die(Tools::displayError()); $category_link = $context->link->getCMSCategoryLink($category); if ($path != $category->name) $full_path .= '<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title"><a itemprop="url" href="'.Tools::safeOutput($category_link).'">'.htmlentities($category->name, ENT_NOQUOTES, 'UTF-8').'</span></a></div><span class="navigation-pipe">'.$pipe.'</span>'.$path; else $full_path = ($link_on_the_item ? '<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title"><a itemprop="url" href="'.Tools::safeOutput($category_link).'">' : '').htmlentities($path, ENT_NOQUOTES, 'UTF-8').($link_on_the_item ? '</span></a></div>' : ''); return Tools::getPath($category->id_parent, $full_path, $link_on_the_item, $category_type); } } } Link to comment Share on other sites More sharing options...
ExpertoPrestaShop Posted September 25 Share Posted September 25 Bueno el método getPath no indica de que modulo provenga, así que quizás lo pusieron ahí a mano. Eliminando el código de dicho método o eliminando el override completo (probablemente tengas que vaciar cache luego) se debe solucionar el problema. Suerte. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now