Jump to content

[PROBLEM] PS breadcrums problem


Recommended Posts

I hava recently updated from an old prestashop version to 1.4.6.2 , and i have a problem with my breadcrums, the breadcrums at products / category are not as they should be putting always the same category / subcategory to all products, categories that have nothing to do with the products.

 

here is the website:

http://www.lacertosus.it/it/

 

i debugged it a bit so i think i found out the problem

this is in tools class -> getpath function

if ($categoryType === 'products')

{

$category = Db::getInstance()->getRow('

SELECT id_category, level_depth, nleft, nright

FROM '._DB_PREFIX_.'category

WHERE id_category = '.(int)$id_category);

 

error_log("the_id_".$id_category); -------> The is is good

if (isset($category['id_category']))

{

error_log("the_id_array".$category['id_category']); -------> The is is good

$categories = Db::getInstance()->ExecuteS('

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)

WHERE c.nleft <= '.(int)$category['nleft'].' AND c.nright >= '.(int)$category['nright'].' AND cl.id_lang = '.(int)($cookie->id_lang).' AND c.id_category != 1

ORDER BY c.level_depth ASC

LIMIT '.(int)$category['level_depth']);

error_log("the array:".json_encode($categories)); ----------> BUT HERE I ALWAYS GET THE SAME THING

$n = 1;

$nCategories = (int)sizeof($categories);

foreach ($categories AS $category)

{

$fullPath .=

(($n < $nCategories OR $linkOntheLastItem) ? '<a href="'.self::safeOutput($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 < $nCategories OR $linkOntheLastItem) ? '</a>' : '').

(($n++ != $nCategories OR !empty($path)) ? '<span class="navigation-pipe">'.$pipe.'</span>' : '');

}

Link to comment
Share on other sites

×
×
  • Create New...