mat94600 Posted April 4, 2016 Share Posted April 4, 2016 Hi, After upgrading prestashop 1.5 to 1.6 i cannot view subcategories on new shop, with the old shop i have this structure on category page : Category name- subcategory 1 name- subcategory 2 name... Category name 2- sucategory 2 nameetc... On new shop after upgrade, i only have : Category name Category.tpl <div id="subcategories"> {foreach from=$subcategories item=subcategory name="subcategory"} <h2 class="title_block"><a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a></h2> {math equation="ceil(count/3)" count=$subcategory.subcategories|count assign=modulo} {$subcategory.subcategories|@debug_print_var} /* <=== HERE I DEBUG SUBCATEGORIES */ {foreach from=$subcategory.subcategories item=subsubcategory name="subsubcategory"} {if $modulo==1 || $smarty.foreach.subsubcategory.iteration%$modulo==1 } <ul class="inline_list"> {/if} <li class="clearfix"> <a href="{$link->getCategoryLink($subsubcategory.id_category, $subsubcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subsubcategory.name|escape:'htmlall':'UTF-8'}</a> </li> {if $smarty.foreach.subsubcategory.iteration%$modulo==0 || $smarty.foreach.subsubcategory.iteration==$subcategory.subcategories|count} </ul> {/if} {/foreach} <br class="clear"/> {/foreach} </div> {else} <div id="subcategories"> {math equation="ceil(count/2)" count=$subcategories|count assign=modulo} {foreach from=$subcategories item=subcategory name="subcategory"} {if $modulo==1 || $smarty.foreach.subcategory.iteration%$modulo==1 } <ul class="inline_list_2"> {/if} <li class="clearfix"> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a> </li> {if $smarty.foreach.subcategory.iteration%$modulo==0 || $smarty.foreach.subcategory.iteration==$subcategories|count} </ul> {/if} {/foreach} <br class="clear"/> </div> {/if} As you can see, i have debugged {$subcategory.subcategories} and it returns "null" on front. so why it's not returns subcategories , so my question :Why it's returns null on 1.6, something has changed on the controller of the category? thank you Link to comment Share on other sites More sharing options...
presta4you.com Posted April 4, 2016 Share Posted April 4, 2016 Check inside database your ps_category table and subcategories 'id_parent' row. Probably you have some problem with id_parent. 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