Jump to content
Sign in to follow this  
forent

Brutal Problem sitemap.php

Recommended Posts

Průšvih s sitemap.php

 

Update jsem PrestaShop na nejnovější verzi 1.4.9. V sitemap.php se mi nezobrazují kategorie a jejich podkategorie.

 

Má někdo z vás funkční sitemap.php na aktuální verzi? Kompatibilní?

Vše se mi zobrazuje jako na staré verzi akorát kategorie a podkategorie ne.

 

 

Ve staré verzi jsem používal osvědčené

 

sitemap.php

 

 

 



<?php

include(dirname(__FILE__).'/config/config.inc.php');

$css_files = array();
$js_files = array(_THEME_JS_DIR_.'tools/treeManagement.js');

include(dirname(__FILE__).'/header.php');

/* Depth choice (number of levels displayed)  */
$depth = 0;

/* Construct categories tree */
$categTree = Category::getRootCategory()->recurseLiteCategTree($depth);

/*  ONLY FOR THEME OLDER THAN v1.0 */
function constructTreeNode($node){
$ret = '<li>'."\n";
$ret .= '<a href="'.$node['link'].'" title="'.strip_tags($node['desc']).'">'.$node['name'].'</a>'."\n";
if(!empty($node['children']))
{
$ret .= '<ul>'."\n";
foreach ($node['children'] AS $child)
$ret .= constructTreeNode($child);
$ret .= '</ul>'."\n";
}
$ret .= '</li>'."\n";
return $ret;
}

$ulTree = '<div class="tree-top">' . $categTree['name'] . '</div>'."\n";
$ulTree .=  '<ul class="tree">'."\n";
foreach ($categTree['children'] AS $child)
$ulTree .= constructTreeNode($child);
$ulTree .=  '</ul>'."\n";
$smarty->assign('categoryTree', $ulTree);
/* ELSE */
$smarty->assign('categoriesTree', $categTree);
/* /ONLY FOR THEME OLDER THAN v1.0 */

$cms = CMS::listCms(intval($cookie->id_lang));
$id_cms = array();
foreach($cms AS $row)
$id_cms[] = intval($row['id_cms']);
$smarty->assign('cmslinks', CMS::getLinks(intval($cookie->id_lang), $id_cms ? $id_cms : NULL));

$smarty->assign('voucherAllowed', intval(Configuration::get('PS_VOUCHERS')));
$smarty->display(_PS_THEME_DIR_.'sitemap.tpl');
include(dirname(__FILE__).'/footer.php');




?>


Edited by forent (see edit history)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More