Bianca007 Posted October 4, 2009 Share Posted October 4, 2009 Hi all,I'm wondering if it is possible to have multiple category trees? I ask because I would like to show a different category menu on specific product pages. For example, if I have two main categories: Apparel and Beauty. On the apparel pages, I'd like to show all the categories and sub-cats like:Tops Tank TopsCardigansBotomsJeansLeggingsDressesCasualFormalBut then on the "Beauty" products page, I would like to show a new menu with categories/sub-cats specific to beauty products WITHOUT showing the apparel stuff too:HairShampooStyling Products SkinCreamFace washA good example can be seen on the bebe.com site:Apparel: http://www.bebe.com/APPAREL-Products/b/15382841Shoes: http://www.bebe.com/SHOES-Products/b/675993011They have two completely different menus for each "main" product page. Is there a way to do this with PrestaShop?? I noticed that our categories and sub-cats are under a main category called "home". Can we create more main categories? If so, where? And, once we create a new main category, how do we get our pages to display that specific menu?Any help would be appreciated. Link to comment Share on other sites More sharing options...
TropischBruin Posted October 5, 2009 Share Posted October 5, 2009 Good question.This can be done by filtering on category ID.I've seen it done in several PS templates, don't ask me how. Link to comment Share on other sites More sharing options...
Bianca007 Posted October 5, 2009 Author Share Posted October 5, 2009 Thanks for responding! Would you happen to remember which template you saw this being done in? I really hope someone knows how to do this exactly. I would think other online stores could make use of this as well. Link to comment Share on other sites More sharing options...
Bianca007 Posted October 5, 2009 Author Share Posted October 5, 2009 and it doesn't need to be a new "main" category. If you know how to show only sub-categories on category pages, that would work too. Pleeeeeease if anyone knows the answer Link to comment Share on other sites More sharing options...
Bianca007 Posted October 7, 2009 Author Share Posted October 7, 2009 hmm.... no one??Maybe someone knows how I can keep the parent category "selected" when a child category is also selected??Example: http://www.perlesandco.com/Strass_Demi_lune_strass-c-101_82.html Link to comment Share on other sites More sharing options...
Iamcaptain Posted October 11, 2009 Share Posted October 11, 2009 I haven't really looked into it, but the solution i'd try first would be to have two blocks on the left column. One that shows the beauty category + sub categories and another that shows the Apparel + sub categories. And then have an if statement in the product template that says - if product beauty, then show beauty block, else show apparel block.Or something along those lines. Link to comment Share on other sites More sharing options...
Bianca007 Posted October 12, 2009 Author Share Posted October 12, 2009 Hi Iamcaptain,thank you for responding Do you mean create my own custom blocks where I just input the categories manually using plain HTML??? And then use if/else statements to show the corresponding one for the page? Just want to be sure I am clear because as far as I know, there is no way to have the cart create the "main" categories for me (or if there is, no one seems to be sharing that info). I don't know PHP at all but I will give it a try!!! At least I can start somewhere now so thank you!! Link to comment Share on other sites More sharing options...
Stinkywinky Posted October 13, 2009 Share Posted October 13, 2009 I am looking for this also. Is there a possibility to split up the menu three?For example. My shop looks like thisT-shirtsShoesJacketsEtcI need to devide the menu in different parts so i can put them in different divs. One at the top left: for example T-shirts, one at the top right, for example Shoes, and one at the bottom, for example JacketsIs is possible to split up the menu? How? Link to comment Share on other sites More sharing options...
hermit Posted October 13, 2009 Share Posted October 13, 2009 This is possible:I created a module called blocksubcategories(attached zip-file).It loads the subcategories of the parent items (only if the parent is not Home or on pages where we don't want this), so you can use the $subcategories variable in your template to make a second menu with the subitems.Delete the subcategory part in category.tpl: {if isset($subcategories)} <!-- Subcategories --> {l s='Subcategories'} {foreach from=$subcategories item=subcategory} getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}"> {if $subcategory.id_image} getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" /> {else} {/if} getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'} {/foreach} {/if} Now configure the blockcategories module to only show the parent categories. Then import subcategory.tpl where you want the menu to show up.I attached a screenshot where you can see it working.Now i'm going to look for a way to make the parent category menu item also active.Upload modsubcategories.zip to the modules folder, hook it to the left and be sure it's loaded after blockcategories (module positions). Then change the template files to get the submenus where you want them (import subcategory.tpl). -> use the code you got from category.tpl instead of the subcategory.tpl attached if you want to use images in your submenu subcategory.tpl.zip blocksubcategories_updated.zip Link to comment Share on other sites More sharing options...
Bianca007 Posted October 16, 2009 Author Share Posted October 16, 2009 Hi hermit,thanks so much for sharing! From your screenshot I can see that this is pretty much what I have been trying to do!!I'm a little confused tho.... you said to upload modsubcategories.zip, however, I don't see that zip file in your post? Can you clarify which zip I should be uploading?? Also, how do we configure the blockcategories module to only show the parent categories (as you instructed)? Do we delete the {if $node.children|@count > 0} part in category-tree-branch.tpl?? And one more thing, how do we import subcategory.tpl into our template? Is there a special format we should use to call this file? Sorry, I'm a newbie still trying to figure this all out Thank you!!! Link to comment Share on other sites More sharing options...
hermit Posted October 16, 2009 Share Posted October 16, 2009 Hi Bianca,I'll try to make a kind of manual:First, unzip blocksubcategories_updated.zip (I renamed it after updating the code) into the /modules folder (it's in the root of your prestashop map). After that, it will show up in the modules tab of the back-end.Look for Subcategories (in Blocks) and click on install. (installSubcategories.png) Now click on positions, it's right under the tab menu (on the modules page). (positions.png)Choose Transplant a moduleModule: SubcategoriesHook into: Left columb blocks(hook_to_left.png)Click Save. The module is now loaded.Scroll down and be sure the subcategories module is loaded after the Categories block, you can change the order with the small black pointers.---Now open category.tpl (it's in your template folder) and remove the following code, or cut it if you want images in your submenu. {if isset($subcategories)} <!-- Subcategories --> {l s='Subcategories'} {foreach from=$subcategories item=subcategory} getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}"> {if $subcategory.id_image} getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" /> {else} {/if} getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'} {/foreach} {/if} The last step is to choose where you want the submenu to show up, and import subcategory.tpl there (paste the code you've cut from category.tpl in subcategory.tpl if you want images in there). {include file=$tpl_dir./subcategory.tpl} Now the submenu will show up in your template.You could hide the subcategories in the categories menu with CSS (replace menu with the correct name of the div, can't remember it, probably categories): DIV#menu UL.tree LI UL LI { display: none; } Or click on >> Configure after 'Categories block v1.0' on the modules page. Set Maximum depth to 1. As you probably don't need dynamic mode for sublevels anymore you can switch that off too. Click on Save. You're done! Hope it helped you,Herman Link to comment Share on other sites More sharing options...
Bianca007 Posted October 16, 2009 Author Share Posted October 16, 2009 Thank you for the full instructions (much easier to understand) But I still can't get it to work. If I place the {include file=$tpl_dir./subcategory.tpl} code into category.tpl, the sub-category links show up below the breadcrumbs. The problem is, I want to put the sub-category on the left of my page but it seems that no matter which file I include the template in, it does not show up at all. I tried adding it to header.tpl and blockcategories.tpl and got absolutely nothing. I even tried adding the code from subcategory.tpl directly into my template file and still nothing. Am I doing something wrong?? Link to comment Share on other sites More sharing options...
hermit Posted October 16, 2009 Share Posted October 16, 2009 In your template it must also be loaded after the categories, so that's why it won't work in header.tpl. If you want to put it on the left of your site you need to do some modifications in your template files, like ending header.tpl with this code(so remove everything from <!-- Header --> down and replace it with this:) <!-- Header --> {$HOOK_TOP} <!-- /header --> {$HOOK_LEFT_COLUMN} {/if} Then enter this on top of breadcrumbs.tpl: {include file=$tpl_dir./subcategory.tpl} <!-- Center --> You might need to create some extra containers to get full css-control. Link to comment Share on other sites More sharing options...
Bianca007 Posted October 17, 2009 Author Share Posted October 17, 2009 Thank you so much! I will try that now Link to comment Share on other sites More sharing options...
buzuchok Posted October 17, 2009 Share Posted October 17, 2009 Hey, guys. Is it possible to get parent category of custom product?For example, I have "new products" module and I need to filter/sort product list by parent categories(iPods, Laptops). I know it's something like separate module, but the simpliest way is to have parent category id and to hide this product if necessary by JS.Well, thanks for any help. Link to comment Share on other sites More sharing options...
Bianca007 Posted October 17, 2009 Author Share Posted October 17, 2009 hermit, thank you again for sharing this awesome mod!!! It worked wonderfully for me. I had to configure it a little differently because I have A LOT of HTLM in my header and couldn't move everything out of there so instead, I moved the left column div to the breadcrumbs.tpl file and included the subcategory.tpl above it... it worked perfectly!!! I'm soooo very grateful to you, thank you again!! Link to comment Share on other sites More sharing options...
silvain Posted October 27, 2009 Share Posted October 27, 2009 I try to install it on my shop. The modul doesn't work. I use prestashop 1.2.4.I upload and install the modulthen i upload the subcatecogry.tplchange the codeand add the link to subcategory tplbut i see nothing. Link to comment Share on other sites More sharing options...
corint1 Posted November 29, 2009 Share Posted November 29, 2009 daca vreun roman a citit acest topic il rog sa imi explice cum sa fac sa functioneze ... ma chinui si nu imi iese nimic ... merci Link to comment Share on other sites More sharing options...
ruaridhc Posted March 1, 2010 Share Posted March 1, 2010 I would also like to show only menu's for specific departments, but have had trouble getting the modules/instructions in this post to work for me - which is purely down to my inexperience. While I figure it out, I'd like to do the groundwork of creating my departments and adding products to these departments.If I end up installing another 'catagory' module, does that mean I will have two 'catagory' modules show up in my 'catalog' tab in the Back Office? And would I have to create departments and add products to the specific catagory modules, ie, if I have 'woman's clothes' and 'men's clothes', would I have to assign one module to woman, and one to men, then add catagories and products to them, or can I just add deparments/products as normal and assign them somehow later?Sorry for the long question, but as I never manged to get this to work (yet), I'm not sure how the Back Office will look.Advice would be warmly appreciated:-) Link to comment Share on other sites More sharing options...
kalyan85 Posted June 18, 2010 Share Posted June 18, 2010 Hai...this is kalyan... Link to comment Share on other sites More sharing options...
kalyan85 Posted June 18, 2010 Share Posted June 18, 2010 Hai...This is kalyan...I am fresher to prestashop...I saw the topic about Multiple Category Trees....I use the subcategory.tpl.zip and blocksubcategories_updated.zip as you said...but It only recover the second level Category Trees but it doesn't create subCategory Trees of second level Category Tree...Please see the below attachment.... Link to comment Share on other sites More sharing options...
Martin C Posted December 29, 2010 Share Posted December 29, 2010 Seems this subcategorie module is not workling anymore in 1.4 branch.Perheps someone can tell me why this module can not be loaded in the backend? Link to comment Share on other sites More sharing options...
zulr0 Posted August 26, 2011 Share Posted August 26, 2011 can anyone help with this issue? please Link to comment Share on other sites More sharing options...
S@nya Posted September 7, 2011 Share Posted September 7, 2011 Same problem Link to comment Share on other sites More sharing options...
philee Posted September 7, 2011 Share Posted September 7, 2011 Would be great if someone releases a module to support multiple category tree for 1.4. Link to comment Share on other sites More sharing options...
hermit Posted September 7, 2011 Share Posted September 7, 2011 I'm sorry for this late reply, I hadn't noticed there were questions about it. Don't expect it to work in PS > 1.2! And don't wait for me to fix it. I stopped using PS because I needed a more flexible shopping solution where these kind of hacks are not needed. So find someone else to fix it, or mail the PS-developers telling them this should be possible without hacks. Good luck with it! 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