ufo973 Posted July 22, 2014 Share Posted July 22, 2014 (edited) hello, I can't figure out how to open 1 category at a time and close other open categories in block categories? I maen right now i can expand as many categories as i want, but i want the user to be able to expand only 1 category at a time? Thanks!!! Edited July 23, 2014 by vekia (see edit history) Link to comment Share on other sites More sharing options...
ufo973 Posted July 22, 2014 Author Share Posted July 22, 2014 Any [spam-filter]? please! Link to comment Share on other sites More sharing options...
vekia Posted July 22, 2014 Share Posted July 22, 2014 hello it will be necessary to alter module js file and add new event to onclick action what theme you use? what prestashop version? you're reffering to default block categories module (if so - what version - exact number) Link to comment Share on other sites More sharing options...
ufo973 Posted July 22, 2014 Author Share Posted July 22, 2014 (edited) Thank you very much for the reply. I figured it out my self I am writing the details in case if somebody else wants to implement it. The file responsible for the animations of block category is located inside "themes/your_theme/js/tools". the file is called treeManagement.js you have to do some changes inside openBranch function. and here is my code... //animate the opening of the branch (span.grower jQueryElement) function openBranch(jQueryElement, noAnimation) { $( ".tree ul li ul" ).each(function() { var item = $( this ); if(item.css('display') == 'block'){ item.parent().find("span:first").removeClass('OPEN').addClass('CLOSE');; item.hide(); } }); jQueryElement.addClass('OPEN').removeClass('CLOSE'); if(noAnimation) { //jQueryElement.parent().find('ul:first').show(); jQueryElement.parent().find('ul:first').prev().addClass('opened'); } else { jQueryElement.parent().find('ul:first').show(); jQueryElement.parent().find('ul:first').prev().addClass('opened'); } } Moderators please change the title of this thread to something that would make it easier for people who need this code to find. Edited July 23, 2014 by ufo973 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 23, 2014 Share Posted July 23, 2014 great! thank you for posting solution it will be definitely helpfull for all other merchants here i also changed title as you suggested with regards, milos Link to comment Share on other sites More sharing options...
Recommended Posts