FacetWp 预订不适用于 woocommerce 预订?

Posted

技术标签:

【中文标题】FacetWp 预订不适用于 woocommerce 预订?【英文标题】:FacetWp booking adon not working with woocommerce bookings? 【发布时间】:2019-09-19 12:53:36 【问题描述】:

我正在开发一个预订网站。

我在插件上使用 FacetWp 预订广告按日期过滤我的列表,我也在使用 woocommerce 预订(Accomadation 插件)。

一个月前我安装这个插件之前它工作正常,但从过去几天开始它不工作,当我按下搜索按钮时没有任何反应。我可以在与此插件相关的浏览器控制台中看到以下错误,我试图联系 FacetWp 支持团队,但没有得到他们的任何回复。我不知道插件发生了什么。没有这个过滤器,我的网站毫无用处。当他们甚至无法为您提供支持时,购买付费插件有什么用。这是错误。

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)

谢谢!

这个front.min.js文件的代码

对不起,它在 JS 文件中的格式是这样的。我对将其格式化为更易读的形式的代码了解不多。

!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 ,上下文:o,i=n[e][t];i?(i.push(s),i=function(e)for(var t,a,c,o=1,n=e.长度;ot.priority;)e[a]=e[a-1],--a;e[a]=treturn e(i)):i=[s],n[e][t ]=i函数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_r efresh&&!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.渲染(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(元素: 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.loadi ng_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 ||"自动完成"===n?decodeURIComponent(o):decodeURIComponent(o).split(","))),FWP.build_post_data=function()returnfacets: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.模板?document.URL:FWP_JSON.ajaxurl,a=type:"POST",dataType:"text",data:action:"facetwp_refresh",data:FWP.build_post_data(),success:function(t)尝试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"))i f(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="

"+a+""),e(".facetwp-selections").html(a)),e(document).on("click",".facetwp-selections .facetwp-选择值",function()if(!FWP.is_refresh)var t=e(this).closest("li").attr("data-facet"),a=e(this).attr( "数据值");""!=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-自动完成e").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),FW P.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-复选框 .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-che ckboxes .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).lengtht.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.f acets[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:"Ymd",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-下拉菜单lect",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(do cument).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-hierarch y .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】:

facetWP WooCommerce 预订可用性插件/插件的最新版本 包含未缩小的资产,这应该会使调试更加容易。

【讨论】:

以上是关于FacetWp 预订不适用于 woocommerce 预订?的主要内容,如果未能解决你的问题,请参考以下文章

php facetwp预订查询

php facetwp facetwp-woocommerce的模板

php facetwp在facetwp模板中使用woocommerce占位符图像

php facetwp woocommerce facetwp-template with hooks

漂亮的复选框不适用于 WooCommerce

WooCommerce 自定义订单操作不适用于垃圾状态