Natural Bar Soaps 26
SUDS™ small batch, handcrafted soaps are full of vitamin-rich oils & butters that nourish & moisturize your skin. Made from scratch in the USA using natural & organic ingredients.
{
const mq = window.matchMedia( '(max-width: 990px)' );
if (mq.matches) {
return
}
const queryString = new URLSearchParams(new FormData($refs.filter_form)).toString()
loading = true;
let queryWithSort = '?sort_by=' + sort + '&' + queryString
let filterUrl = '/collections/bar-soaps' + queryWithSort;
fetch(filterUrl)
.then(response => response.text())
.then(data => {
let html_div = document.createElement('div');
html_div.innerHTML = data;
let html_dom = html_div.querySelector('#ProductGridContainer').innerHTML;
document.querySelector('#ProductGridContainer').innerHTML = html_dom;
// update url without refreshing the page
history.replaceState(null, null, '?sort_by=' + sort + '&' + queryString);
let paginationEl = document.querySelector('#product_pagination')
let pagination_dom = html_div.querySelector('#product_pagination').innerHTML;
if(paginationEl) {
paginationEl.innerHTML = pagination_dom;
}
})
.catch(error => console.error('Error:', error))
.finally(() =>{
pageNum = 1
loading = false
});
})
"
@filter-push.window="
$nextTick(() => {
loading = true;
fetch($event.detail.new_url)
.then(response => response.text())
.then(data => {
let html_div = document.createElement('div');
html_div.innerHTML = data;
let html_dom = html_div.querySelector('#ProductGridContainer').innerHTML;
document.querySelector('#ProductGridContainer').innerHTML = html_dom;
let paginationEl = document.querySelector('#product_pagination')
let pagination_dom = html_div.querySelector('#product_pagination').innerHTML;
if(paginationEl) {
paginationEl.innerHTML = pagination_dom;
}
// move promotion banner on position
// update url without refreshing the page
history.pushState(null, null, $event.detail.new_url);
})
.catch(error => console.error('Error:', error))
.finally(() => {
let queryString = new URLSearchParams(new FormData($refs.filter_form)).toString();
query = queryString
loading = false
pageNum = 1
});
})
"
@filter-apply.window="
$nextTick(() => {
const queryString = new URLSearchParams(new FormData($refs.filter_form)).toString()
loading = true;
let queryWithSort = '?sort_by=' + sort + '&' + queryString
let filterUrl = '/collections/bar-soaps' + queryWithSort;
fetch(filterUrl)
.then(response => response.text())
.then(data => {
let html_div = document.createElement('div');
html_div.innerHTML = data;
let html_dom = html_div.querySelector('#ProductGridContainer').innerHTML;
document.querySelector('#ProductGridContainer').innerHTML = html_dom;
// update url without refreshing the page
history.replaceState(null, null, '?sort_by=' + sort + '&' + queryString);
let paginationEl = document.querySelector('#product_pagination')
let pagination_dom = html_div.querySelector('#product_pagination').innerHTML;
if(paginationEl) {
paginationEl.innerHTML = pagination_dom;
}
})
.catch(error => console.error('Error:', error))
.finally(() =>{
pageNum = 1
loading = false
});
})
"
@filter-push.window="
$nextTick(() => {
loading = true;
fetch($event.detail.new_url)
.then(response => response.text())
.then(data => {
let html_div = document.createElement('div');
html_div.innerHTML = data;
let html_dom = html_div.querySelector('#ProductGridContainer').innerHTML;
document.querySelector('#ProductGridContainer').innerHTML = html_dom;
let paginationEl = document.querySelector('#product_pagination')
let pagination_dom = html_div.querySelector('#product_pagination').innerHTML;
if(paginationEl) {
paginationEl.innerHTML = pagination_dom;
}
// move promotion banner on position
// update url without refreshing the page
history.pushState(null, null, $event.detail.new_url);
})
.catch(error => console.error('Error:', error))
.finally(() => {
let queryString = new URLSearchParams(new FormData($refs.filter_form)).toString();
query = queryString
loading = false
pageNum = 1
});
})
"
@filter-clear.window="
$nextTick(() => {
loading = true;
fetch('/collections/bar-soaps')
.then(response => response.text())
.then(data => {
let html_div = document.createElement('div');
html_div.innerHTML = data;
let html_dom = html_div.querySelector('#ProductGridContainer').innerHTML;
document.querySelector('#ProductGridContainer').innerHTML = html_dom;
let paginationEl = document.querySelector('#product_pagination')
let pagination_dom = html_div.querySelector('#product_pagination').innerHTML;
if(paginationEl) {
paginationEl.innerHTML = pagination_dom;
}
// update url without refreshing the page
history.pushState(null, null, '/collections/bar-soaps');
})
.catch(error => console.error('Error:', error))
.finally(() => {
let queryString = new URLSearchParams(new FormData($refs.filter_form)).toString();
query = queryString
pageNum = 1
loading = false
running_text()
});
})
"
>
Filter & Sort