All22 Posted February 25, 2013 Share Posted February 25, 2013 Hi, I want to start block layered navigation with all filter tabs closed, not open as it is default. Can someone advise me how to change the code? (I was trying but it's pretty large...) Thank you Link to comment Share on other sites More sharing options...
surf4lifeuk Posted February 26, 2013 Share Posted February 26, 2013 Hi I have the same request. Can anybody help? I think the code that controls the function is this: function openCloseFilter() { $('#layered_form span.layered_close a').live('click', function(e) { if ($(this).html() == '<') { $('#'+$(this).attr('rel')).show(); $(this).html('v'); $(this).parent().removeClass('closed'); } else { $('#'+$(this).attr('rel')).hide(); $(this).html('<'); $(this).parent().addClass('closed'); } e.preventDefault(); }); } Link to comment Share on other sites More sharing options...
All22 Posted February 26, 2013 Author Share Posted February 26, 2013 <p>Yes, that is the function.</p> <p> </p> <p>I tried this:</p> <p> </p> <p> </p> <div>function setClosed()</div> <div>{</div> <div>$('#'+'#layered_form span.layered_close a'.attr('rel')).hide();</div> <div>$('#layered_form span.layered_close a').html('<');</div> <div>$('#layered_form span.layered_close').addClass('closed');</div> <div>}</div> <div> </div> <div>but doesn't work properly. First statement is wrong, if commented out, the rest works.</div> <p> </p> <p> </p> <p>I tried this:</p> <p> </p> <p> </p> <div>function setClosed()</div> <div>{</div> <div>$('#'+'#layered_form span.layered_close a'.attr('rel')).hide();</div> <div>$('#layered_form span.layered_close a').html('<');</div> <div>$('#layered_form span.layered_close').addClass('closed');</div> <div>}</div> <div> </div> <div>Function is called</div> <div>setClosed();</div> <div> </div> <div>inserted before</div> <div>cancelFilter();</div> <div>openCloseFilter();</div> <div> </div> <div>but it doesn't work properly. First statement is wrong, if commented out, the rest works.</div> <div> </div> <div>If I change that wrong first line with:</div> <div> </div> <div>$('#layered_block_left ul').hide();</div> <div> </div> <div>it works with all filters closed, but after choosing one everything opens... :-(</div> <div> </div> <div>Anybody to help?</div> Link to comment Share on other sites More sharing options...
surf4lifeuk Posted March 4, 2013 Share Posted March 4, 2013 <p>Yes, that is the function.</p> <p> </p> <p>I tried this:</p> <p> </p> <p> </p> <div>function setClosed()</div> <div>{</div> <div>$('#'+'#layered_form span.layered_close a'.attr('rel')).hide();</div> <div>$('#layered_form span.layered_close a').html('<');</div> <div>$('#layered_form span.layered_close').addClass('closed');</div> <div>}</div> <div> </div> <div>but doesn't work properly. First statement is wrong, if commented out, the rest works.</div> <p> </p> <p> </p> <p>I tried this:</p> <p> </p> <p> </p> <div>function setClosed()</div> <div>{</div> <div>$('#'+'#layered_form span.layered_close a'.attr('rel')).hide();</div> <div>$('#layered_form span.layered_close a').html('<');</div> <div>$('#layered_form span.layered_close').addClass('closed');</div> <div>}</div> <div> </div> <div>Function is called</div> <div>setClosed();</div> <div> </div> <div>inserted before</div> <div>cancelFilter();</div> <div>openCloseFilter();</div> <div> </div> <div>but it doesn't work properly. First statement is wrong, if commented out, the rest works.</div> <div> </div> <div>If I change that wrong first line with:</div> <div> </div> <div>$('#layered_block_left ul').hide();</div> <div> </div> <div>it works with all filters closed, but after choosing one everything opens... :-(</div> <div> </div> <div>Anybody to help?</div> Hi did you manage to find a fix for this? I have looked on google and nobody seems to know how to achieve this. Link to comment Share on other sites More sharing options...
All22 Posted April 4, 2013 Author Share Posted April 4, 2013 No, not yet... :-( I just tried to post here, something went bad with formatting... I managed to have it closed, but after opening one item, everything was open again... This weekend I should have some time for it, so i will try again... Link to comment Share on other sites More sharing options...
Cari Posted June 4, 2013 Share Posted June 4, 2013 Did you have any luck? Link to comment Share on other sites More sharing options...
Netgadget Posted August 5, 2013 Share Posted August 5, 2013 (edited) Hi all! I managed to fix this by changing the original function by this (in blocklayered.js): function openCloseFilter() { $('#layered_block_left ul').hide();//NEW $('#layered_form span.layered_close a').html('<');//NEW $('#layered_form span.layered_close').addClass('closed');//NEW $('#layered_form span.layered_close a').live('click', function(e) { if ($(this).html() == '<') { $('#'+$(this).attr('rel')).show(); $(this).html('v'); $(this).parent().removeClass('closed'); } else { $('#'+$(this).attr('rel')).hide(); $(this).html('<'); $(this).parent().addClass('closed'); } e.preventDefault(); }); } Where the 3 "NEW" lines are the same as All22. No more than this. So thx All22 for your 3 lines codes which I just placed to the correct area (at least it works on my prestashop version 1.5.4.1 and his latest layered module). Cheers everyone :-D Netgadget Edit: Nope sorry it didn't work...as soon as we apply a filter or even move to another category, the layered will open completely...If someone would have an idea to fix this..it would be amazing!! Edited August 7, 2013 by Netgadget (see edit history) Link to comment Share on other sites More sharing options...
babyewok Posted December 5, 2013 Share Posted December 5, 2013 Did you manage to figure this out? It is so frustrating that they all keep opening up again when a filter option is selected. I can understand that the section that was filtered might open, but not the rest! 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