Use this script to enable sticky filters on the site
<!-- Start Fast Simon Code -->
<script>
var IS_CSTM_SCROLL_ATTACHED = false;
const SCROLL_STICKY_HEADER_HEIGHT = 100;
var __isp_options = {
isp_serp_with_product_attributes: 1,
isp_serp_callback: function (data) {
// Sticky Desktop Filters
if ( window.matchMedia('(min-width: 770px)').matches ) { //Desktop
if ( !IS_CSTM_SCROLL_ATTACHED ) {
window.addEventListener('scroll', ispStickyDesktopFilters, false);
IS_CSTM_SCROLL_ATTACHED = true;
}
}
}
};
function ispStickyDesktopFilters(e){
var dr_el = document.getElementById('isp_search_result_page_container');
if (dr_el) {
var left_obj = document.getElementById('isp_left_container');
var main_obj = document.getElementById('isp_search_results_container');
var left_obj_bottom = (left_obj.offsetTop + left_obj.offsetHeight);
var window_bottom = window.pageYOffset + window.innerHeight;
try {
var left_nav_style = left_obj.currentStyle || window.getComputedStyle(left_obj);
var left_nav_margins = parseInt(left_nav_style.marginTop.replace('px', ''), 10) + parseInt(left_nav_style.marginBottom.replace('px', ''), 10);
} catch (e) {
var left_nav_margins = 0;
}
var fix_it_cond = (window.pageYOffset > findPos(main_obj)[1]);
if (fix_it_cond) {
var need_style = 'fixed';
} else {
var need_style = 'initial';
}
var maxTop = main_obj.offsetHeight + main_obj.offsetTop - left_obj.offsetHeight;
if (need_style == 'fixed' ){
var jq_left_obj = $jquery_isp(left_obj);
var width = left_obj.offsetWidth - parseInt(jq_left_obj.css('padding-left')) - parseInt(jq_left_obj.css('padding-left'));
left_obj.style.width = '11%';
left_obj.style.top = SCROLL_STICKY_HEADER_HEIGHT + 'px';
left_obj.style.marginTop = '0px';
left_obj.className = ( left_obj.className.indexOf('isp_serp_left_nav_sticky') < 0 ) ? left_obj.className + " isp_serp_left_nav_sticky" : left_obj.className ;
if( window.scrollY > maxTop ){
need_style = 'initial';
left_obj.style.width = '16%';
left_obj.className = left_obj.className.replace(" isp_serp_left_nav_sticky", "");
left_obj.style.marginTop = ( main_obj.offsetHeight - left_obj.offsetHeight + SCROLL_STICKY_HEADER_HEIGHT) + 'px';
}
}
else if (need_style == 'initial' ){
left_obj.style.width = left_obj.style.width;
left_obj.style.marginTop = '0px';
left_obj.className = left_obj.className.replace(" isp_serp_left_nav_sticky", "");
}
}
}
</script>
<!-- End Fast Simon Code -->