niwlf Posted June 19, 2012 Share Posted June 19, 2012 (edited) 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 June 22, 2012 by niwlf (see edit history) 1 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