I am developing a booking website.
i am using FacetWp bookings ad on plugin to filter my listings by date and I am using woocommerce bookings (Acccomadation Plugin) as well.
it was working fine before when I installed this plugin a month ago but from past few days its not working, nothing happens when I press the search button. I can see following error in the browser console related to this plugin, and I tried to reach FacetWp support team but so have not got any response from them. I do not know whats going on with the plugin. My website is useless without this filter. What is the use of buying a paid plugin when they cant even provide you a support. Here is the error.
Uncaught TypeError: Cannot read property 'remove' of undefined
at (index):1194
at a (front.min.js?ver=3.3.6:1)
at Object.doAction (front.min.js?ver=3.3.6:1)
at HTMLDivElement.<anonymous> (front.min.js?ver=3.3.6:1)
at Function.each (jquery.js:2)
at a.fn.init.each (jquery.js:2)
at Object.FWP.parse_facets (front.min.js?ver=3.3.6:1)
at facetWpRedirect ((index):588)
at HTMLInputElement.onclick ((index):555)
Thanks!
Well this Code of front.min.js file
Well Sorry its the way it is formatted in he JS file. I do not have much understanding of the code to format it in more readable form.
!function()
{"use strict";var e;(e=window).FWP=e.FWP||{},e.FWP.hooks=e.FWP.hooks||new function(){function e(e,t,a,c){var o,s,i;if(n[e][t])if(a)if(o=n[e][t],c)for(i=o.length;i--;)(s=o[i]).callback===a&&s.context===c&&o.splice(i,1);else for(i=o.length;i--;)o[i].callback===a&&o.splice(i,1);else n[e][t]=[]}function t(e,t,a,c,o){var s={callback:a,priority:c,context:o},i=n[e][t];i?(i.push(s),i=function(e){for(var t,a,c,o=1,n=e.length;ot.priority;)e[a]=e[a-1],--a;e[a]=t}return e}(i)):i=[s],n[e][t]=i}function a(e,t,a){var c,o,s=n[e][t];if(!s)return"filters"===e&&a[0];if(o=s.length,"filters"===e)for(c=0;c":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,function(e){return t[e]}).trim()},FWP.helper.detect_loop=function(e){for(var t=null,a=document.createNodeIterator(e,NodeFilter.SHOW_COMMENT,FWP.helper.node_filter,!1);t=a.nextNode();)if(8===t.nodeType&&"fwp-loop"===t.nodeValue)return t.parentNode;return!1},FWP.helper.node_filter=function(){return NodeFilter.FILTER_ACCEPT},FWP.autoload=function(){FWP.auto_refresh&&!FWP.is_refresh&&FWP.refresh()},FWP.refresh=function(){FWP.is_refresh=!0,FWP.is_reset||FWP.parse_facets(),FWP.loaded||FWP.load_from_hash(),e(document).trigger("facetwp-refresh"),FWP.loaded&&!FWP.is_popstate&&FWP.set_hash(),FWP.loaded||FWP.is_bfcache||!t(FWP_JSON.preload_data)?FWP.fetch_data():FWP.render(FWP_JSON.preload_data),e.each(FWP.frozen_facets,function(e,t){"hard"!==t&&delete FWP.frozen_facets[e]}),FWP.paged=1,FWP.soft_refresh=!1,FWP.is_refresh=!1,FWP.is_reset=!1},FWP.parse_facets=function(){FWP.facets={},e(".facetwp-facet").each(function(){var a=e(this),c=a.attr("data-name"),o=a.attr("data-type");FWP.facet_type[c]=o,FWP.hooks.doAction("facetwp/refresh/"+o,a,c);var n=!0;FWP.loaded&&(FWP.soft_refresh||t(FWP.frozen_facets[c]))&&(n=!1),n&&FWP.loading_handler({element:a,facet_name:c,facet_type:o})}),1'),a.find(".facetwp-overlay").css({width:a.width(),height:a.height()})}),e(document).on("facetwp-loaded",function(){a.find(".facetwp-overlay").remove()})}}else""==FWP_JSON.loading_animation&&t.element.html('')},FWP.build_query_string=function(){var t="",a=[],c=window.location.search.replace("?","").split("&");e.each(c,function(e,t){0!==t.split("=")[0].indexOf(FWP_JSON.prefix)&&a.push(t)}),a=a.join("&");var o=FWP.helper.serialize(FWP.facets,FWP_JSON.prefix);return""!==a&&(t+=a),""!==o&&(t+=(""!==a?"&":"")+o),t},FWP.set_hash=function(){var e=FWP.build_query_string();""!==e&&(e="?"+e),history.pushState&&history.pushState(null,null,window.location.pathname+e),FWP_HTTP.get={},window.location.search.replace("?","").split("&").forEach(function(e){var t=e.split("=");FWP_HTTP.get[t[0]]=t[1]})},FWP.load_from_hash=function(){var a=[],c=window.location.search.replace("?","").split("&");e.each(c,function(e,t){0===t.split("=")[0].indexOf(FWP_JSON.prefix)&&a.push(t.replace(FWP_JSON.prefix,""))}),a=a.join("&"),e.each(FWP.facets,function(e){FWP.facets[e]=[]}),FWP.paged=1,FWP.extras.sort="default",""!==a&&(a=a.split("&"),e.each(a,function(e,a){var c=a.split("=")[0],o=a.split("=")[1];if("paged"===c)FWP.paged=o;else if("per_page"===c||"sort"===c)FWP.extras[c]=o;else if(""!==o){var n=t(FWP.facet_type[c])?FWP.facet_type[c]:"";FWP.facets[c]="search"===n||"autocomplete"===n?decodeURIComponent(o):decodeURIComponent(o).split(",")}}))},FWP.build_post_data=function(){return{facets:JSON.stringify(FWP.facets),frozen_facets:FWP.frozen_facets,http_params:FWP_HTTP,template:FWP.template,extras:FWP.extras,soft_refresh:FWP.soft_refresh?1:0,is_bfcache:FWP.is_bfcache?1:0,first_load:FWP.loaded?0:1,paged:FWP.paged}},FWP.fetch_data=function(){FWP.jqXHR&&4!==FWP.jqXHR.readyState&&FWP.jqXHR.abort();var t="wp"===FWP.template?document.URL:FWP_JSON.ajaxurl,a={type:"POST",dataType:"text",data:{action:"facetwp_refresh",data:FWP.build_post_data()},success:function(t){try{var a=e.parseJSON(t);FWP.render(a)}catch(n){var c=t.indexOf('{"facets');if(-1c.length){var o=document.createElement("div");o.innerHTML=a.template;var n=FWP.helper.detect_loop(o);n&&(c=e(n).addClass("facetwp-template"))}if(01){var n=o.indexOf(c);-10)){var a=FWP.helper.detect_loop(document.body);if(!a)return;e(a).addClass("facetwp-template")}var c=e(".facetwp-template:first");FWP.template=c.is("[data-name]")?c.attr("data-name"):"wp",0'+FWP.helper.escape_html(t.label)+""}),a+=''+FWP.settings.labels[c]+": "+i+""}),""!==a&&(a="
"),e(".facetwp-selections").html(a)}),e(document).on("click",".facetwp-selections .facetwp-selection-value",function(){if(!FWP.is_refresh){var t=e(this).closest("li").attr("data-facet"),a=e(this).attr("data-value");""!=a?FWP.reset(t,a):FWP.reset(t)}}),e(document).on("click",".facetwp-page",function(){e(".facetwp-page").removeClass("active"),e(this).addClass("active"),FWP.paged=e(this).attr("data-page"),FWP.soft_refresh=!0,FWP.refresh()}),e(document).on("change",".facetwp-per-page-select",function(){FWP.extras.per_page=e(this).val(),FWP.soft_refresh=!0,FWP.autoload()}),e(document).on("change",".facetwp-sort-select",function(){FWP.extras.sort=e(this).val(),FWP.soft_refresh=!0,FWP.autoload()}),FWP.refresh()},e(function(){FWP.init()})}(jQuery),function(e){FWP.logic=FWP.logic||{},e.fn.pVal=function(){var t=e(this).eq(0).val();return t===e(this).attr("placeholder")?"":t};var t=!1;FWP.hooks.addAction("facetwp/refresh/autocomplete",function(e,t){var a=e.find(".facetwp-autocomplete").val()||"";FWP.facets[t]=a}),e(document).on("facetwp-loaded",function(){e(".facetwp-autocomplete:not(.ready)").each(function(){var a=e(this),c=a.closest(".facetwp-facet").attr("data-name"),o=FWP.hooks.applyFilters("facetwp/set_options/autocomplete",{serviceUrl:"wp"===FWP.template?document.URL:FWP_JSON.ajaxurl,type:"POST",minChars:3,deferRequestBy:200,showNoSuggestionNotice:!0,triggerSelectOnValidInput:!1,noSuggestionNotice:FWP_JSON.no_results,onSelect:function(){t=!0,FWP.autoload()},params:{action:"facetwp_autocomplete_load",facet_name:c,data:FWP.build_post_data()}},{facet_name:c});a.autocomplete(o),a.addClass("ready")})}),e(document).on("keyup",".facetwp-autocomplete",function(e){13!==e.which||t||FWP.autoload(),t&&(t=!1)}),e(document).on("click",".facetwp-autocomplete-update",function(){FWP.autoload()}),FWP.hooks.addAction("facetwp/refresh/checkboxes",function(t,a){var c=[];t.find(".facetwp-checkbox.checked").each(function(){c.push(e(this).attr("data-value"))}),FWP.facets[a]=c}),FWP.hooks.addFilter("facetwp/selections/checkboxes",function(t,a){var c=[];return e.each(a.selected_values,function(e,t){var o=a.el.find('.facetwp-checkbox[data-value="'+t+'"]').clone();o.find(".facetwp-counter").remove(),o.find(".facetwp-expand").remove(),c.push({value:t,label:o.text()})}),c}),e(document).on("click",".facetwp-type-checkboxes .facetwp-expand",function(t){var a=e(this).parent(".facetwp-checkbox").next(".facetwp-depth");a.toggleClass("visible");var c=a.hasClass("visible")?FWP_JSON.collapse:FWP_JSON.expand;e(this).html(c),t.stopPropagation()}),e(document).on("click",".facetwp-type-checkboxes .facetwp-checkbox:not(.disabled)",function(){e(this).toggleClass("checked"),FWP.autoload()}),e(document).on("click",".facetwp-type-checkboxes .facetwp-toggle",function(){var t=e(this).closest(".facetwp-facet");t.find(".facetwp-toggle").toggleClass("facetwp-hidden"),t.find(".facetwp-overflow").toggleClass("facetwp-hidden")}),e(document).on("facetwp-loaded",function(){e(".facetwp-type-checkboxes .facetwp-overflow").each(function(){var t=e(this).find(".facetwp-checkbox").length,a=e(this).siblings(".facetwp-toggle:first");a.text(a.text().replace("{num}",t))}),e(".facetwp-type-checkboxes").each(function(){var t=e(this),a=t.attr("data-name");Object.keys(FWP.settings).length<1||("yes"===FWP.settings[a].show_expanded&&t.find(".facetwp-depth").addClass("visible"),1>t.find(".facetwp-expand").length&&(t.find(".facetwp-depth").each(function(){var t=e(this).hasClass("visible")?"collapse":"expand";e(this).prev(".facetwp-checkbox").append(''+FWP_JSON[t]+"")}),t.find(".facetwp-checkbox.checked").each(function(){e(this).parents(".facetwp-depth").each(function(){e(this).prev(".facetwp-checkbox").find(".facetwp-expand").html(FWP_JSON.collapse),e(this).addClass("visible")}),e(this).find(".facetwp-expand").trigger("click")})))})}),FWP.hooks.addAction("facetwp/refresh/radio",function(t,a){var c=[];t.find(".facetwp-radio.checked").each(function(){c.push(e(this).attr("data-value"))}),FWP.facets[a]=c}),FWP.hooks.addFilter("facetwp/selections/radio",function(t,a){var c=[];return e.each(a.selected_values,function(e,t){var o=a.el.find('.facetwp-radio[data-value="'+t+'"]').clone();o.find(".facetwp-counter").remove(),c.push({value:t,label:o.text()})}),c}),e(document).on("click",".facetwp-type-radio .facetwp-radio:not(.disabled)",function(){var t=e(this).hasClass("checked");e(this).closest(".facetwp-facet").find(".facetwp-radio").removeClass("checked"),t||e(this).addClass("checked"),FWP.autoload()}),FWP.hooks.addAction("facetwp/refresh/date_range",function(e,t){var a=e.find(".facetwp-date-min").pVal()||"",c=e.find(".facetwp-date-max").pVal()||"";FWP.facets[t]=""!==a||""!==c?[a,c]:[]}),FWP.hooks.addFilter("facetwp/selections/date_range",function(e,t){var a=t.selected_values,c=t.el,o="";return""!==a[0]&&(o+=""+FWP_JSON.datepicker.fromText+""+c.find(".facetwp-date-min").next().val()),""!==a[1]&&(o+=""+FWP_JSON.datepicker.toText+""+c.find(".facetwp-date-max").next().val()),o}),e(document).on("facetwp-loaded",function(){var t=e('.facetwp-type-date_range .facetwp-date:not(".ready, .flatpickr-alt")');if(0!==t.length){var a={altInput:!0,altInputClass:"flatpickr-alt",altFormat:"Y-m-d",disableMobile:!0,locale:FWP_JSON.datepicker.locale,onChange:function(){FWP.autoload()},onReady:function(t,a,c){var o=''+FWP_JSON.datepicker.clearText+"";e(o).on("click",function(){c.clear(),c.close()}).appendTo(e(c.calendarContainer))}};t.each(function(){var t=e(this),c=t.closest(".facetwp-facet").attr("data-name");a.altFormat=FWP.settings[c].format;var o=FWP.hooks.applyFilters("facetwp/set_options/date_range",a,{facet_name:c,element:t});new flatpickr(this,o),t.addClass("ready")})}}),FWP.hooks.addAction("facetwp/refresh/dropdown",function(e,t){var a=e.find(".facetwp-dropdown").val();FWP.facets[t]=a?[a]:[]}),FWP.hooks.addFilter("facetwp/selections/dropdown",function(e,t){return t.el.find(".facetwp-dropdown option:selected").text()}),e(document).on("change",".facetwp-type-dropdown select",function(){var t=e(this).closest(".facetwp-facet"),a=t.attr("data-name");""!==t.find(":selected").val()&&(FWP.frozen_facets[a]="soft"),FWP.autoload()}),FWP.hooks.addAction("facetwp/refresh/fselect",function(t,a){var c=t.find("select").val();null===c||""===c?c=[]:!1===e.isArray(c)&&(c=[c]),FWP.facets[a]=c}),FWP.hooks.addFilter("facetwp/selections/fselect",function(t,a){var c=[];return e.each(a.selected_values,function(e,t){var o=a.el.find('.facetwp-dropdown option[value="'+t+'"]').text();c.push({value:t,label:o.replace(/{{(.*?)}}/,"")})}),c}),e(document).on("facetwp-loaded",function(){e(".facetwp-type-fselect select:not(.ready)").each(function(){var t=e(this).closest(".facetwp-facet").attr("data-name"),a=FWP.settings[t];a.optionFormatter=function(e){return e=(e=e.replace(/{{/g,'')).replace(/}}/g,"")};var c=FWP.hooks.applyFilters("facetwp/set_options/fselect",a,{facet_name:t});e(this).fSelect(c),e(this).addClass("ready")}),e(".fs-wrap.fs-disabled").removeClass("fs-disabled")}),e(document).on("fs:changed",function(t,a){if(e(a).closest(".facetwp-facet").length>0&&a.classList.contains("multiple")){var c=e(a).closest(".facetwp-facet").attr("data-name");"or"===FWP.settings[c].operator&&(FWP.frozen_facets[c]="soft",FWP.auto_refresh&&e(a).addClass("fs-disabled")),FWP.autoload()}}),e(document).on("fs:closed",function(t,a){e(a).closest(".facetwp-facet").length>0&&!a.classList.contains("multiple")&&FWP.autoload()}),FWP.hooks.addAction("facetwp/refresh/hierarchy",function(t,a){var c=[];t.find(".facetwp-link.checked").each(function(){c.push(e(this).attr("data-value"))}),FWP.facets[a]=c}),FWP.hooks.addFilter("facetwp/selections/hierarchy",function(e,t){return t.el.find(".facetwp-link.checked").text()}),e(document).on("click",".facetwp-type-hierarchy .facetwp-link",function(){e(this).closest(".facetwp-facet").find(".facetwp-link").removeClass("checked"),""!==e(this).attr("data-value")&&e(this).addClass("checked"),FWP.autoload()}),e(document).on("click",".facetwp-type-hierarchy .facetwp-toggle",function(){var t=e(this).closest(".facetwp-facet");t.find(".facetwp-toggle").toggleClass("facetwp-hidden"),t.find(".facetwp-overflow").toggleClass("facetwp-hidden")}),FWP.hooks.addAction("facetwp/refresh/number_range",function(e,t){var a=e.find(".facetwp-number-min").val()||"",c=e.find(".facetwp-number-max").val()||"";FWP.facets[t]=""!==a||""!==c?[a,c]:[]}),FWP.hooks.addFilter("facetwp/selections/number_range",function(e,t){return t.selected_values[0]+" - "+t.selected_values[1]}),e(document).on("click",".facetwp-type-number_range .facetwp-submit",function(){FWP.refresh()}),e(document).on("facetwp-loaded",function(){var t=e(".facetwp-location");t.length<1||(FWP.loaded||(window.FWP_MAP=window.FWP_MAP||{},FWP_MAP.sessionToken=new google.maps.places.AutocompleteSessionToken,FWP_MAP.autocompleteService=new google.maps.places.AutocompleteService,FWP_MAP.placesService=new google.maps.places.PlacesService(document.createElement("div")),e(document).on("input",".facetwp-location",FWP.helper.debounce(function(){var t=e(this).val(),a=e(this).closest(".facetwp-facet");if(""==t||t.length',c+=''+e.structured_formatting.main_text+"",c+=''+e.structured_formatting.secondary_text+"",c+=''+e.description+"",c+=""}),a.find(".location-results").html(c).removeClass("facetwp-hidden")}})}},FWP_JSON.proximity.queryDelay))),t.each(function(t,a){var c=e(this);c.closest(".location-wrap").length<1&&(0===t&&(c.attr("id","facetwp-location"),c.closest(".facetwp-facet").find(".facetwp-radius").attr("id","facetwp-radius")),c.wrap(''),c.before(''),c.after('')),c.trigger("keyup")}))}),e(document).on("click",".location-result",function(){var t=e(this).closest(".facetwp-facet"),a=e(this).attr("data-id"),c=e(this).find(".result-description").text();FWP_MAP.placesService.getDetails({placeId:a,fields:["geometry"]},function(e,a){a===google.maps.places.PlacesServiceStatus.OK&&(t.find(".facetwp-lat").val(e.geometry.location.lat()),t.find(".facetwp-lng").val(e.geometry.location.lng()),FWP.autoload())}),e(".facetwp-location").val(c),e(".location-results").addClass("facetwp-hidden")}),e(document).on("click",".facetwp-type-proximity .locate-me",function(t){var a=e(this),c=a.closest(".facetwp-facet"),o=c.find(".facetwp-location"),n=c.find(".facetwp-lat"),s=c.find(".facetwp-lng");if(a.hasClass("f-reset"))return n.val(""),n.val(""),o.val(""),void FWP.autoload();a.addClass("f-loading"),navigator.geolocation.getCurrentPosition(function(e){var t=e.coords.latitude,c=e.coords.longitude;n.val(t),s.val(c);var i=new google.maps.Geocoder,r={lat:parseFloat(t),lng:parseFloat(c)};i.geocode({location:r},function(e,t){t===google.maps.GeocoderStatus.OK?o.val(e[0].formatted_address):o.val("Your location"),a.addClass("f-reset"),FWP.autoload()}),a.removeClass("f-loading")},function(){a.removeClass("f-loading")})}),e(document).on("keyup",".facetwp-location",function(t){var a=e(this).closest(".facetwp-facet");if(a.find(".locate-me").toggleClass("f-reset",""!==e(this).val()),38===t.which||40===t.which||13===t.which)var c=parseInt(a.find(".location-result.active").attr("data-index")),o=parseInt(a.find(".location-result:last").attr("data-index"));if(38===t.which){var n=0=parseFloat(c.range.max))return FWP.settings[a].lower=c.range.min,FWP.settings[a].upper=c.range.max,void FWP.hooks.doAction("facetwp/set_label/slider",t);var o=FWP.hooks.applyFilters("facetwp/set_options/slider",{range:c.range,start:c.start,step:parseFloat(c.step),connect:!0},{facet_name:a}),n=e(this)[0];noUiSlider.create(n,o),n.noUiSlider.on("update",function(e,c){FWP.settings[a].lower=e[0],FWP.settings[a].upper=e[1],FWP.hooks.doAction("facetwp/set_label/slider",t)}),n.noUiSlider.on("set",function(){FWP.frozen_facets[a]="hard",FWP.autoload()}),e(this).addClass("ready")}}),e(".facetwp-type-slider").each(function(){var t=e(this).attr("data-name"),a=e(this).find(".facetwp-slider-reset");e.isEmptyObject(FWP.facets[t])?a.hide():a.show()})}),e(document).on("click",".facetwp-type-slider .facetwp-slider-reset",function(){var t=e(this).closest(".facetwp-facet").attr("data-name");FWP.reset(t)}),FWP.hooks.addAction("facetwp/refresh/rating",function(t,a){var c=[];t.find(".facetwp-star.selected").each(function(){var t=e(this).attr("data-value");""!=t&&c.push(t)}),FWP.facets[a]=c}),e(document).on("mouseover",".facetwp-star",function(){var t=e(this).closest(".facetwp-facet");if(e(this).hasClass("selected"))t.find(".facetwp-star-label").text(FWP_JSON.rating.Undo);else{var a="5"==e(this).attr("data-value")?"":FWP_JSON.rating["& up"];t.find(".facetwp-star-label").text(a),t.find(".facetwp-counter").text("("+e(this).data("counter")+")")}}),e(document).on("mouseout",".facetwp-star",function(){var t=e(this).closest(".facetwp-facet");t.find(".facetwp-star-label").text(""),t.find(".facetwp-counter").text("")}),e(document).on("click",".facetwp-star",function(){var t=e(this).closest(".facetwp-facet"),a=e(this).hasClass("selected");t.find(".facetwp-star").removeClass("selected"),a||e(this).addClass("selected"),FWP.autoload()})}(jQuery)}();
Thanks again!