PeppeCap Posted March 10, 2015 Share Posted March 10, 2015 (edited) Buongiorno a tutti, ho appena installato l'ultima versione di ps, 1.6.0.14 e apparentemente funziona bene con il tema di default, ma quando vado ad attivare un nuovo tema, ricevo questo errore: Parse error: syntax error, unexpected 'name' (T_STRING) in /var/www/html/GMG/override/classes/Tools.php on line 97 e questo su ogni pagina del sito, sia in FO che in BO.. quindi sono costretto a reinstallare PS da zero.. a qualcun'altro è già capitato? edit: ho notato che il problema sta nell'installazione dei moduli legati al tema, in pratica il file tools.php viene riscritto male.. uso questo tema: http://themeforest.net/item/warehouse-responsive-prestashop-16-theme-blog/3178575 è specificato che è compatibile con PS 1.6.0.11+ deve essere qualche bug della nuova versione di PS perchè fin'ora ha sempre funzionato... Allego il file tools.php <?php class Tools extends ToolsCore { /* * module: pluginadder * date: 2015-03-10 11:59:02 * version: 1 */ 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: 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: else $full_path = ($link_on_the_item ? '<div itemscope itemtype="http: return Tools::getPath($category->id_parent, $full_path, $link_on_the_item, $category_type); } } } Edited March 10, 2015 by PeppeCap (see edit history) 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