Jump to content

[SOLVED] DISABLE "Enable Filters" on Blocklayered


niwlf

Recommended Posts

Hi!

I'm trying to make a button that disables the "Enable Filters" and return the page to the category, but I don't know what is the function i need.

I know the piece of code i need to change is here:

 

			 {if isset($selected_filters) && $n_filters > 0}
							<div id="enabled_filters">
									<span class="layered_subtitle" style="float: none;">{l s='Enabled filters:' mod='blocklayered'}</span>
									<ul>
									{foreach from=$selected_filters key=filter_type item=filter_values}
											{foreach from=$filter_values key=filter_key item=filter_value name=f_values}
													{foreach from=$filters item=filter}
															{if $filter.type == $filter_type && isset($filter.values)}
																	{if isset($filter.slider)}
																			{if $smarty.foreach.f_values.first}
																					<li>
																							<a href="#" rel="layered_{$filter.type}_slider" title="{l s='Cancel' mod='blocklayered'}">x</a>
																							{$filter.name|escape:html:'UTF-8'}{l s=':' mod='blocklayered'}
																							{$filter.values[0]|escape:html:'UTF-8'}{$filter.unit|escape:html:'UTF-8'} -
																							{$filter.values[1]|escape:html:'UTF-8'}{$filter.unit|escape:html:'UTF-8'}
																					</li>
																			{/if}
																	{else}
																			{foreach from=$filter.values key=id_value item=value}
																					{if $id_value == $filter_key && !is_numeric($filter_value) && ($filter.type eq 'id_attribute_group' || $filter.type eq 'id_feature') || $id_value == $filter_value && $filter.type neq 'id_attribute_group' && $filter.type neq 'id_feature'}
																							<li>
																									<a href="#" rel="layered_{$filter.type_lite}_{$id_value}" title="{l s='Cancel' mod='blocklayered'}">x</a>
																									{$filter.name|escape:html:'UTF-8'}{l s=':' mod='blocklayered'} {$value.name|escape:html:'UTF-8'}
																							</li>
																					{/if}
																			{/foreach}
																	{/if}
															{/if}
													{/foreach}
											{/foreach}
									{/foreach}
									</ul>
							</div>
							{/if}

 

But if I change all with a button like below, what i need to write on onClick= to disable all filters??

{if isset($selected_filters) && $n_filters > 0}
<input type="button" value="Disable Filters" onClick="">

{/if}

 

EDIT: I Solved it!

 

 

{if isset($selected_filters) && $n_filters > 0}

<div id="enabled_filters">

<li><a href="category.php?id_category=%7B$id_category_layered%7D">TODOS LOS COLORES</a><br></li>

{/if}

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...