Back
Shop by categories
Cargo Pants Hi Vis Cargo Pants Hi Vis Jacket Hi Vis Jeans Hi Vis Pants Hi Vis Polo Hi Vis Shirt Hi Vis Shorts Hi Vis Wet Weather Trouser Jeans Long Sleeve Shirt Pants Short Sleeve Shirt Shorts {
console.log($event.detail.page);
fetch($event.detail.page)
.then(response => response.text())
.then(data => {
let html_div = document.createElement('div');
html_div.innerHTML = data;
let html_dom = html_div.querySelector('.products-grid').innerHTML;
document.querySelector('.products-grid').innerHTML = html_dom;
// update url without refreshing the page
history.replaceState(null, null, $event.detail.page);
})
.catch(error => console.error('Error:', error))
.finally(() => loading = false);
})"
@filter-updated.window="$nextTick(() => {
const queryString = new URLSearchParams(new FormData($refs.filter_form)).toString()
const queryStringF = window.location.search;
const urlParams = new URLSearchParams(queryString);
const urlParamsF = new URLSearchParams(queryStringF);
loading = true;
if (urlParamsF.has('sort_by') && !urlParamsF.has('q')) {
const sorted = urlParamsF.get('sort_by');
console.log('?sort_by=' + sorted + '&' + queryString.toString());
fetch('/collections/bisley?sort_by=' + sorted + '&' + queryString)
.then(response => response.text())
.then(data => {
let html_div = document.createElement('div');
html_div.innerHTML = data;
let html_dom = html_div.querySelector('.products-grid').innerHTML;
document.querySelector('.products-grid').innerHTML = html_dom;
// update url without refreshing the page
history.replaceState(null, null, '?sort_by=' + sorted + '&' + queryString);
})
.catch(error => console.error('Error:', error))
.finally(() => loading = false);
} else if ( window.location.href.indexOf('types') > -1 && urlParamsF.has('q')) {
const collectionType = urlParamsF.get('q')
console.log(collectionType)
fetch('/collections/types?q=' + collectionType + '&' + queryString)
.then(response => response.text())
.then(data => {
let html_div = document.createElement('div');
html_div.innerHTML = data;
let html_dom = html_div.querySelector('.products-grid').innerHTML;
document.querySelector('.products-grid').innerHTML = html_dom;
// update url without refreshing the page
history.replaceState(null, null, 'types?q=' + collectionType + '&' + queryString);
})
.catch(error => console.error('Error:', error))
.finally(() => loading = false);
} else {
console.log(urlParamsF.has('page'));
fetch('/collections/bisley?' + queryString)
.then(response => response.text())
.then(data => {
let html_div = document.createElement('div');
html_div.innerHTML = data;
let html_dom = html_div.querySelector('.products-grid').innerHTML;
document.querySelector('.products-grid').innerHTML = html_dom;
// update url without refreshing the page
history.replaceState(null, null, '/collections/bisley/?' + queryString);
})
.catch(error => console.error('Error:', error))
.finally(() => loading = false);
}
})"
>