Jump to content

[Solved] Layered Navigation Problem


Recommended Posts

Hello

 

When using the Layered Navigation Module, has anyone noticed that when using The "Drop down List" as the filter style, the drop down almost disapears straight away making it virtually impossible to select an option from the list

 

Is there a way to extend the time the stays visable, evein having the mouse over it doesnt keep it open.

 

Any ideas

 

 

Chris

Edited by Chris2013 (see edit history)
Link to comment
Share on other sites

Ok I think I have worked out the problem, line 45 from in the blocklayered.js from what I have worked out is the click event (for the want of a better word) to the drop down menu which once clicked calls the reloadContent() function, this in turn reloads the content making the dropdown menu disapear so you dont get a chance to click any of the options.

 

Just need to work out how to change that to get the #layered_category_ + the id in the dropdown, not a JS person me, any help is welcome and greatly appreciated

// Click on color
	$(document).on('click', '#layered_form input[type=button], #layered_form label.layered_color', function(e) {
		if (!$('input[name='+$(this).attr('name')+'][type=hidden]').length)
			$('<input />').attr('type', 'hidden').attr('name', $(this).attr('name')).val($(this).attr('rel')).appendTo('#layered_form');
		else
			$('input[name='+$(this).attr('name')+'][type=hidden]').remove();
		reloadContent();
	});

	$(document).on('click', '#layered_form .select', function(e) {
		reloadContent();
		
	});

	$(document).on('click', '#layered_form input[type=checkbox], #layered_form input[type=radio]', function(e) {
		reloadContent();
	});

Edited by Chris2013 (see edit history)
Link to comment
Share on other sites

Ok Update,

 

Somebody will know what I'm on about when they use the Layered Navigation block on their website and select "drop-downs" as a filter style.

 

anyway I have sorted the problem

 

Change line 132 of blocklayered.tpl 

 

From this


<option  style="color: {if isset($value.color)}{$value.color}{/if}" id="layered_{$filter.type_lite}{if $id_value || $filter.type == 'quantity'}_{$id_value}{/if}" value="{$id_value}_{$filter.id_key}" {if isset($value.checked) && $value.checked}selected="selected"{/if} {if !$value.nbr}disabled="disabled"{/if}>


To this (adding a class in this example "dropdown_select")

<option class="dropdown_select" style="color: {if isset($value.color)}{$value.color}{/if}" id="layered_{$filter.type_lite}{if $id_value || $filter.type == 'quantity'}_{$id_value}{/if}" value="{$id_value}_{$filter.id_key}" {if isset($value.checked) && $value.checked}selected="selected"{/if} {if !$value.nbr}disabled="disabled"{/if}>

Next change line 45 of blocklayered.js

 

From this

	$(document).on('click', '#layered_form .select', function(e) {
reloadContent();
});

To this

    $(document).on('click', '#layered_form .select .dropdown_select', function(e) {
reloadContent();
});

hopefully that'll help someone out that has the same problem :-)

 

Chris

Edited by Chris2013 (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

Hi!
 
What is your version? Because in the PS 1.6, at the line 46 of Blocklayered.js, this is it:

 

$('#layered_form input[type=checkbox], #layered_form input[type=radio], #layered_form select').live('change', function()
{
reloadContent();
});

 

i tried to add .dropdown_select after select but nothing works. 

Any idea? 

 

Thank you

Link to comment
Share on other sites

  • 2 months later...

Hi 

 

Thanks for sharing this. Im using PS 1.6 and experiencing another issue maybe you haven t seen that with your module.

 

When you create a filter you can change the order of appearence by drag and drop (very cool by the way) 

It works fine when you save.

BUT when you return to adjust the filters in BO, its not orered the right way, so youll have to order it correctly before you click save. This annoys me a bit. 

Have any of you found a solution for that?

Thanks :)

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...