Filters
>
Showing 29 products
{
let [param, value] = filter.split('=');
console.log({ param, value });
if (!filters[param]) {
filters[param.replaceAll('?', '')] = [value];
} else {
filters[param.replaceAll('?', '')].push(value);
}
});
}
// Verificar si el filtro a agregar ya existe
let [paramToAdd, valueToAdd] = filterToAdd.split('=');
if (filters[paramToAdd] && filters[paramToAdd].includes(valueToAdd)) {
// Si existe, quitarlo de los filtros
filters[paramToAdd] = filters[paramToAdd].filter(value => value !== valueToAdd);
} else {
// Si no existe, agregarlo a los filtros
if (!filters[paramToAdd]) {
filters[paramToAdd] = [valueToAdd];
} else {
filters[paramToAdd].push(valueToAdd);
}
}
// Formatear los filtros para la URL
const filterParams = Object.entries(filters).map(([param, values]) => {
return values.map(value => `${param}=${value}`).join('&');
})
const queryString = filterParams.length > 0 ? '?' + filterParams.join('&') : '';
// Almacenar la query en el dataset
document.querySelector('.filters-wrapper').dataset.filters = queryString;
console.log('This should be desktop only', { queryString });
"
>
Sort by
>
Filters & Sort
>
×
Sort By
>
{
let [param, value] = filter.split('=');
console.log({ param, value });
if (!filters[param]) {
filters[param.replaceAll('?', '')] = [value];
} else {
filters[param.replaceAll('?', '')].push(value);
}
});
}
// Verificar si el filtro a agregar ya existe
let [paramToAdd, valueToAdd] = filterToAdd.split('=');
if (filters[paramToAdd] && filters[paramToAdd].includes(valueToAdd)) {
// Si existe, quitarlo de los filtros
filters[paramToAdd] = filters[paramToAdd].filter(value => value !== valueToAdd);
} else {
// Si no existe, agregarlo a los filtros
if (!filters[paramToAdd]) {
filters[paramToAdd] = [valueToAdd];
} else {
filters[paramToAdd].push(valueToAdd);
}
}
// Formatear los filtros para la URL
const filterParams = Object.entries(filters).map(([param, values]) => {
return values.map(value => `${param}=${value}`).join('&');
})
const queryString = filterParams.length > 0 ? '?' + filterParams.join('&') : '';
// Almacenar la query en el dataset
document.querySelector('.filters-wrapper').dataset.filters = queryString;
console.log('This should be mobile only', { queryString });
"
>
View
Outrun Mock Neck
Quick View
Outrun Zip
Quick View
Swish Pullover 2.0
Quick View
Swish Pullover 2.0
Quick View
Swish Vest 2.0
Quick View
Swish Vest 2.0
Quick View
Speed Tights
Quick View
Speed Capris
Quick View
Pocket Tightz
Quick View
Pocket Manpris
Quick View
Tech Gloves
Quick View
EZ Gloves
Quick View
EZ Gloves
Quick View
EZ Sleeves | Men
Quick View
EZ Sleeves | Women
Quick View
The Toaster | Online Exclusive
Quick View
The Toaster Vest | Online Exclusive
Quick View
The Toaster | Online Exclusive
Quick View
The Toaster Vest | Online Exclusive
Quick View
Cocoon 2.0
Quick View
Warm Up n' Go
Quick View
Warm Up n' Go
Quick View