brandonc503 Posted October 18, 2012 Share Posted October 18, 2012 Id like the categories.php page to show child categories of any root category*. with: Menu Grilled Soups Drinks Wine Bottles With category 2 as home..and Menu and Drinks in home... on index.php?id_category=2&controller=category Id like Menu to show along with its sub cats of Grilled and Soups.. same with Drinks. I found this description and think its what im looking for. "To display the subcategories of a category in PrestaShop, you need to create a new instance of the category class using the category's id (usually retrieved from the URL) and the language id (retrieved from cookies). After the instance has been created you can use the getSubCategories method, which take 2 parameters. The first is the language id, the second is to set whether to display only active subcategories (the default value true) or all the subcategories." -- Feb 9th tip.. http://www.cartexpert.net/content/8-prestashop-tricks-and-tips (* marking as root is not necessary but I figured it would allow me to check the 'root category' box to enable this script.. I could easily do without incorperating the root part if I had other way to determin which of the categories, if not all, showed subcategories) thanks much.. im often in irc at server: irc.freenode.com channel: prestashop Link to comment Share on other sites More sharing options...
clayton29657 Posted October 18, 2012 Share Posted October 18, 2012 (edited) Hello brandonc503 I did not make this code nor have tried it out but it looks like you want the same thing as I do on my sub-category pages where i can show sub-title of that category itself is that correct? I had this made for my website and just have not had time to put in place or test it. I would not try this on a live site and make sure you do a full back up please!! <!-- Subcategories --> <div id="subcategories"> <h3>{l s='Subcategories'}</h3> <ul class="inline_list"> {foreach from=$subcategories item=subcategory} <li> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}"> {if $subcategory.id_image} <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {else} <img src="{$img_cat_dir}default-medium.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {/if} </a><br /> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}</a> </li> {/foreach} </ul> <br class="clear"/> </div> {/if}" Edited October 18, 2012 by clayton29657 (see edit history) Link to comment Share on other sites More sharing options...
brandonc503 Posted October 18, 2012 Author Share Posted October 18, 2012 Thanks, but nope. Page would be dealing out 3 tiers, the page would be tier 1 for category Menu , tier 2 is Meals, Drinks, and tier 3 would be Grilled, Soups, (under Meals) and Wine, Bottles (under Drinks). Link to comment Share on other sites More sharing options...
clayton29657 Posted October 19, 2012 Share Posted October 19, 2012 well I tried but if you could get someone to edit the script would be easy then I tried. I had it made specially for my site and thought if you could also use it why not. Good luck in finding what you need Clayton Link to comment Share on other sites More sharing options...
catrose937 Posted November 16, 2012 Share Posted November 16, 2012 Brandon, Did you ever resolve this? I am looking to do the same thing.. so wondering if there is a resolution out there.. Thanks, Catherine 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