Shannon Cole Posted January 6, 2011 Share Posted January 6, 2011 Hi,I was wondering if there was a way to put the subcategories into a dropdown menu, but only on the 4th level depth.For example I have a site and the category structure is as follows:Laptop Batteries (1st level)->Acer (2nd level)->TravelMate (3rd level)->200 (4th level).The problem is that in some categories the 4th level could have hundreds of subcategories, see example:http://prestashop.ltmnd.com/4303-travelmateWhat I'd like to do is to have the 1st to 3rd categories to display as normal, but the 4th level to be displayed as a dropdown menu.Is this possible and if so, how do I do it?Thanks,Shannonp.s. I'd like to offer a search option on the subcategories page that will search the category names. The current search only searches for product name/description. Link to comment Share on other sites More sharing options...
Shannon Cole Posted January 8, 2011 Author Share Posted January 8, 2011 I would settle for all subcategories on all levels in a dropdown menu if this is possible. I'm open to other suggestions. I just need a way to make such a high number of subcategories to look more professional and practical.If you can help it would be appreciated.Shannon Link to comment Share on other sites More sharing options...
rocky Posted January 8, 2011 Share Posted January 8, 2011 My AJAX Dropdown Categories module lets you display all categories in dropdowns. It doesn't let you mix dropdowns and regular categories though. Link to comment Share on other sites More sharing options...
Shannon Cole Posted January 8, 2011 Author Share Posted January 8, 2011 Thanks Rocky, but I was looking to put the subcategories on the page in a dropdown menu rather than the category block.(nice module btw)Shannon Link to comment Share on other sites More sharing options...
rocky Posted January 9, 2011 Share Posted January 9, 2011 In that case, I think you can simply rewrite the subcategory code as a dropdown. For example, change lines 32-53 of category.tpl from: {if isset($subcategories)} <!-- Subcategories --> {l s='Subcategories'} {foreach from=$subcategories item=subcategory} <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="" /> {else} <img src="{$img_cat_dir}default-medium.jpg" alt="" /> {/if} <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'} {/foreach} {/if} to: {if isset($subcategories)} {l s='Choose subcategory'} {foreach from=$subcategories item=subcategory} {$subcategory.name|escape:'htmlall':'UTF-8'} {/foreach} {/if} I haven't actually tested this code though. Hopefully, it will work. 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