I have the following code created in javascript, which generates a url in the browser, but the problem is that each filter duplicates the data, that is, it reloads the previously selected filters, causing the url to fill with garbage, someone who can help me, I thank you very much.
function GetFiltersForProducts()
{
var filters = [];
$("#estuyo-facets .facet_container").each(function(i, e){
var filter = $(e).find(".facet_title");
var filter_field = filter.attr("id");
var filter_values = [];
filter.parent().find(".element_container input[type='checkbox']:checked").each(function(i, e){
if($(e).attr('name') != 'Zapatos')
{
var filter_unRepeat = filter_values.push({'values' : $(e).val(), 'name': $(e).attr('name')});
}
});
var filter_shoes = filters.push({ 'filter_field': filter_field, 'filter_values': filter_values });
});
return filters;
};