Jump to content

Modification blockcategories


Recommended Posts

Trying in the forum I have partially resolved now I ask aid you!
The modification that I have found me concurs to visualize in the block only the selected category without to visualize the others. Now it would serve to me to only visualize the subcategoria that I select without to see them all together.

Thanks and excused for my English :)


This is the code that I have inserted modifying the rows blockcategories.php:

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

        {
           if(isset($_GET['id_category']))
               $currentCategoryId=intval($_GET['id_category']);
           else 
       $currentCategoryId=Product::getDefaultCategory(intval($_GET['id_product']));

           $rootCateg = new Category ($currentCategoryId, intval($params['cookie']->id_lang));
           while($rootCateg->id_parent != 1)  {   
        $rootCateg=new Category($rootCateg->id_parent); 
}
           $blockCategTree = $rootCateg->recurseLiteCategTree(intval(Configuration::get('BLOCK_CATEG_MAX_DEPTH')));
           $isDhtml = (Configuration::get('BLOCK_CATEG_DHTML') == 1 ? true : false);

              $smarty->assign('currentCategoryId', $currentCategoryId);

           $smarty->assign('blockCategTree', $blockCategTree);
           $smarty->assign('numCateg', $rootCateg->id_category);
           $smarty->assign('nameCateg', $nomCat);

           if (file_exists(_PS_THEME_DIR_.'modules/blockcategories/blockcategories.tpl'))
               $smarty->assign('branche_tpl_path', _PS_THEME_DIR_.'modules/blockcategories/category-tree-branch.tpl');
           else
               $smarty->assign('branche_tpl_path', _PS_MODULE_DIR_.'blockcategories/category-tree-branch.tpl');
           $smarty->assign('isDhtml', $isDhtml);

           /* /ONLY FOR THEME OLDER THAN v1.0 */
           return $this->display(__FILE__, 'blockcategories.tpl');            
       }
       else
       {
           return null;
   }
}
}

Share this post


Link to post
Share on other sites

We see if give a straight one to me: with the modification made in the rows php that I have mailed at the beginning the menu is not only visualized in the page “product” but in “category”. Which modification I can make in order to make to see here it also?

Share this post


Link to post
Share on other sites
  • 1 year later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

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