CTX Feed – WooCommerce Product Feed Manager Plugin - Version 4.4.42

Version Description

(2021-12-13) = * Fixed: New added attribute does not work after dragging to new position - issue has been fixed. * Fixed: Woocommerce override schema data issue fixed.

Download this release

Release Info

Developer wahid0003
Plugin Icon 128x128 CTX Feed – WooCommerce Product Feed Manager Plugin
Version 4.4.42
Comparing to
See all releases

Code changes from version 4.4.41 to 4.4.42

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: Product Feed, WooCommerce, Google Shopping, Google Merchant, Facebook Cata
5
  Requires at least: 4.4
6
  Tested Up To: 5.8.2
7
  Requires PHP: 5.6
8
- Stable tag: 4.4.41
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -516,6 +516,10 @@ Using pro version:
516
 
517
  == Changelog ==
518
 
 
 
 
 
519
  = 4.4.41 (2021-12-06) =
520
  * Added: Miinto.de template updated.
521
  * Fixed: Banner collapsed when woocommerce is not installed - issue has been fixed.
5
  Requires at least: 4.4
6
  Tested Up To: 5.8.2
7
  Requires PHP: 5.6
8
+ Stable tag: 4.4.42
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
516
 
517
  == Changelog ==
518
 
519
+ = 4.4.42 (2021-12-13) =
520
+ * Fixed: New added attribute does not work after dragging to new position - issue has been fixed.
521
+ * Fixed: Woocommerce override schema data issue fixed.
522
+
523
  = 4.4.41 (2021-12-06) =
524
  * Added: Miinto.de template updated.
525
  * Fixed: Banner collapsed when woocommerce is not installed - issue has been fixed.
admin/js/woo-feed-admin.js CHANGED
@@ -225,6 +225,8 @@
225
  onDrop: ($item, container, _super, event) => {
226
  $item.removeClass(container.group.options.draggedClass).removeAttr('style');
227
  $("body").removeClass(container.group.options.bodyClass);
 
 
228
  if ( onDrop && 'function' === typeof( onDrop ) ) {
229
  onDrop( $item, container, _super, event );
230
  }
225
  onDrop: ($item, container, _super, event) => {
226
  $item.removeClass(container.group.options.draggedClass).removeAttr('style');
227
  $("body").removeClass(container.group.options.bodyClass);
228
+ var numb = $item.find(".wf_mattributes").attr("name").replace(/\D/g, "");
229
+ $item.find("input.wf_attributes").attr("name", "default["+ numb +"]");
230
  if ( onDrop && 'function' === typeof( onDrop ) ) {
231
  onDrop( $item, container, _super, event );
232
  }
admin/js/woo-feed-admin.min.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var a=t[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),e}!function(s,a,c,l,f){s.fn.disabled=function(o){return s(this).each(function(){var e=s(this),t="disabled";void 0!==e.prop(t)?e.prop(t,void 0===o||!0===o):!0===o?e.addClass(t):e.removeClass(t)}),self},s.fn.isDisabled=function(){var e=s(this),t="disabled";return void 0!==e.prop(t)?e.prop(t):e.hasClass(t)};function e(e){s(e.currentTarget).removeClass(function(e,t){return(t.match(/\btooltipped-\S+/g)||[]).join(" ")}).removeClass("tooltipped").removeAttr("aria-label")}function o(e,t){s(e).addClass("tooltipped tooltipped-s").attr("aria-label",t)}function i(e,t){return s.extend(!0,{},e,t)}function t(){n=s(".toClipboard"),!ClipboardJS.isSupported()||/iPhone|iPad/i.test(navigator.userAgent)?n.find("img").hide(0):(n.each(function(){s(this).on("mouseleave",e).on("blur",e)}),new ClipboardJS(".toClipboard").on("error",function(e){var t;o(e.trigger,(t=e.action,e="cut"===t?"X":"C",t=/iPhone|iPad/i.test(navigator.userAgent)?"No support :(":/Mac/i.test(navigator.userAgent)?"Press ⌘-"+e+" to "+t:"Press Ctrl-"+e+" to "+t))}).on("success",function(e){o(e.trigger,"Copied")}))}var n,r,d,_=function(){function a(e,t,o){_classCallCheck(this,a),this.productCustomFields(e,t,o)}return _createClass(a,[{key:"cacheClear",value:function(){var e={action:"woo_feed_product_attribute_cache_remove",nonce:wpf_ajax_obj.ajax.nonce};s.ajax({method:"POST",url:wpf_ajax_obj.wpf_ajax_url,data:e})}},{key:"productCustomFields",value:function(t){var o=this,e={action:"woo_feed_custom_fields_status_change",nonce:wpf_ajax_obj.ajax.nonce,field:t,status:1<arguments.length&&void 0!==arguments[1]&&arguments[1],isTaxonomy:2<arguments.length?arguments[2]:void 0};s.ajax({method:"POST",url:wpf_ajax_obj.wpf_ajax_url,data:e,success:function(e){e.success?o.cacheClear():console.log(e),s("#"+t+"-switcher").closest("td").find(".switch-loader").hide()}})}}]),a}(),u=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"wooFeed_get_google_categories",value:function(){l.send("get_google_categories",{type:"GET",data:{_ajax_nonce:f.nonce,action:"get_google_categories"}}).then(function(e){s(".selectize-google-category").selectize({valueField:"value",labelField:"text",placeholder:"Select a category",searchField:["value","text"],options:e,render:{option:function(e,t){return'<div class="item wapk-selectize-item">'.concat(t(e.value+" - "+e.text),"</div>")},item:function(e,t){return'<div class="item wapk-selectize-item">'.concat(t(e.value+" - "+e.text),"</div>")}}})}).fail(p.ajax_fail)}},{key:"wooFeed_get_facebook_categories",value:function(){l.send("get_facebook_categories",{type:"GET",data:{_ajax_nonce:f.nonce,action:"get_facebook_categories"}}).then(function(e){s(".selectize-google-category").selectize({valueField:"value",labelField:"text",placeholder:"Select a Facebook category",searchField:["value","text"],options:e,render:{option:function(e,t){return'<div class="item wapk-selectize-item">'.concat(t(e.value+" - "+e.text),"</div>")},item:function(e,t){return'<div class="item wapk-selectize-item">'.concat(t(e.value+" - "+e.text),"</div>")}}})}).fail(p.ajax_fail)}}]),e}(),p={in_array:function(e,t){try{return-1!==t.indexOf(e)}catch(e){return!1}},selectize_render_item:function(e,t){return'<div class="item wapk-selectize-item">'.concat(t(e.text),"</div>")},ajax_fail:function(e){console.warn(e),alert(e.hasOwnProperty("statusText")&&e.hasOwnProperty("status")?f.ajax.error+"\n"+e.statusText+" ("+e.status+")":e)},sortable:function(e,o,a,n){return(e||s(".sorted_table")).each(function(){var e=s(this),t=e.find("tbody > tr:eq(0) > td").length||a||9;e.wf_sortable(i({containerSelector:"table",itemPath:"> tbody",itemSelector:"tr",handle:"i.wf_sortedtable",placeholder:'<tr class="placeholder"><td colspan="'.concat(t,'"></td></tr>'),onDrop:function(e,t,o,a){e.removeClass(t.group.options.draggedClass).removeAttr("style"),s("body").removeClass(t.group.options.bodyClass),n&&"function"==typeof n&&n(e,t,o,a)}},o))})},selectize:function(e,t){return(e||s("select.selectize")).not(".selectized").not(".selectize-google-category").each(function(){var e=s(this);e.selectize(i({create:e.data("create")||!1,plugins:e.data("plugins")?e.data("plugins").split(",").map(function(e){return e.trim()}):[],render:{item:p.selectize_render_item}},t))})},fancySelect:function(e,t){return(e||s("select.fancySelect")).not(".FancySelectInit").each(function(){s(this).fancySelect(i({maxItemShow:3},t))})},reindex_config_table:function(){s("#table-1").find("tbody tr").each(function(o,e){s(e).find("[name]").each(function(e,t){s(t).attr("name",s(t).attr("name").replace(/(\[\d\])/g,"[".concat(o,"]")))})})},common:function(){p.sortable(s(".sorted_table"),{},9,p.reindex_config_table),p.selectize(),p.fancySelect(s(".outputType"))}},h={form:null,init:function(){this.form=s(".generateFeed"),this.form.length&&(p.common(),s(c).trigger("feed_editor_init"),s(c).trigger(new jQuery.Event("feedEditor.init",{target:this.form})))},renderMerchantInfo:function(o,a,n){for(var e in n)!function(e){var t;n.hasOwnProperty(e)&&(o.find(".merchant-info-section."+e+" .data").html(n[e]),"feed_file_type"===e&&((t=n[e].split(",").map(function(e){return e.trim().toLowerCase()}).filter(function(e){return""!==e&&e!==f.na.toLowerCase()})).length?(a.find("option").removeAttr("selected").each(function(){var e=s(this);e.val()&&!p.in_array(e.val(),t)?e.disabled(!0):e.disabled(!1)}),1===t.length&&a.find('option[value="'+t[0]+'"]').attr("selected","selected")):a.find("option").disabled(!1)))}(e);o.find(".spinner").removeClass("is-active"),a.disabled(!1),a.trigger("change"),s(c).trigger("woo_feed_config_loaded"),a.parent().find(".spinner").removeClass("is-active")},renderMerchantTemplate:function(o,a){for(var e in a)!function(t){var e;a.hasOwnProperty(t)&&("tabs"===t?o.html(a[t]):(e=s('[name="'+t+'"]')).length&&e.each(function(){var e=s(this);e.is("select")?e.find('[value="'+a[t]+'"]').prop("selected",!0):(e.is("[type=checkbox]")||e.is("[type=radio]"))&&e.val()===a[t]?e.prop("checked",!0):e.val(a[t])}).trigger("change"))}(e);h.init()}},g=[],v=[],m=function(){function e(){_classCallCheck(this,e),this._feed=f.generator.feed,this._limit=f.generator.limit,this._progress=0,this._timer=null,this._color=!1,this._total_batch=0,this._current_batch=0,this._product_ids=[],this._progress_per_batch=0,this._refresh=!0,this._regenerate=f.generator.regenerate,a.isRegenerating=!1,this._all_btn=s(".wpf_regenerate"),this._current_btn=s("#".concat(this._feed.replace("wf_config","wf_feed_"))),this._current_btn_label=""}return _createClass(e,[{key:"init",value:function(){var t=this;""!==this._feed&&this._regenerate&&!1===a.isRegenerating&&this.generate();var e=a.location.search;return"webappick-manage-feeds"===new URLSearchParams(e).get("page")&&s("body").addClass("woo-import-popup-body"),s(c).on("click",".woo-feed-campaign-close-button",function(e){e.preventDefault(),s(this).parent(".woo-feed-promotion").hide();e=s(this).data("condition");1===e&&l.post("woo_feed_hide_promotion",{_ajax_nonce:f.nonce,condition:e}).then(function(e){t._log(e)}).fail(function(e){t._log(e),t._updateProgressStatus(e.message),t._color="red"})}),s(c).on("click",".wpf_regenerate",function(e){e.preventDefault(),t._current_btn=s(this),t._current_btn.hasClass("disabled")||!0===a.isRegenerating||(t._feed=t._current_btn.attr("id").replace("wf_feed_","wf_config"),""!==t._feed&&t.generate())}),this}},{key:"_block_button",value:function(){this._all_btn.length&&this._all_btn.addClass("disabled"),this._current_btn.length&&(this._current_btn.find("span").addClass("wpf_spin reverse_spin"),this._current_btn_label=this._current_btn.attr("title"),this._current_btn.attr("aria-label",f.regenerate).attr("title",f.regenerate))}},{key:"_unblock_button",value:function(){this._all_btn.length&&this._all_btn.removeClass("disabled"),this._current_btn.length&&(this._current_btn.find("span").removeClass("wpf_spin"),this._current_btn.find("span").removeClass("reverse_spin"),this._current_btn.attr("aria-label",this._current_btn_label).attr("title",this._current_btn_label))}},{key:"generate",value:function(){var t=this,o=this;a.isRegenerating=!0,this._block_button(),this._resetProgressBar(),this._progressBarActive(),this._log("Counting Total Products"),this._updateProgressStatus("Fetching products."),this._get_product_ids().then(function(e){t._progress=10,o._log({response:e}),e.success?(o._log("Total ".concat(e.total," Products found.")),o._product_ids=e.product,o._total_batch=t._product_ids.length,o._current_batch=0,o._progress_per_batch=(90-t._progress)/t._total_batch,o._process_batch(),o._updateProgressStatus("Processing Products...")):o._updateProgressStatus(e.data.message)}).fail(function(e){o._log(e),o._updateProgressStatus(e.message),o._color="red",setTimeout(function(){o._stopProgressBar(),o._unblock_button()},1500)})}},{key:"_get_product_ids",value:function(){return this._progress=5,l.post("get_product_information",{_ajax_nonce:f.nonce,feed:this._feed,limit:this._limit})}},{key:"_process_batch",value:function(){var t=this,e="Processing Batch ".concat(this._current_batch+1," of ").concat(this._total_batch);this._updateProgressStatus(e),this._log(e),l.post("make_batch_feed",{_ajax_nonce:f.nonce,feed:this._feed,products:this._product_ids[this._current_batch],loop:this._current_batch}).then(function(e){t._current_batch++,t._log("Batch ".concat(t._current_batch," Completed")),t._log(e),t._current_batch<t._total_batch&&(t._process_batch(),t._progress+=t._progress_per_batch),t._current_batch===t._total_batch&&t._save_feed_file()}).fail(function(e){t._log(e),t._updateProgressStatus(e.message),t._color="red",setTimeout(function(){t._stopProgressBar(),t._unblock_button()},1500)})}},{key:"_save_feed_file",value:function(){var t=this;this._log("Saving feed file"),this._updateProgressStatus("Saving feed file"),l.post("save_feed_file",{_ajax_nonce:f.nonce,feed:this._feed}).then(function(e){t._log(e),t._progress=100,t._refresh&&(a.location.href="".concat(f.pages.list.feed,"&link=").concat(e.url,"&cat=").concat(e.cat)),setTimeout(function(){t._stopProgressBar(),setTimeout(function(){t._resetProgressBar(!0),t._unblock_button()},3e3)},2500)}).fail(function(e){t._log(e),t._updateProgressStatus(e.message),t._color="red",setTimeout(function(){t._stopProgressBar(),t._unblock_button()},1500)})}},{key:"_log",value:function(e){return f.wpf_debug&&console.log(e),this}},{key:"_progressBarActive",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=this;return this._toggleProgressBar(!0),this._timer=setInterval(function(){t._updateProgressBar()},e||1e3),this}},{key:"_stopProgressBar",value:function(){return clearInterval(this._timer),this}},{key:"_resetProgressBar",value:function(e){return this._toggleProgressBar(!1),this._updateProgressStatus(""),clearInterval(this._timer),this._color=!1,this._timer=null,this._progress=0,e&&this._updateProgressBar(),this}},{key:"_toggleProgressBar",value:function(e){var t=s("#feed_progress_table");return e?t.show():t.hide(),this}},{key:"_updateProgressStatus",value:function(e){return s(".feed-progress-status").html(e),this}},{key:"_getErrorMessageByCode",value:function(e){s(".feed-progress-status").css({color:this._color}),s(".feed-progress-percentage").css({color:this._color}),s(".wpf_spin").css({color:this._color});var t=e.status+" : "+e.statusText+". ";500===e.status&&(t+="Please increase your PHP max_execution_time. Please <a target='_blank' href='https://webappick.com/docs/woo-feed/faq-for-woocommerce-product-feed/how-to-solve-processing-10-feed-generation-stuck-error/'>read this doc</a>."),this._updateProgressStatus(t)}},{key:"_updateProgressBar",value:function(){var e=s(".feed-progress-percentage"),t=s(".feed-progress-bar-fill"),o="".concat(Math.round(this._progress),"%");t.css({width:o}),e.text(o)}}]),e}();a.wf={helper:p,feedEditor:h,generator:m},s(a).on("load",function(){null!==s(location).attr("href").match(/webappick.*feed/g)&&s("#wpbody-content").addClass("woofeed-body-content"),t(),postboxes.add_postbox_toggles(pagenow),(new m).init(),""!==f.generator.feed&&f.generator.regenerate,h.init(),p.common(),s(".wfmasterTooltip").hover(function(){var e=s(this),t=e.attr("wftitle");e.data("tipText",t).removeAttr("wftitle"),s('<p class="wftooltip"></p>').text(t).appendTo("body").fadeIn("slow")},function(){var e=s(this);e.attr("wftitle",e.data("tipText")),s(".wftooltip").remove()}).mousemove(function(e){s(".wftooltip").css({top:e.pageY+10,left:e.pageX+20})}),s(".generateFeed").validate(),s(c).on("blur",'input[name="wfDAttributeName"]',function(e){e.preventDefault();e=s(this).val();e=(e=e.toLowerCase()).split(" ").join("_"),s("#wfDAttributeCode").val(e)}).on("click","[data-toggle_slide]",function(e){e.preventDefault(),s(s(this).data("toggle_slide")).slideToggle("fast")}).on("click","#wf_newRow",function(){var e=s("#table-1 tbody"),t=s("#feed_config_template").text().trim().replace(/__idx__/g,e.find("tr").length);e.append(t),p.fancySelect(s(".outputType"))}).on("click",".single-feed-delete",function(e){e.preventDefault(),confirm(f.form.del_confirm)&&(a.location.href=s(this).attr("val"))}).on("click",".wf_clean_cache_wrapper",function(e){e.preventDefault();var e=s(".woo-feed-clean-cache-nonce").val(),t=s(".woo-feed-cache-loader");t.show(),l.post("clear_cache_data",{_ajax_clean_nonce:e}).then(function(e){e.success&&(t.hide(),location.reload())}).fail(function(){console.log("something wrong")})}).on("click","#woo-feed-copy-status-btn",function(e){e.preventDefault();var t=s("#woo-feed-copy-status-btn"),e=s("#woo-feed-status-area");t.val("Copied"),e.css("visibility","visible"),e.select(),c.execCommand("copy")}).on("change",".wf_attr.wf_attributes",function(e){e.preventDefault(),s(".fancy-picker-picked").trigger("click");var t,o=s(this).val(),a=s(this).parents("tr").find(".outputType"),e=s(this).parents("tr").find(".fancy-picker-content .fancy-picker-option"),n=s(this).parents("tr").find(".fancy-picker-data span"),i=["price","current_price","sale_price","price_with_tax","current_price_with_tax","sale_price_with_tax","shipping_cost"].includes(o)?(t="for_price","Price"):""!==o&&-1!==o.indexOf("wf_taxo")?(t="for_custom_taxo","parent_if_empty"):(t="for_all","Default");e.removeClass("selected"),"for_custom_taxo"===t||"for_price"===t?(e.each(function(){i===s(this).text()&&(s(this).addClass("selected"),n.text(i),a.find("option").text(i),a.find("option").val(s(this).data("value")))}),"for_price"===t&&(t=null!=(t=s("#feedCurrency").val())?t:wpf_ajax_obj.woocommerce.currency,s(this).closest("tr").find("td:eq(5) input").val(" "+t))):(e.each(function(){i===s(this).text()&&(s(this).addClass("selected"),n.text(i),a.find("option").text(i),a.find("option").val(s(this).data("value")))}),s(this).closest("tr").find("td:eq(5) input").val(""))}).on("click","#doaction, #doaction2",function(){return confirm(f.form.del_confirm_multi)}).on("change",".dType",function(){var e=s(this),t=e.val(),e=e.closest("tr");"pattern"===t?(e.find(".value_attribute").hide(),e.find(".value_pattern").show()):"attribute"===t?(e.find(".value_attribute").show(),e.find(".value_pattern").hide()):"remove"===t&&(e.find(".value_attribute").hide(),e.find(".value_pattern").hide())}).on("click",".delRow",function(e){e.preventDefault(),s(this).closest("tr").remove(),p.reindex_config_table()}).on("submit","#generateFeed",function(){s(this).validate(),s(this).valid()&&s(".makeFeedResponse").show().html('<b style="color: darkblue;"><i class="dashicons dashicons-sos wpf_spin"></i> '.concat(f.form.generate,"</b>"))}).on("submit","#updatefeed",function(e,t){s(this).validate(),s(this).valid()&&s(".makeFeedResponse").show().html('<b style="color: darkblue;"><i class="dashicons dashicons-sos wpf_spin"></i> '.concat(t&&t.save?f.form.save:f.form.generate,"</b>"))}).on("ready woo_feed_config_loaded",function(){"0"===s("#ftpenabled").val()?(s(".google-merchant-message").hide("slow"),s(".woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select").attr("disabled","disabled")):("google"===s("#provider").val()?s(".google-merchant-message").show("slow"):s(".google-merchant-message").hide("slow"),s(".woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select").removeAttr("disabled")),s("#ftpenabled").on("change",function(){"0"===s("#ftpenabled").val()?(s(".google-merchant-message").hide("slow"),s(".woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select").attr("disabled","disabled")):(s(".woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select").removeAttr("disabled"),"google"===s("#provider").val()?s(".google-merchant-message").show("slow"):s(".google-merchant-message").hide("slow"))})}).on("change",".ftporsftp",function(){var e=s(this).val(),t=s(".ssh2_status");"sftp"===e?(t.show().css("color","dodgerblue").text(f.form.sftp_checking),l.post("get_ssh2_status",{_ajax_nonce:f.nonce,server:e}).then(function(e){"exists"===e?(t.css("color","#2CC185").text(f.form.sftp_available),setTimeout(function(){t.hide()},1500)):t.show().css("color","red").text(f.form.sftp_warning)}).fail(function(e){t.hide(),p.ajax_fail(e)})):t.hide()}).on("click",'[name="save_feed_config"]',function(e){e.preventDefault(),s("#updatefeed").trigger("submit",{save:!0})}).on("change","#provider",function(e){e.preventDefault();var t=s(this).val(),o=s(this).find(":selected").text(),a=s("#filename").val(),n=s("#feedType"),i=s("#providerPage"),r=s("#feed_merchant_info");i.html('<h3><span style="float:none;margin: -3px 0 0;" class="spinner is-active"></span> '+f.form.loading_tmpl+"</h3>"),r.find(".spinner").addClass("is-active"),n.disabled(!0),n.parent().find(".spinner").addClass("is-active"),r.find(".merchant-info-section .data").html(""),g.hasOwnProperty(t)?(h.renderMerchantInfo(r,n,g[t]),s(c).trigger("woo_feed_config_loaded")):l.send("woo_feed_get_merchant_info",{type:"GET",data:{nonce:f.nonce,provider:t,templateName:o}}).then(function(e){g[t]=e,h.renderMerchantInfo(r,n,e)}).then(function(){s(c).trigger("woo_feed_config_loaded")}).fail(p.ajax_fail),v.hasOwnProperty(t)?(h.renderMerchantTemplate(i,v[t]),s(c).trigger("woo_feed_config_loaded")):l.post("get_feed_merchant",{_ajax_nonce:f.nonce,merchant:t}).then(function(e){v[t]=e,h.renderMerchantTemplate(i,e),s("#utm_source").val(o),s("#utm_campaign").val(a),"bing"===t&&(s("#delimiter option").removeAttr("selected"),s('#delimiter option[value="tab"]').attr("selected","selected"),s("#enclosure option").removeAttr("selected"),s('#enclosure option[value=" "]').attr("selected","selected")),"google_product_review"!==t&&s('.wf_attributes option[value="reviewer_name"]').hide()}).then(function(){s(c).trigger("woo_feed_config_loaded")}).fail(p.ajax_fail)}).on("change",".woo_feed_status_input",function(){var e=s(this);l.post("update_feed_status",{_ajax_nonce:f.nonce,feedName:e.val(),status:e[0].checked?1:0})}),s(c).on("change",'[name="is_outOfStock"], [name="product_visibility"]',function(){var e=s(".out-of-stock-visibility");"n"===s('[name="is_outOfStock"]:checked').val()&&"1"===s('[name="product_visibility"]:checked').val()?e.show():e.hide()}).on("change",".attr_type",function(){var e=s(this),t=e.val(),e=e.closest("tr");"pattern"===t?(e.find(".wf_attr").hide(),e.find(".wf_attr").val(""),e.find(".wf_default").show()):(e.find(".wf_attr").show(),e.find(".wf_default").hide(),e.find(".wf_default").val(""))}).on("change",".wf_mattributes, .attr_type",function(){var e=s(this).closest("tr"),o=e.find(".wf_mattributes"),t=e.find(".attr_type"),a=e.find("td:eq(4)"),n=s("#provider").val();f.form.google_category.hasOwnProperty(o.val())&&"pattern"===t.val()&&p.in_array(n,f.form.google_category[o.val()])?0===a.find("select.selectize").length&&(a.find("input.wf_default").remove(),a.append('<span class="wf_default wf_attributes"><select name="default[]" class="selectize"></select></span>'),a.append('<span style="font-size:x-small;"><a style="color: red" href="https://webappick.com/docs/woo-feed/feed-configuration/how-to-map-store-category-with-merchant-category/" target="_blank">'.concat(f.learn_more,"</a></span>")),r&&d||a.append('<span class="spinner is-active" style="margin: 0;"></span>'),e=a.find(".wf_attributes select"),p.selectize(e,{preload:!0,placeholder:f.form.select_category,load:function(e,t){r?t(r):l.send("get_google_categories",{type:"GET",data:{_ajax_nonce:f.nonce,action:"get_google_categories",provider:n}}).then(function(e){t(r=e),a.find(".spinner").remove()}).fail(p.ajax_fail),d||"facebook"!==n||"fb_product_category"!==o.val()?t(d):l.send("get_facebook_categories",{type:"GET",data:{_ajax_nonce:f.nonce,action:"get_facebook_categories",provider:n}}).then(function(e){t(d=e),a.find(".spinner").remove()}).fail(p.ajax_fail)}})):"current_category"!==o.val()&&0===a.find("input.wf_default").length&&(a.find("span").remove(),a.append('<input autocomplete="off" class="wf_default wf_attributes" type="text" name="default[]" value="">'),"pattern"!==t.val()&&a.find("input.wf_default").hide())}).on("change","#feedType,#provider",function(e){var t=s("#feedType").val(),o=s("#provider").val(),a=s(".itemWrapper"),n=s(".wf_csvtxt");""!==t&&p.in_array(o,f.form.item_wrapper_hidden)&&a.hide(),"feedType"===e.target.id&&("csv"===t||"txt"===t||"tsv"===t?(n.show(),a.hide(),"tsv"===t?s("#delimiter option:last").prop("selected","selected"):"csv"===t&&s("#delimiter option:first").prop("selected","selected")):"xml"===t&&"custom"===o?(a.show(),n.hide()):"json"===t&&n.hide()),"custom"!==o&&a.hide()}).trigger("change"),s(c).on("click",'.woofeed-custom-fields [id*="-switcher"]',function(){s(this).closest("td").find(".switch-loader").show();var e=s(this).attr("id").split("-")[0],t=s(this).data("taxonomy"),o=s(this).prop("checked");new _(e,o,t)}).ready(function(){var e=s(".wapk-feed-buy-now-container");s(a).scroll(function(){s(a).scrollTop()<=5e3?e.addClass("fixed"):e.removeClass("fixed")})})}),s(c).on("click","#woo-feed-debug-log-download",function(e){e.preventDefault(),s("<a />",{download:new Date+".log",href:URL.createObjectURL(new Blob([s("#woo-feed-debug-log").val()],{type:"text/plain"}))}).appendTo("body")[0].click()}).on("keyup","#filename",function(){var e=s("#filename").val();s("#utm_campaign").val(e)}).on("click",".wf-tab-name",function(e){s(".wf-tab-name.activate").removeClass("activate"),s(this).addClass("activate");var t=s(this).attr("for");s(".wf_tabs li.active").removeClass("active"),s(".wf_tabs .wf-tab-content#"+t).parent().addClass("active")}).on("change","#category-mapping-form #providers",function(){var e,t=s(this).find(":selected").val();-1!==["google","facebook","pinterest","bing","bing_local_inventory","snapchat"].indexOf(t)?(s('input[id*="cat_mapping_"]').css("display","none"),s(".wf_default.wf_attributes").css("display","block").css("width","100%"),e=new u,"facebook"===t?e.wooFeed_get_facebook_categories():e.wooFeed_get_google_categories()):(s('input[id*="cat_mapping_"]').css("display","block"),s(".wf_default.wf_attributes").css("display","none").css("width","100%"))}).on("click",'span[id*="cat-map-"]',function(e){e.preventDefault();var o,t=s("#category-mapping-form #providers").val(),a=s(this).attr("id").replace(/[^\d.]/g,""),e="group-child-"+a;-1!==["google","facebook","pinterest","bing","bing_local_inventory","snapchat"].indexOf(t)?(o=s(this).parents("tr").find(".selectized").val())&&s("."+e).parents("tr").find("select").each(function(e,t){s(t).data("selectize").setValue(o)}):(a=s("#cat_mapping_"+a).val(),s("."+e).parents("tr").find("input").val(a))}),s(c).ready(function(){var e=s("#providers").val(),t=new u;"facebook"===e?t.wooFeed_get_facebook_categories():t.wooFeed_get_google_categories()}),s(c).on("feed_editor_init",function(){var t=s(".merchant-info-section.feed_file_type .data").html().split(",").map(function(e){return e.trim().toLowerCase()}),e=s("#feedType");t.length?(e.find("option").each(function(){var e=s(this);e.val()&&!p.in_array(e.val(),t)?e.disabled(!0):e.disabled(!1)}),1===t.length&&e.find('option[value="'+t[0]+'"]').attr("selected","selected")):e.find("option").disabled(!1)}),s(c).on("ready",function(){s(c).on("feedEditor.init",function(){!function(){var i,t={price:wpf_ajax_obj.woocommerce.currency,current_price:wpf_ajax_obj.woocommerce.currency,sale_price:wpf_ajax_obj.woocommerce.currency,price_with_tax:wpf_ajax_obj.woocommerce.currency,current_price_with_tax:wpf_ajax_obj.woocommerce.currency,sale_price_with_tax:wpf_ajax_obj.woocommerce.currency,weight:wpf_ajax_obj.woocommerce.weight,weight_unit:wpf_ajax_obj.woocommerce.weight,height:wpf_ajax_obj.woocommerce.dimension,length:wpf_ajax_obj.woocommerce.dimension,width:wpf_ajax_obj.woocommerce.dimension};void 0!==wpf_ajax_obj.feed_rules&&null!==wpf_ajax_obj.feed_rules&&(i=wpf_ajax_obj.feed_rules.feedCurrency);var e=a.location.search,r=new URLSearchParams(e).get("action");s(".wf_attr.wf_attributes").each(function(o,e){var a=s(e).val(),n=s('input[name^="suffix"]').eq(parseInt(o)).val();-1!==s.inArray(n,[" "+wpf_ajax_obj.woocommerce.currency," "+wpf_ajax_obj.woocommerce.weight," "+wpf_ajax_obj.woocommerce.dimension])&&s('input[name^="suffix"]').eq(parseInt(o)).val(""),s.each(t,function(e,t){a===e&&(t=null!=i?i:t,"undefined"!==r&&"edit-feed"!==r?s('input[name^="suffix"]').eq(parseInt(o)).val(" "+t):s('input[name^="suffix"]').eq(parseInt(o)).val(n))})}),s(c).trigger("feedEditor.after.free.postfix.update")}()})})}(jQuery,window,document,wp.ajax,wpf_ajax_obj);
2
  //# sourceMappingURL=woo-feed-admin.min.js.map
1
+ "use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var a=t[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),e}!function(s,a,c,l,f){s.fn.disabled=function(o){return s(this).each(function(){var e=s(this),t="disabled";void 0!==e.prop(t)?e.prop(t,void 0===o||!0===o):!0===o?e.addClass(t):e.removeClass(t)}),self},s.fn.isDisabled=function(){var e=s(this),t="disabled";return void 0!==e.prop(t)?e.prop(t):e.hasClass(t)};function e(e){s(e.currentTarget).removeClass(function(e,t){return(t.match(/\btooltipped-\S+/g)||[]).join(" ")}).removeClass("tooltipped").removeAttr("aria-label")}function o(e,t){s(e).addClass("tooltipped tooltipped-s").attr("aria-label",t)}function n(e,t){return s.extend(!0,{},e,t)}function t(){i=s(".toClipboard"),!ClipboardJS.isSupported()||/iPhone|iPad/i.test(navigator.userAgent)?i.find("img").hide(0):(i.each(function(){s(this).on("mouseleave",e).on("blur",e)}),new ClipboardJS(".toClipboard").on("error",function(e){var t;o(e.trigger,(t=e.action,e="cut"===t?"X":"C",t=/iPhone|iPad/i.test(navigator.userAgent)?"No support :(":/Mac/i.test(navigator.userAgent)?"Press ⌘-"+e+" to "+t:"Press Ctrl-"+e+" to "+t))}).on("success",function(e){o(e.trigger,"Copied")}))}var i,r,d,_=function(){function a(e,t,o){_classCallCheck(this,a),this.productCustomFields(e,t,o)}return _createClass(a,[{key:"cacheClear",value:function(){var e={action:"woo_feed_product_attribute_cache_remove",nonce:wpf_ajax_obj.ajax.nonce};s.ajax({method:"POST",url:wpf_ajax_obj.wpf_ajax_url,data:e})}},{key:"productCustomFields",value:function(t){var o=this,e={action:"woo_feed_custom_fields_status_change",nonce:wpf_ajax_obj.ajax.nonce,field:t,status:1<arguments.length&&void 0!==arguments[1]&&arguments[1],isTaxonomy:2<arguments.length?arguments[2]:void 0};s.ajax({method:"POST",url:wpf_ajax_obj.wpf_ajax_url,data:e,success:function(e){e.success?o.cacheClear():console.log(e),s("#"+t+"-switcher").closest("td").find(".switch-loader").hide()}})}}]),a}(),u=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"wooFeed_get_google_categories",value:function(){l.send("get_google_categories",{type:"GET",data:{_ajax_nonce:f.nonce,action:"get_google_categories"}}).then(function(e){s(".selectize-google-category").selectize({valueField:"value",labelField:"text",placeholder:"Select a category",searchField:["value","text"],options:e,render:{option:function(e,t){return'<div class="item wapk-selectize-item">'.concat(t(e.value+" - "+e.text),"</div>")},item:function(e,t){return'<div class="item wapk-selectize-item">'.concat(t(e.value+" - "+e.text),"</div>")}}})}).fail(p.ajax_fail)}},{key:"wooFeed_get_facebook_categories",value:function(){l.send("get_facebook_categories",{type:"GET",data:{_ajax_nonce:f.nonce,action:"get_facebook_categories"}}).then(function(e){s(".selectize-google-category").selectize({valueField:"value",labelField:"text",placeholder:"Select a Facebook category",searchField:["value","text"],options:e,render:{option:function(e,t){return'<div class="item wapk-selectize-item">'.concat(t(e.value+" - "+e.text),"</div>")},item:function(e,t){return'<div class="item wapk-selectize-item">'.concat(t(e.value+" - "+e.text),"</div>")}}})}).fail(p.ajax_fail)}}]),e}(),p={in_array:function(e,t){try{return-1!==t.indexOf(e)}catch(e){return!1}},selectize_render_item:function(e,t){return'<div class="item wapk-selectize-item">'.concat(t(e.text),"</div>")},ajax_fail:function(e){console.warn(e),alert(e.hasOwnProperty("statusText")&&e.hasOwnProperty("status")?f.ajax.error+"\n"+e.statusText+" ("+e.status+")":e)},sortable:function(e,o,a,i){return(e||s(".sorted_table")).each(function(){var e=s(this),t=e.find("tbody > tr:eq(0) > td").length||a||9;e.wf_sortable(n({containerSelector:"table",itemPath:"> tbody",itemSelector:"tr",handle:"i.wf_sortedtable",placeholder:'<tr class="placeholder"><td colspan="'.concat(t,'"></td></tr>'),onDrop:function(e,t,o,a){e.removeClass(t.group.options.draggedClass).removeAttr("style"),s("body").removeClass(t.group.options.bodyClass);var n=e.find(".wf_mattributes").attr("name").replace(/\D/g,"");e.find("input.wf_attributes").attr("name","default["+n+"]"),i&&"function"==typeof i&&i(e,t,o,a)}},o))})},selectize:function(e,t){return(e||s("select.selectize")).not(".selectized").not(".selectize-google-category").each(function(){var e=s(this);e.selectize(n({create:e.data("create")||!1,plugins:e.data("plugins")?e.data("plugins").split(",").map(function(e){return e.trim()}):[],render:{item:p.selectize_render_item}},t))})},fancySelect:function(e,t){return(e||s("select.fancySelect")).not(".FancySelectInit").each(function(){s(this).fancySelect(n({maxItemShow:3},t))})},reindex_config_table:function(){s("#table-1").find("tbody tr").each(function(o,e){s(e).find("[name]").each(function(e,t){s(t).attr("name",s(t).attr("name").replace(/(\[\d\])/g,"[".concat(o,"]")))})})},common:function(){p.sortable(s(".sorted_table"),{},9,p.reindex_config_table),p.selectize(),p.fancySelect(s(".outputType"))}},h={form:null,init:function(){this.form=s(".generateFeed"),this.form.length&&(p.common(),s(c).trigger("feed_editor_init"),s(c).trigger(new jQuery.Event("feedEditor.init",{target:this.form})))},renderMerchantInfo:function(o,a,n){for(var e in n)!function(e){var t;n.hasOwnProperty(e)&&(o.find(".merchant-info-section."+e+" .data").html(n[e]),"feed_file_type"===e&&((t=n[e].split(",").map(function(e){return e.trim().toLowerCase()}).filter(function(e){return""!==e&&e!==f.na.toLowerCase()})).length?(a.find("option").removeAttr("selected").each(function(){var e=s(this);e.val()&&!p.in_array(e.val(),t)?e.disabled(!0):e.disabled(!1)}),1===t.length&&a.find('option[value="'+t[0]+'"]').attr("selected","selected")):a.find("option").disabled(!1)))}(e);o.find(".spinner").removeClass("is-active"),a.disabled(!1),a.trigger("change"),s(c).trigger("woo_feed_config_loaded"),a.parent().find(".spinner").removeClass("is-active")},renderMerchantTemplate:function(o,a){for(var e in a)!function(t){var e;a.hasOwnProperty(t)&&("tabs"===t?o.html(a[t]):(e=s('[name="'+t+'"]')).length&&e.each(function(){var e=s(this);e.is("select")?e.find('[value="'+a[t]+'"]').prop("selected",!0):(e.is("[type=checkbox]")||e.is("[type=radio]"))&&e.val()===a[t]?e.prop("checked",!0):e.val(a[t])}).trigger("change"))}(e);h.init()}},g=[],v=[],m=function(){function e(){_classCallCheck(this,e),this._feed=f.generator.feed,this._limit=f.generator.limit,this._progress=0,this._timer=null,this._color=!1,this._total_batch=0,this._current_batch=0,this._product_ids=[],this._progress_per_batch=0,this._refresh=!0,this._regenerate=f.generator.regenerate,a.isRegenerating=!1,this._all_btn=s(".wpf_regenerate"),this._current_btn=s("#".concat(this._feed.replace("wf_config","wf_feed_"))),this._current_btn_label=""}return _createClass(e,[{key:"init",value:function(){var t=this;""!==this._feed&&this._regenerate&&!1===a.isRegenerating&&this.generate();var e=a.location.search;return"webappick-manage-feeds"===new URLSearchParams(e).get("page")&&s("body").addClass("woo-import-popup-body"),s(c).on("click",".woo-feed-campaign-close-button",function(e){e.preventDefault(),s(this).parent(".woo-feed-promotion").hide();e=s(this).data("condition");1===e&&l.post("woo_feed_hide_promotion",{_ajax_nonce:f.nonce,condition:e}).then(function(e){t._log(e)}).fail(function(e){t._log(e),t._updateProgressStatus(e.message),t._color="red"})}),s(c).on("click",".wpf_regenerate",function(e){e.preventDefault(),t._current_btn=s(this),t._current_btn.hasClass("disabled")||!0===a.isRegenerating||(t._feed=t._current_btn.attr("id").replace("wf_feed_","wf_config"),""!==t._feed&&t.generate())}),this}},{key:"_block_button",value:function(){this._all_btn.length&&this._all_btn.addClass("disabled"),this._current_btn.length&&(this._current_btn.find("span").addClass("wpf_spin reverse_spin"),this._current_btn_label=this._current_btn.attr("title"),this._current_btn.attr("aria-label",f.regenerate).attr("title",f.regenerate))}},{key:"_unblock_button",value:function(){this._all_btn.length&&this._all_btn.removeClass("disabled"),this._current_btn.length&&(this._current_btn.find("span").removeClass("wpf_spin"),this._current_btn.find("span").removeClass("reverse_spin"),this._current_btn.attr("aria-label",this._current_btn_label).attr("title",this._current_btn_label))}},{key:"generate",value:function(){var t=this,o=this;a.isRegenerating=!0,this._block_button(),this._resetProgressBar(),this._progressBarActive(),this._log("Counting Total Products"),this._updateProgressStatus("Fetching products."),this._get_product_ids().then(function(e){t._progress=10,o._log({response:e}),e.success?(o._log("Total ".concat(e.total," Products found.")),o._product_ids=e.product,o._total_batch=t._product_ids.length,o._current_batch=0,o._progress_per_batch=(90-t._progress)/t._total_batch,o._process_batch(),o._updateProgressStatus("Processing Products...")):o._updateProgressStatus(e.data.message)}).fail(function(e){o._log(e),o._updateProgressStatus(e.message),o._color="red",setTimeout(function(){o._stopProgressBar(),o._unblock_button()},1500)})}},{key:"_get_product_ids",value:function(){return this._progress=5,l.post("get_product_information",{_ajax_nonce:f.nonce,feed:this._feed,limit:this._limit})}},{key:"_process_batch",value:function(){var t=this,e="Processing Batch ".concat(this._current_batch+1," of ").concat(this._total_batch);this._updateProgressStatus(e),this._log(e),l.post("make_batch_feed",{_ajax_nonce:f.nonce,feed:this._feed,products:this._product_ids[this._current_batch],loop:this._current_batch}).then(function(e){t._current_batch++,t._log("Batch ".concat(t._current_batch," Completed")),t._log(e),t._current_batch<t._total_batch&&(t._process_batch(),t._progress+=t._progress_per_batch),t._current_batch===t._total_batch&&t._save_feed_file()}).fail(function(e){t._log(e),t._updateProgressStatus(e.message),t._color="red",setTimeout(function(){t._stopProgressBar(),t._unblock_button()},1500)})}},{key:"_save_feed_file",value:function(){var t=this;this._log("Saving feed file"),this._updateProgressStatus("Saving feed file"),l.post("save_feed_file",{_ajax_nonce:f.nonce,feed:this._feed}).then(function(e){t._log(e),t._progress=100,t._refresh&&(a.location.href="".concat(f.pages.list.feed,"&link=").concat(e.url,"&cat=").concat(e.cat)),setTimeout(function(){t._stopProgressBar(),setTimeout(function(){t._resetProgressBar(!0),t._unblock_button()},3e3)},2500)}).fail(function(e){t._log(e),t._updateProgressStatus(e.message),t._color="red",setTimeout(function(){t._stopProgressBar(),t._unblock_button()},1500)})}},{key:"_log",value:function(e){return f.wpf_debug&&console.log(e),this}},{key:"_progressBarActive",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=this;return this._toggleProgressBar(!0),this._timer=setInterval(function(){t._updateProgressBar()},e||1e3),this}},{key:"_stopProgressBar",value:function(){return clearInterval(this._timer),this}},{key:"_resetProgressBar",value:function(e){return this._toggleProgressBar(!1),this._updateProgressStatus(""),clearInterval(this._timer),this._color=!1,this._timer=null,this._progress=0,e&&this._updateProgressBar(),this}},{key:"_toggleProgressBar",value:function(e){var t=s("#feed_progress_table");return e?t.show():t.hide(),this}},{key:"_updateProgressStatus",value:function(e){return s(".feed-progress-status").html(e),this}},{key:"_getErrorMessageByCode",value:function(e){s(".feed-progress-status").css({color:this._color}),s(".feed-progress-percentage").css({color:this._color}),s(".wpf_spin").css({color:this._color});var t=e.status+" : "+e.statusText+". ";500===e.status&&(t+="Please increase your PHP max_execution_time. Please <a target='_blank' href='https://webappick.com/docs/woo-feed/faq-for-woocommerce-product-feed/how-to-solve-processing-10-feed-generation-stuck-error/'>read this doc</a>."),this._updateProgressStatus(t)}},{key:"_updateProgressBar",value:function(){var e=s(".feed-progress-percentage"),t=s(".feed-progress-bar-fill"),o="".concat(Math.round(this._progress),"%");t.css({width:o}),e.text(o)}}]),e}();a.wf={helper:p,feedEditor:h,generator:m},s(a).on("load",function(){null!==s(location).attr("href").match(/webappick.*feed/g)&&s("#wpbody-content").addClass("woofeed-body-content"),t(),postboxes.add_postbox_toggles(pagenow),(new m).init(),""!==f.generator.feed&&f.generator.regenerate,h.init(),p.common(),s(".wfmasterTooltip").hover(function(){var e=s(this),t=e.attr("wftitle");e.data("tipText",t).removeAttr("wftitle"),s('<p class="wftooltip"></p>').text(t).appendTo("body").fadeIn("slow")},function(){var e=s(this);e.attr("wftitle",e.data("tipText")),s(".wftooltip").remove()}).mousemove(function(e){s(".wftooltip").css({top:e.pageY+10,left:e.pageX+20})}),s(".generateFeed").validate(),s(c).on("blur",'input[name="wfDAttributeName"]',function(e){e.preventDefault();e=s(this).val();e=(e=e.toLowerCase()).split(" ").join("_"),s("#wfDAttributeCode").val(e)}).on("click","[data-toggle_slide]",function(e){e.preventDefault(),s(s(this).data("toggle_slide")).slideToggle("fast")}).on("click","#wf_newRow",function(){var e=s("#table-1 tbody"),t=s("#feed_config_template").text().trim().replace(/__idx__/g,e.find("tr").length);e.append(t),p.fancySelect(s(".outputType"))}).on("click",".single-feed-delete",function(e){e.preventDefault(),confirm(f.form.del_confirm)&&(a.location.href=s(this).attr("val"))}).on("click",".wf_clean_cache_wrapper",function(e){e.preventDefault();var e=s(".woo-feed-clean-cache-nonce").val(),t=s(".woo-feed-cache-loader");t.show(),l.post("clear_cache_data",{_ajax_clean_nonce:e}).then(function(e){e.success&&(t.hide(),location.reload())}).fail(function(){console.log("something wrong")})}).on("click","#woo-feed-copy-status-btn",function(e){e.preventDefault();var t=s("#woo-feed-copy-status-btn"),e=s("#woo-feed-status-area");t.val("Copied"),e.css("visibility","visible"),e.select(),c.execCommand("copy")}).on("change",".wf_attr.wf_attributes",function(e){e.preventDefault(),s(".fancy-picker-picked").trigger("click");var t,o=s(this).val(),a=s(this).parents("tr").find(".outputType"),e=s(this).parents("tr").find(".fancy-picker-content .fancy-picker-option"),n=s(this).parents("tr").find(".fancy-picker-data span"),i=["price","current_price","sale_price","price_with_tax","current_price_with_tax","sale_price_with_tax","shipping_cost"].includes(o)?(t="for_price","Price"):""!==o&&-1!==o.indexOf("wf_taxo")?(t="for_custom_taxo","parent_if_empty"):(t="for_all","Default");e.removeClass("selected"),"for_custom_taxo"===t||"for_price"===t?(e.each(function(){i===s(this).text()&&(s(this).addClass("selected"),n.text(i),a.find("option").text(i),a.find("option").val(s(this).data("value")))}),"for_price"===t&&(t=null!=(t=s("#feedCurrency").val())?t:wpf_ajax_obj.woocommerce.currency,s(this).closest("tr").find("td:eq(5) input").val(" "+t))):(e.each(function(){i===s(this).text()&&(s(this).addClass("selected"),n.text(i),a.find("option").text(i),a.find("option").val(s(this).data("value")))}),s(this).closest("tr").find("td:eq(5) input").val(""))}).on("click","#doaction, #doaction2",function(){return confirm(f.form.del_confirm_multi)}).on("change",".dType",function(){var e=s(this),t=e.val(),e=e.closest("tr");"pattern"===t?(e.find(".value_attribute").hide(),e.find(".value_pattern").show()):"attribute"===t?(e.find(".value_attribute").show(),e.find(".value_pattern").hide()):"remove"===t&&(e.find(".value_attribute").hide(),e.find(".value_pattern").hide())}).on("click",".delRow",function(e){e.preventDefault(),s(this).closest("tr").remove(),p.reindex_config_table()}).on("submit","#generateFeed",function(){s(this).validate(),s(this).valid()&&s(".makeFeedResponse").show().html('<b style="color: darkblue;"><i class="dashicons dashicons-sos wpf_spin"></i> '.concat(f.form.generate,"</b>"))}).on("submit","#updatefeed",function(e,t){s(this).validate(),s(this).valid()&&s(".makeFeedResponse").show().html('<b style="color: darkblue;"><i class="dashicons dashicons-sos wpf_spin"></i> '.concat(t&&t.save?f.form.save:f.form.generate,"</b>"))}).on("ready woo_feed_config_loaded",function(){"0"===s("#ftpenabled").val()?(s(".google-merchant-message").hide("slow"),s(".woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select").attr("disabled","disabled")):("google"===s("#provider").val()?s(".google-merchant-message").show("slow"):s(".google-merchant-message").hide("slow"),s(".woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select").removeAttr("disabled")),s("#ftpenabled").on("change",function(){"0"===s("#ftpenabled").val()?(s(".google-merchant-message").hide("slow"),s(".woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select").attr("disabled","disabled")):(s(".woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select").removeAttr("disabled"),"google"===s("#provider").val()?s(".google-merchant-message").show("slow"):s(".google-merchant-message").hide("slow"))})}).on("change",".ftporsftp",function(){var e=s(this).val(),t=s(".ssh2_status");"sftp"===e?(t.show().css("color","dodgerblue").text(f.form.sftp_checking),l.post("get_ssh2_status",{_ajax_nonce:f.nonce,server:e}).then(function(e){"exists"===e?(t.css("color","#2CC185").text(f.form.sftp_available),setTimeout(function(){t.hide()},1500)):t.show().css("color","red").text(f.form.sftp_warning)}).fail(function(e){t.hide(),p.ajax_fail(e)})):t.hide()}).on("click",'[name="save_feed_config"]',function(e){e.preventDefault(),s("#updatefeed").trigger("submit",{save:!0})}).on("change","#provider",function(e){e.preventDefault();var t=s(this).val(),o=s(this).find(":selected").text(),a=s("#filename").val(),n=s("#feedType"),i=s("#providerPage"),r=s("#feed_merchant_info");i.html('<h3><span style="float:none;margin: -3px 0 0;" class="spinner is-active"></span> '+f.form.loading_tmpl+"</h3>"),r.find(".spinner").addClass("is-active"),n.disabled(!0),n.parent().find(".spinner").addClass("is-active"),r.find(".merchant-info-section .data").html(""),g.hasOwnProperty(t)?(h.renderMerchantInfo(r,n,g[t]),s(c).trigger("woo_feed_config_loaded")):l.send("woo_feed_get_merchant_info",{type:"GET",data:{nonce:f.nonce,provider:t,templateName:o}}).then(function(e){g[t]=e,h.renderMerchantInfo(r,n,e)}).then(function(){s(c).trigger("woo_feed_config_loaded")}).fail(p.ajax_fail),v.hasOwnProperty(t)?(h.renderMerchantTemplate(i,v[t]),s(c).trigger("woo_feed_config_loaded")):l.post("get_feed_merchant",{_ajax_nonce:f.nonce,merchant:t}).then(function(e){v[t]=e,h.renderMerchantTemplate(i,e),s("#utm_source").val(o),s("#utm_campaign").val(a),"bing"===t&&(s("#delimiter option").removeAttr("selected"),s('#delimiter option[value="tab"]').attr("selected","selected"),s("#enclosure option").removeAttr("selected"),s('#enclosure option[value=" "]').attr("selected","selected")),"google_product_review"!==t&&s('.wf_attributes option[value="reviewer_name"]').hide()}).then(function(){s(c).trigger("woo_feed_config_loaded")}).fail(p.ajax_fail)}).on("change",".woo_feed_status_input",function(){var e=s(this);l.post("update_feed_status",{_ajax_nonce:f.nonce,feedName:e.val(),status:e[0].checked?1:0})}),s(c).on("change",'[name="is_outOfStock"], [name="product_visibility"]',function(){var e=s(".out-of-stock-visibility");"n"===s('[name="is_outOfStock"]:checked').val()&&"1"===s('[name="product_visibility"]:checked').val()?e.show():e.hide()}).on("change",".attr_type",function(){var e=s(this),t=e.val(),e=e.closest("tr");"pattern"===t?(e.find(".wf_attr").hide(),e.find(".wf_attr").val(""),e.find(".wf_default").show()):(e.find(".wf_attr").show(),e.find(".wf_default").hide(),e.find(".wf_default").val(""))}).on("change",".wf_mattributes, .attr_type",function(){var e=s(this).closest("tr"),o=e.find(".wf_mattributes"),t=e.find(".attr_type"),a=e.find("td:eq(4)"),n=s("#provider").val();f.form.google_category.hasOwnProperty(o.val())&&"pattern"===t.val()&&p.in_array(n,f.form.google_category[o.val()])?0===a.find("select.selectize").length&&(a.find("input.wf_default").remove(),a.append('<span class="wf_default wf_attributes"><select name="default[]" class="selectize"></select></span>'),a.append('<span style="font-size:x-small;"><a style="color: red" href="https://webappick.com/docs/woo-feed/feed-configuration/how-to-map-store-category-with-merchant-category/" target="_blank">'.concat(f.learn_more,"</a></span>")),r&&d||a.append('<span class="spinner is-active" style="margin: 0;"></span>'),e=a.find(".wf_attributes select"),p.selectize(e,{preload:!0,placeholder:f.form.select_category,load:function(e,t){r?t(r):l.send("get_google_categories",{type:"GET",data:{_ajax_nonce:f.nonce,action:"get_google_categories",provider:n}}).then(function(e){t(r=e),a.find(".spinner").remove()}).fail(p.ajax_fail),d||"facebook"!==n||"fb_product_category"!==o.val()?t(d):l.send("get_facebook_categories",{type:"GET",data:{_ajax_nonce:f.nonce,action:"get_facebook_categories",provider:n}}).then(function(e){t(d=e),a.find(".spinner").remove()}).fail(p.ajax_fail)}})):"current_category"!==o.val()&&0===a.find("input.wf_default").length&&(a.find("span").remove(),a.append('<input autocomplete="off" class="wf_default wf_attributes" type="text" name="default[]" value="">'),"pattern"!==t.val()&&a.find("input.wf_default").hide())}).on("change","#feedType,#provider",function(e){var t=s("#feedType").val(),o=s("#provider").val(),a=s(".itemWrapper"),n=s(".wf_csvtxt");""!==t&&p.in_array(o,f.form.item_wrapper_hidden)&&a.hide(),"feedType"===e.target.id&&("csv"===t||"txt"===t||"tsv"===t?(n.show(),a.hide(),"tsv"===t?s("#delimiter option:last").prop("selected","selected"):"csv"===t&&s("#delimiter option:first").prop("selected","selected")):"xml"===t&&"custom"===o?(a.show(),n.hide()):"json"===t&&n.hide()),"custom"!==o&&a.hide()}).trigger("change"),s(c).on("click",'.woofeed-custom-fields [id*="-switcher"]',function(){s(this).closest("td").find(".switch-loader").show();var e=s(this).attr("id").split("-")[0],t=s(this).data("taxonomy"),o=s(this).prop("checked");new _(e,o,t)}).ready(function(){var e=s(".wapk-feed-buy-now-container");s(a).scroll(function(){s(a).scrollTop()<=5e3?e.addClass("fixed"):e.removeClass("fixed")})})}),s(c).on("click","#woo-feed-debug-log-download",function(e){e.preventDefault(),s("<a />",{download:new Date+".log",href:URL.createObjectURL(new Blob([s("#woo-feed-debug-log").val()],{type:"text/plain"}))}).appendTo("body")[0].click()}).on("keyup","#filename",function(){var e=s("#filename").val();s("#utm_campaign").val(e)}).on("click",".wf-tab-name",function(e){s(".wf-tab-name.activate").removeClass("activate"),s(this).addClass("activate");var t=s(this).attr("for");s(".wf_tabs li.active").removeClass("active"),s(".wf_tabs .wf-tab-content#"+t).parent().addClass("active")}).on("change","#category-mapping-form #providers",function(){var e,t=s(this).find(":selected").val();-1!==["google","facebook","pinterest","bing","bing_local_inventory","snapchat"].indexOf(t)?(s('input[id*="cat_mapping_"]').css("display","none"),s(".wf_default.wf_attributes").css("display","block").css("width","100%"),e=new u,"facebook"===t?e.wooFeed_get_facebook_categories():e.wooFeed_get_google_categories()):(s('input[id*="cat_mapping_"]').css("display","block"),s(".wf_default.wf_attributes").css("display","none").css("width","100%"))}).on("click",'span[id*="cat-map-"]',function(e){e.preventDefault();var o,t=s("#category-mapping-form #providers").val(),a=s(this).attr("id").replace(/[^\d.]/g,""),e="group-child-"+a;-1!==["google","facebook","pinterest","bing","bing_local_inventory","snapchat"].indexOf(t)?(o=s(this).parents("tr").find(".selectized").val())&&s("."+e).parents("tr").find("select").each(function(e,t){s(t).data("selectize").setValue(o)}):(a=s("#cat_mapping_"+a).val(),s("."+e).parents("tr").find("input").val(a))}),s(c).ready(function(){var e=s("#providers").val(),t=new u;"facebook"===e?t.wooFeed_get_facebook_categories():t.wooFeed_get_google_categories()}),s(c).on("feed_editor_init",function(){var t=s(".merchant-info-section.feed_file_type .data").html().split(",").map(function(e){return e.trim().toLowerCase()}),e=s("#feedType");t.length?(e.find("option").each(function(){var e=s(this);e.val()&&!p.in_array(e.val(),t)?e.disabled(!0):e.disabled(!1)}),1===t.length&&e.find('option[value="'+t[0]+'"]').attr("selected","selected")):e.find("option").disabled(!1)}),s(c).on("ready",function(){s(c).on("feedEditor.init",function(){!function(){var i,t={price:wpf_ajax_obj.woocommerce.currency,current_price:wpf_ajax_obj.woocommerce.currency,sale_price:wpf_ajax_obj.woocommerce.currency,price_with_tax:wpf_ajax_obj.woocommerce.currency,current_price_with_tax:wpf_ajax_obj.woocommerce.currency,sale_price_with_tax:wpf_ajax_obj.woocommerce.currency,weight:wpf_ajax_obj.woocommerce.weight,weight_unit:wpf_ajax_obj.woocommerce.weight,height:wpf_ajax_obj.woocommerce.dimension,length:wpf_ajax_obj.woocommerce.dimension,width:wpf_ajax_obj.woocommerce.dimension};void 0!==wpf_ajax_obj.feed_rules&&null!==wpf_ajax_obj.feed_rules&&(i=wpf_ajax_obj.feed_rules.feedCurrency);var e=a.location.search,r=new URLSearchParams(e).get("action");s(".wf_attr.wf_attributes").each(function(o,e){var a=s(e).val(),n=s('input[name^="suffix"]').eq(parseInt(o)).val();-1!==s.inArray(n,[" "+wpf_ajax_obj.woocommerce.currency," "+wpf_ajax_obj.woocommerce.weight," "+wpf_ajax_obj.woocommerce.dimension])&&s('input[name^="suffix"]').eq(parseInt(o)).val(""),s.each(t,function(e,t){a===e&&(t=null!=i?i:t,"undefined"!==r&&"edit-feed"!==r?s('input[name^="suffix"]').eq(parseInt(o)).val(" "+t):s('input[name^="suffix"]').eq(parseInt(o)).val(n))})}),s(c).trigger("feedEditor.after.free.postfix.update")}()})})}(jQuery,window,document,wp.ajax,wpf_ajax_obj);
2
  //# sourceMappingURL=woo-feed-admin.min.js.map
admin/js/woo-feed-admin.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["woo-feed-admin.js"],"names":["_defineProperties","target","props","descriptor","i","enumerable","configurable","writable","Object","defineProperty","key","_createClass","Constructor","protoProps","staticProps","prototype","window","wpAjax","$","document","opts","self","prop","status","addClass","removeClass","hasClass","currentTarget","clearTooltip","userAgent","actionMsg","match","actionKey","index","join","removeAttr","elem","attr","msg","extend","_default","_args","valueField","$copyBtn","feedGenerator","this","on","ClipboardJS","event","action","showTooltip","trigger","test","navigator","ajax_fail","alert","facebookCategories","url","data","_classCallCheck","WooFeedCustomFields","productCustomFields","field","isTaxonomy","value","ajax","nonce","method","response","wpf_ajax_obj","wpf_ajax_url","success","_this","cacheClear","closest","find","hide","selectize","WooFeedFeedCategories","options","render","send","type","item","_ajax_nonce","then","fail","helper","labelField","placeholder","searchField","escape","concat","text","in_array","needle","haystack","indexOf","sortable","onDrop","column_count","warn","wf_sortable","containerSelector","e","hasOwnProperty","error","statusText","el","config","column","_onDrop","each","length","itemPath","itemSelector","create","plugins","$item","container","group","draggedClass","bodyClass","selectize_render_item","fancySelect","maxItemShow","split","map","s","not","handle","reindex_config_table","init","renderMerchantInfo","form","common","jQuery","k","opt","merchantInfo","feedType","r","types","html","t","trim","toLowerCase","na","disabled","val","_loop2","contentSettings","feedForm","feedEditor","is","merchantInfoCache","tooltip","css","top","_regenerate","isRegenerating","title","_current_btn","feed","_limit","generator","limit","_progress","_timer","_product_ids","_progress_per_batch","_refresh","mousemove","_feed","pageX","generate","replace","clip","fallbackMessage","condition","URLSearchParams","_color","preventDefault","parent","_log","regenerate","_all_btn","current_page_query","page_name","_block_button","_current_btn_label","message","product","setTimeout","_this2","_stopProgressBar","_process_batch","_updateProgressStatus","_current_batch","_total_batch","post","_save_feed_file","loop","_unblock_button","_resetProgressBar","console","refreshInterval","arguments","undefined","clearInterval","setInterval","_updateProgressBar","update","_toggleProgressBar","table","show","color","width","pagenow","attr_name","hover","renderMerchantTemplate","_loop","appendTo","remove","clipboard","confirm","href","slideToggle","loader","reload","button","status_area","select","execCommand","current_attribute_value","fancyOption","fancyDataPicker","selectIf","currency","price_attributes","selectKey","progress_message","parents","includes","outputSelect","feedCurrency","woocommerce","del_confirm_multi","add_postbox_toggles","row","_ajax_clean_nonce","validate","save","server","sftp_checking","sftp_available","merchant","sftp_warning","name","templateName","provider","valid","merchantTemplateCache","outOfStockVisibilityRow","feedName","checked","valueColumn","append","attribute","preload","load","google_category","query","googleCategories","learn_more","cb","itemWrapper","item_wrapper_hidden","wf_csv_txt","id","windowpos","scroll","click","cat_init","wooFeed_get_facebook_categories","wooFeed_get_google_categories","for_attr","setValue","catField","catId","groupId","v","ready","attribute_list","googleMap","current_feed_currency","price","providerName","location","queryString","weight","attribute_value","height","current_Value","dimension","feed_rules","search","get","eq","parseInt","inArray","_key","_value"],"mappings":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feed-admin.min.js","sourcesContent":["// noinspection JSUnresolvedletiable\n/**!\n * WooFeed Scripts\n * @version 3.3.6\n * @package WooFeed\n * @copyright 2020 WebAppick\n *\n */\n/* global ajaxurl, wpAjax, postboxes, pagenow, alert, deleteUserSetting, typenow, adminpage, thousandsSeparator, decimalPoint, isRtl */\n// noinspection JSUnresolvedVariable\n(function($, window, document, wpAjax, opts) {\n \"use strict\";\n /**\n * All of the code for your admin-facing JavaScript source\n * should reside in this file.\n *\n * Note: It has been assumed you will write jQuery code here, so the\n * $ function reference has been prepared for usage within the scope\n * of this function.\n *\n * This enables you to define handlers, for when the DOM is ready:\n */\n\n /**\n * disable element utility\n *\n * @since 3.1.9\n *\n * @param {*} status\n * @returns {$|HTMLElement}\n */\n $.fn.disabled = function(status) {\n $(this).each(function() {\n let self = $(this),\n prop = 'disabled';\n\n if (typeof self.prop(prop) !== 'undefined') {\n self.prop(prop, status === void 0 || status === true);\n } else {\n !0 === status ? self.addClass(prop) : self.removeClass(prop);\n }\n });\n return self; // method chaining\n };\n\n /**\n * Check if a HTMLElement or jQuery is disabled\n */\n $.fn.isDisabled = function() {\n let self = $(this),\n prop = 'disabled';\n return typeof self.prop(prop) !== 'undefined' ? self.prop(prop) : self.hasClass(prop);\n };\n\n /**\n * Clear Tooltip for clip board js\n * @param {Object} event\n */\n const clearTooltip = (event) => {\n $(event.currentTarget).removeClass( (index, className) => (className.match(/\\btooltipped-\\S+/g) || []).join(' ') ).removeClass('tooltipped').removeAttr('aria-label');\n };\n\n const showTooltip = (elem, msg) => {\n $(elem).addClass('tooltipped tooltipped-s').attr('aria-label', msg);\n };\n\n const fallbackMessage = (action) =>{\n let actionMsg,\n actionKey = action === 'cut' ? 'X' : 'C';\n\n if (/iPhone|iPad/i.test(navigator.userAgent)) {\n actionMsg = 'No support :(';\n } else if (/Mac/i.test(navigator.userAgent)) {\n actionMsg = 'Press ⌘-' + actionKey + ' to ' + action;\n } else {\n actionMsg = 'Press Ctrl-' + actionKey + ' to ' + action;\n }\n\n return actionMsg;\n };\n\n /**\n * Alias of jQuery.extend()\n * @param {Object} _default\n * @param {Object} _args\n */\n const extend = (_default, _args) => $.extend(true, {}, _default, _args);\n\n\t/*\n\t* Handles product attributes\n\t*\n\t* @since 4.4.18\n\t* */\n\tclass WooFeedCustomFields {\n\n\t\tconstructor( field, status, isTaxonomy ) {\n\t\t\tthis.productCustomFields( field, status, isTaxonomy );\n\t\t}\n\n\t\tcacheClear() {\n\t\t\tlet data = {\n\t\t\t\taction: 'woo_feed_product_attribute_cache_remove',\n\t\t\t\tnonce: wpf_ajax_obj.ajax.nonce,\n\t\t\t};\n\t\t\t$.ajax({\n\t\t\t\tmethod: 'POST',\n\t\t\t\turl: wpf_ajax_obj.wpf_ajax_url,\n\t\t\t\tdata\n\t\t\t});\n\t\t}\n\n\t\tproductCustomFields( field, status = false, isTaxonomy ) {\n\t\t\tlet data = {\n\t\t\t\taction: 'woo_feed_custom_fields_status_change',\n\t\t\t\tnonce: wpf_ajax_obj.ajax.nonce,\n\t\t\t\tfield,\n\t\t\t\tstatus,\n\t\t\t\tisTaxonomy\n\t\t\t};\n\t\t\t$.ajax({\n\t\t\t\tmethod: 'POST',\n\t\t\t\turl: wpf_ajax_obj.wpf_ajax_url,\n\t\t\t\tdata,\n\t\t\t\tsuccess: ( response ) => {\n\t\t\t\t\tif( response.success ) {\n\t\t\t\t\t\tthis.cacheClear();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log( response );\n\t\t\t\t\t}\n $('#'+field+'-switcher').closest('td').find('.switch-loader').hide();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n /*\n * Handles product categories\n *\n * @since 4.4.39\n * */\n class WooFeedFeedCategories {\n wooFeed_get_google_categories () {\n wpAjax.send('get_google_categories', {\n type: 'GET',\n data: {\n _ajax_nonce: opts.nonce,\n action: \"get_google_categories\",\n // provider: provider\n }\n }).then(function (response) {\n $('.selectize-google-category').selectize({\n valueField: 'value',\n labelField: 'text',\n placeholder: 'Select a category',\n searchField: ['value', 'text'],\n options: response,\n render: {\n option: (data, escape) => `<div class=\"item wapk-selectize-item\">${escape(data.value + ' - ' + data.text)}</div>`,\n item: (data, escape) => `<div class=\"item wapk-selectize-item\">${escape(data.value + ' - ' + data.text)}</div>`\n }\n });\n }).fail(helper.ajax_fail);\n }\n\n wooFeed_get_facebook_categories() {\n // get facebook categories\n wpAjax.send('get_facebook_categories', {\n type: 'GET',\n data: {\n _ajax_nonce: opts.nonce,\n action: \"get_facebook_categories\",\n // provider: provider\n }\n }).then(function (response) {\n $('.selectize-google-category').selectize({\n valueField: 'value',\n labelField: 'text',\n placeholder: 'Select a Facebook category',\n searchField: ['value', 'text'],\n options: response,\n render: {\n option: (data, escape) => `<div class=\"item wapk-selectize-item\">${escape(data.value + ' - ' + data.text)}</div>`,\n item: (data, escape) => `<div class=\"item wapk-selectize-item\">${escape(data.value + ' - ' + data.text)}</div>`\n }\n });\n }).fail(helper.ajax_fail);\n }\n }\n\n let $copyBtn,\n clipboard,\n googleCategories,\n facebookCategories,\n helper = {\n in_array: (needle, haystack) => {\n try {\n return haystack.indexOf(needle) !== -1;\n } catch (e) {\n return false;\n }\n },\n selectize_render_item: (data, escape) => `<div class=\"item wapk-selectize-item\">${escape(data.text)}</div>`, // phpcs:ignore WordPressVIPMinimum.JS.StringConcat.Found,\n ajax_fail: e => {\n console.warn(e);\n alert(e.hasOwnProperty('statusText') && e.hasOwnProperty('status') ? opts.ajax.error + '\\n' + e.statusText + ' (' + e.status + ')' : e);\n },\n /**\n * Initialize Sortable\n * @param {$|HTMLElement} el\n * @param {object} config\n * @param {int|boolean} column\n * @param {function} onDrop\n * @return {$|HTMLElement}\n */\n sortable: (el, config, column, onDrop) => {\n return (el || $('.sorted_table')).each(function() {\n let self = $(this),\n column_count = self.find('tbody > tr:eq(0) > td').length || column || 9;\n self.wf_sortable(extend({\n containerSelector: 'table',\n itemPath: '> tbody',\n itemSelector: 'tr',\n handle: 'i.wf_sortedtable',\n placeholder: `<tr class=\"placeholder\"><td colspan=\"${column_count}\"></td></tr>`,\n onDrop: ($item, container, _super, event) => {\n $item.removeClass(container.group.options.draggedClass).removeAttr('style');\n $(\"body\").removeClass(container.group.options.bodyClass);\n if ( onDrop && 'function' === typeof( onDrop ) ) {\n onDrop( $item, container, _super, event );\n }\n },\n }, config));\n });\n },\n selectize: (el, config) => {\n return (el || $('select.selectize')).not('.selectized').not('.selectize-google-category').each(function() {\n let self = $(this);\n self.selectize(extend({\n create: self.data('create') || false,\n plugins: self.data('plugins') ? self.data('plugins').split(',').map(function(s) {\n return s.trim();\n }) : [],\n //['remove_button'],\n render: {\n item: helper.selectize_render_item\n }\n }, config));\n });\n },\n fancySelect: (el, config) => {\n return (el || $('select.fancySelect')).not('.FancySelectInit').each(function() {\n let self = $(this);\n self.fancySelect(extend({\n maxItemShow: 3\n }, config));\n });\n },\n reindex_config_table: () => {\n $('#table-1').find('tbody tr').each( ( x, el ) => {\n $(el).find('[name]').each( ( x1, el ) => {\n $(el).attr('name', $(el).attr('name').replace(/(\\[\\d\\])/g, `[${x}]`));\n } );\n } );\n },\n common: () => {\n helper.sortable( $('.sorted_table'), {}, 9, helper.reindex_config_table );\n helper.selectize();\n helper.fancySelect($('.outputType'));\n }\n },\n // helper functions\n feedEditor = {\n /**\n * The Editor Form Elem.\n * @type {$|HTMLElement}\n */\n form: null,\n\n /**\n * Initialize The Feed Editor {Tabs...}\n * @returns {void}\n */\n init: function () {\n let self = this;\n self.form = $('.generateFeed');\n if (!self.form.length) return;\n helper.common();\n // noinspection JSUnresolvedVariable\n $(document).trigger('feed_editor_init');\n $(document).trigger(new jQuery.Event('feedEditor.init', {\n target: this.form\n }));\n },\n\n /**\n * Render Merchant info ajax response and handle allowed feed type for selected merchant\n * @param {$|HTMLElement} merchantInfo jQuery dom object\n * @param {$|HTMLElement} feedType jQuery dom object\n * @param {Object} r ajax response object\n */\n renderMerchantInfo: function (merchantInfo, feedType, r) {\n for (let k in r) {\n if (r.hasOwnProperty(k)) {\n merchantInfo.find('.merchant-info-section.' + k + ' .data').html(r[k]); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html\n\n if ('feed_file_type' === k) {\n (function() {\n let types = r[k].split(\",\").map(function(t) {\n return t.trim().toLowerCase();\n }).filter(function(t) {\n // noinspection JSUnresolvedVariable\n return t !== '' && t !== opts.na.toLowerCase();\n });\n\n if (types.length) {\n feedType.find('option').removeAttr('selected').each(function() {\n let opt = $(this);\n opt.val() && !helper.in_array(opt.val(), types) ? opt.disabled(!0) : opt.disabled(!1);\n });\n if (types.length === 1) feedType.find('option[value=\"' + types[0] + '\"]').attr('selected', 'selected');\n } else feedType.find('option').disabled(!1);\n })();\n }\n }\n }\n\n merchantInfo.find('.spinner').removeClass('is-active');\n feedType.disabled(!1);\n feedType.trigger('change');\n\n /**\n * Triggers after merchant configuration is fetched & loaded\n * */\n $(document).trigger('woo_feed_config_loaded');\n\n feedType.parent().find('.spinner').removeClass('is-active');\n },\n\n /**\n * Render Feed Template Tabs and settings while creating new feed.\n * @param {$|HTMLElement} feedForm feed from query dom object\n * @param {object} r merchant template ajax response object\n */\n renderMerchantTemplate: function (feedForm, r) {\n let _loop = function _loop(k) {\n if (r.hasOwnProperty(k)) {\n if ('tabs' === k) {\n // noinspection JSUnresolvedFunction\n feedForm.html(r[k]); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html\n } else {\n let contentSettings = $('[name=\"' + k + '\"]');\n\n if (contentSettings.length) {\n contentSettings.each(function() {\n let elem = $(this);\n\n if (elem.is('select')) {\n elem.find('[value=\"' + r[k] + '\"]').prop('selected', true);\n } else if ((elem.is('[type=checkbox]') || elem.is('[type=radio]')) && elem.val() === r[k]) {\n elem.prop('checked', true);\n } else {\n elem.val(r[k]); // type=text\n }\n }).trigger('change');\n }\n }\n }\n };\n\n for (let k in r) {\n _loop(k);\n }\n\n feedEditor.init();\n }\n },\n // Feed Editor Table\n merchantInfoCache = [],\n merchantTemplateCache = [],\n tooltip = () => {\n // Tooltip only Text\n $('.wfmasterTooltip')\n .hover(function () {\n // Hover over code\n let self = $(this), title = self.attr('wftitle');\n self.data('tipText', title).removeAttr('wftitle');\n $('<p class=\"wftooltip\"></p>').text(title).appendTo('body').fadeIn('slow');\n }, function () {\n // Hover out code\n let self = $(this);\n self.attr('wftitle', self.data('tipText'));\n $('.wftooltip').remove();\n })\n .mousemove(function (e) {\n $('.wftooltip').css({\n top: e.pageY + 10,\n left: e.pageX + 20\n });\n });\n },\n clip = () => {\n $copyBtn = $('.toClipboard');\n if (!ClipboardJS.isSupported() || /iPhone|iPad/i.test(navigator.userAgent)) {\n $copyBtn.find('img').hide(0);\n } else {\n $copyBtn.each(function() {\n $(this).on('mouseleave', clearTooltip).on('blur', clearTooltip);\n });\n clipboard = new ClipboardJS('.toClipboard');\n clipboard.on('error', function(event) {\n showTooltip(event.trigger, fallbackMessage(event.action));\n }).on('success', function(event) {\n showTooltip(event.trigger, 'Copied');\n });\n }\n };\n\n /**\n * Feed Generator Module\n */\n class feedGenerator {\n\n /**\n * Constructor\n * @constructor\n */\n constructor() {\n this._feed = opts.generator.feed; // wf_config+xxxx\n this._limit = opts.generator.limit;\n this._progress = 0;\n this._timer = null;\n this._color = false;\n // batch info\n this._total_batch = 0;\n this._current_batch = 0;\n this._product_ids = [];\n this._progress_per_batch = 0;\n this._refresh = true;\n // noinspection JSUnresolvedVariable\n this._regenerate = opts.generator.regenerate;\n window.isRegenerating = false;\n this._all_btn = $('.wpf_regenerate');\n this._current_btn = $(`#${this._feed.replace( 'wf_config', 'wf_feed_' )}`);\n this._current_btn_label = '';\n }\n\n /**\n * Init Hooks (Event)\n * @return {feedGenerator}\n */\n init() {\n let self = this;\n if ( '' !== this._feed && this._regenerate && false === window.isRegenerating ) {\n this.generate();\n }\n\n //thickbox body add feed plugin class to make it unique and custom style\n let current_page_query = window.location.search;\n let params = new URLSearchParams(current_page_query);\n let page_name = params.get(\"page\");\n if( \"webappick-manage-feeds\" === page_name ) {\n $('body').addClass('woo-import-popup-body');\n }\n\n $(document).on('click', '.woo-feed-campaign-close-button', function(event) {\n event.preventDefault();\n\n $(this).parent('.woo-feed-promotion').hide();\n let condition = $(this).data('condition');\n if(1 === condition) {\n wpAjax.post( 'woo_feed_hide_promotion', {\n _ajax_nonce: opts.nonce,\n condition: condition,\n } ).then( response => {\n self._log( response );\n } ).fail( error => {\n self._log( error );\n self._updateProgressStatus( error.message );\n self._color = 'red';\n } );\n }\n });\n\n $(document).on('click', '.wpf_regenerate', function(event) {\n event.preventDefault();\n self._current_btn = $( this );\n if( self._current_btn.hasClass('disabled') || window.isRegenerating === true ) return;\n self._feed = self._current_btn.attr('id').replace( 'wf_feed_', 'wf_config' );\n if( '' !== self._feed ) {\n self.generate();\n }\n });\n return this;\n }\n\n _block_button() {\n if ( this._all_btn.length ) {\n this._all_btn.addClass('disabled');\n }\n if ( this._current_btn.length ) {\n this._current_btn.find('span').addClass('wpf_spin reverse_spin');\n this._current_btn_label = this._current_btn.attr('title');\n // noinspection JSUnresolvedVariable\n this._current_btn.attr( 'aria-label', opts.regenerate ).attr( 'title', opts.regenerate );\n }\n }\n\n _unblock_button() {\n if ( this._all_btn.length ) {\n this._all_btn.removeClass('disabled');\n }\n if ( this._current_btn.length ) {\n this._current_btn.find('span').removeClass('wpf_spin');\n this._current_btn.find('span').removeClass('reverse_spin');\n this._current_btn.attr( 'aria-label', this._current_btn_label ).attr( 'title', this._current_btn_label );\n }\n }\n\n /**\n * Generate Feed\n * @return void\n */\n generate() {\n let self = this;\n window.isRegenerating = true;\n this._block_button();\n this._resetProgressBar();\n this._progressBarActive();\n this._log( 'Counting Total Products' );\n this._updateProgressStatus( 'Fetching products.' );\n this._get_product_ids().then( response => {\n this._progress = 10;\n self._log( {response} );\n if(response.success) {\n self._log( `Total ${response.total} Products found.` );\n self._product_ids = response.product;\n self._total_batch = this._product_ids.length;\n self._current_batch = 0;\n self._progress_per_batch = ( 90 - this._progress ) / this._total_batch;\n self._process_batch();\n self._updateProgressStatus( 'Processing Products...' );\n } else {\n self._updateProgressStatus( response.data.message );\n }\n }).fail( error => {\n self._log( error );\n self._updateProgressStatus( error.message );\n self._color = 'red';\n setTimeout( function(){\n self._stopProgressBar();\n self._unblock_button();\n }, 1500 );\n } );\n }\n\n /**\n * Get Product Ids\n * @returns {$.promise}\n * @private\n */\n _get_product_ids() {\n this._progress = 5;\n return wpAjax.post( 'get_product_information', {\n _ajax_nonce: opts.nonce,\n feed: this._feed,\n limit: this._limit,\n } );\n }\n\n /**\n * Run the Batch\n * @private\n */\n _process_batch() {\n let self = this;\n let status = `Processing Batch ${this._current_batch+1} of ${this._total_batch}`;\n this._updateProgressStatus( status );\n this._log( status );\n wpAjax.post( 'make_batch_feed', {\n _ajax_nonce: opts.nonce,\n feed: this._feed,\n products: this._product_ids[this._current_batch],\n loop: this._current_batch,\n } ).then( response => {\n self._current_batch++;\n self._log( `Batch ${self._current_batch} Completed` );\n self._log( response );\n if ( self._current_batch < self._total_batch ) {\n self._process_batch();\n self._progress += self._progress_per_batch;\n }\n if ( self._current_batch === self._total_batch ) {\n self._save_feed_file();\n }\n } ).fail( error => {\n self._log( error );\n self._updateProgressStatus( error.message );\n self._color = 'red';\n setTimeout( function(){\n self._stopProgressBar();\n self._unblock_button();\n }, 1500 );\n } );\n }\n\n /**\n * Save Feed Data from temp to feed file\n * @private\n */\n _save_feed_file() {\n let self = this;\n this._log( 'Saving feed file' );\n this._updateProgressStatus( 'Saving feed file' );\n wpAjax.post( 'save_feed_file', {\n _ajax_nonce: opts.nonce,\n feed: this._feed,\n } ).then( response => {\n self._log( response );\n self._progress = 100;\n if ( self._refresh ) {\n window.location.href = `${opts.pages.list.feed}&link=${response.url}&cat=${response.cat}`;\n }\n setTimeout( function(){\n self._stopProgressBar();\n setTimeout( function(){\n self._resetProgressBar( true );\n self._unblock_button();\n }, 3000 );\n }, 2500 );\n } ).fail( error => {\n self._log( error );\n self._updateProgressStatus( error.message );\n self._color = 'red';\n setTimeout( function(){\n self._stopProgressBar();\n self._unblock_button();\n }, 1500 );\n } );\n }\n\n /**\n * Console log wrapper with debug settings.\n * @param data\n * @returns {feedGenerator}\n * @private\n */\n _log( data ) {\n // noinspection JSUnresolvedVariable\n if ( opts.wpf_debug ) {\n console.log( data );\n }\n return this;\n }\n\n /**\n * Run the progressbar refresh interval\n * @param {int} refreshInterval\n * @returns {feedGenerator}\n * @private\n */\n _progressBarActive( refreshInterval = 0 ) {\n let self = this;\n this._toggleProgressBar( true );\n this._timer = setInterval( function(){\n self._updateProgressBar();\n }, refreshInterval || 1000 );\n return this;\n }\n\n /**\n * Stop Progressbar\n * @returns {feedGenerator}\n * @private\n */\n _stopProgressBar() {\n clearInterval( this._timer );\n return this;\n }\n\n /**\n * Reset Progressbar\n * @returns {feedGenerator}\n * @private\n */\n _resetProgressBar( update ) {\n this._toggleProgressBar( false );\n this._updateProgressStatus( '' );\n clearInterval( this._timer );\n this._color = false;\n this._timer = null;\n this._progress = 0;\n if ( update ) {\n this._updateProgressBar();\n }\n return this;\n }\n\n /**\n * Show hide the progress bar el\n * @param status\n * @returns {feedGenerator}\n * @private\n */\n _toggleProgressBar( status ) {\n let table = $('#feed_progress_table');\n if ( status ) {\n table.show();\n } else {\n table.hide();\n }\n return this;\n }\n\n /**\n * Update Progress bar text status\n * @param {string} status\n * @returns {feedGenerator}\n * @private\n */\n _updateProgressStatus( status ) {\n $( '.feed-progress-status' ).html( status );\n return this;\n }\n\n _getErrorMessageByCode( error ){\n let progress_message = $( '.feed-progress-status' );\n progress_message.css( {'color':this._color});\n $( '.feed-progress-percentage' ).css( {'color':this._color});\n $( '.wpf_spin' ).css( {'color':this._color});\n\n let message=error.status +' : '+ error.statusText+'. ';\n if(500===error.status){\n message+= \"Please increase your PHP max_execution_time. Please <a target='_blank' href='https://webappick.com/docs/woo-feed/faq-for-woocommerce-product-feed/how-to-solve-processing-10-feed-generation-stuck-error/'>read this doc</a>.\";\n }\n\n this._updateProgressStatus(message);\n\n }\n\n /**\n * Update Progress Data\n * hooked with setInterval\n * @private\n */\n _updateProgressBar() {\n let percentage = $( '.feed-progress-percentage' ),\n bar = $( '.feed-progress-bar-fill' ),\n _progress = `${Math.round( this._progress )}%`;\n bar.css( {\n width: _progress,\n } );\n percentage.text( _progress );\n }\n }\n // expose to the global scope\n window.wf = {\n helper: helper,\n feedEditor: feedEditor,\n generator: feedGenerator,\n };\n\n $(window).on('load', function() {\n // Template loading ui conflict\n if ($(location).attr(\"href\").match(/webappick.*feed/g) !== null) {\n $('#wpbody-content').addClass('woofeed-body-content');\n }\n\n // ClipBoardJS\n clip();\n // postbox toggle\n postboxes.add_postbox_toggles(pagenow);\n // initialize generator\n let generator = new feedGenerator();\n generator.init();\n // noinspection JSUnresolvedVariable\n if( '' !== opts.generator.feed && opts.generator.regenerate ) {\n\n }\n // initialize editor\n feedEditor.init();\n helper.common(); // Generate Feed Add Table Row\n tooltip();\n // validate feed editor\n $(\".generateFeed\").validate();\n\n // document events\n $(document)\n .on('blur', 'input[name=\"wfDAttributeName\"]', function(e) {\n e.preventDefault();\n let attr_name = $(this).val();\n attr_name = attr_name.toLowerCase();\n attr_name = attr_name.split(' ').join('_');\n\n $('#wfDAttributeCode').val(attr_name);\n\n })\n .on('click', '[data-toggle_slide]', function(e) {\n e.preventDefault();\n $($(this).data('toggle_slide')).slideToggle('fast');\n })\n // XML Feed Wrapper\n .on('click', '#wf_newRow', function () {\n let tbody = $('#table-1 tbody'),\n template = $('#feed_config_template').text().trim().replace(/__idx__/g, tbody.find('tr').length);\n tbody.append(template);\n helper.fancySelect($('.outputType'));\n })\n // feed delete alert.\n .on('click', '.single-feed-delete', function (event) {\n event.preventDefault();\n // noinspection JSUnresolvedVariable\n if (confirm(opts.form.del_confirm)) {\n window.location.href = $(this).attr('val');\n }\n })\n // clear cache data.\n .on('click', '.wf_clean_cache_wrapper', function(event) {\n event.preventDefault();\n var nonce = $('.woo-feed-clean-cache-nonce').val();\n var loader = $('.woo-feed-cache-loader');\n\n //show loader\n loader.show();\n\n // passed cache nonce\n wpAjax.post('clear_cache_data', {\n _ajax_clean_nonce: nonce\n }).then(function (response) {\n if( response.success ) {\n loader.hide(); //hide loader\n location.reload();\n }\n }).fail(function () {\n console.log('something wrong');\n });\n\n })// Copy Status\n .on('click', '#woo-feed-copy-status-btn', function(event) {\n event.preventDefault();\n let button = $('#woo-feed-copy-status-btn');\n let status_area = $('#woo-feed-status-area');\n button.val('Copied');\n status_area.css('visibility','visible');\n status_area.select();\n\n document.execCommand('copy');\n })\n // feed value dropdown change.\n .on('change', '.wf_attr.wf_attributes', function(event) {\n event.preventDefault();\n\n $('.fancy-picker-picked').trigger(\"click\"); // trigger fancy select box clicked\n\n // price attributes\n var price_attributes = ['price', 'current_price', 'sale_price', 'price_with_tax', 'current_price_with_tax', 'sale_price_with_tax', 'shipping_cost'];\n // current value\n var current_attribute_value = $(this).val();\n var outputSelect = $(this).parents('tr').find('.outputType');\n var fancyOption = $(this).parents('tr').find('.fancy-picker-content .fancy-picker-option');\n var fancyDataPicker = $(this).parents('tr').find('.fancy-picker-data span');\n var selectIf, selectKey;\n var currency;\n\n // when any attribute is selected, pick the key\n if( price_attributes.includes(current_attribute_value) ) {\n // when select any price attribute\n selectIf = 'for_price';\n selectKey = \"Price\";\n } else if ( \"\" !== current_attribute_value && -1 !== current_attribute_value.indexOf('wf_taxo') ) {\n\n // when select any custom taxonomy\n selectIf = 'for_custom_taxo';\n selectKey = \"parent_if_empty\";\n } else {\n\n selectIf = 'for_all';\n selectKey = 'Default';\n }\n\n // remove selected class from old selected option\n fancyOption.removeClass('selected');\n\n // when value dropdown is selected as price or any custom taxonomy\n if( selectIf === 'for_custom_taxo' || selectIf === 'for_price' ) {\n // update \"Option Type\" when select key matches\n fancyOption.each(function() {\n if( selectKey === $(this).text() ) {\n $(this).addClass('selected');\n fancyDataPicker.text(selectKey);\n outputSelect.find(\"option\").text(selectKey);\n outputSelect.find(\"option\").val( $(this).data('value') );\n }\n });\n\n if( \"for_price\" === selectIf ) {\n var feedCurrency = $('#feedCurrency').val();\n if( \"undefined\" !== typeof feedCurrency && null !== feedCurrency ) {\n currency = feedCurrency;\n }else {\n currency = wpf_ajax_obj.woocommerce.currency;\n }\n\n //for price add currency to the suffix\n $(this).closest(\"tr\").find(\"td:eq(5) input\").val(\" \" + currency);\n }\n\n } else {\n fancyOption.each(function(){\n if( selectKey === $(this).text() ){\n $(this).addClass('selected');\n fancyDataPicker.text(selectKey);\n outputSelect.find(\"option\").text(selectKey);\n outputSelect.find(\"option\").val( $(this).data(\"value\") );\n }\n });\n\n $(this).closest(\"tr\").find(\"td:eq(5) input\").val(\"\");\n }\n\n })\n // bulk delete alert.\n .on('click', '#doaction, #doaction2', function () {\n // noinspection JSUnresolvedVariable\n return confirm(opts.form.del_confirm_multi);\n })\n // Generate Feed Table Row Delete\n .on('change', '.dType', function () {\n let self = $(this),\n type = self.val(),\n row = self.closest('tr');\n\n if (type === 'pattern') {\n row.find('.value_attribute').hide();\n row.find('.value_pattern').show();\n } else if (type === 'attribute') {\n row.find('.value_attribute').show();\n row.find('.value_pattern').hide();\n } else if (type === 'remove') {\n row.find('.value_attribute').hide();\n row.find('.value_pattern').hide();\n }\n })\n // Generate Feed Form Submit\n .on('click', '.delRow', function (e) {\n e.preventDefault();\n $(this).closest('tr').remove();\n helper.reindex_config_table();\n })\n .on('submit', '#generateFeed', function () {\n // Feed Generating form validation\n $(this).validate();\n\n if ($(this).valid()) {\n $(\".makeFeedResponse\")\n .show()\n .html(`<b style=\"color: darkblue;\"><i class=\"dashicons dashicons-sos wpf_spin\"></i> ${opts.form.generate}</b>`); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html, WordPressVIPMinimum.JS.StringConcat.Found\n }\n })\n // Generate Update Feed Form Submit\n .on('submit', '#updatefeed', function (e, data) {\n // Feed Generating form validation\n $(this).validate();\n\n if ($(this).valid()) {\n $(\".makeFeedResponse\")\n .show()\n .html(`<b style=\"color: darkblue;\"><i class=\"dashicons dashicons-sos wpf_spin\"></i> ${data && data.save ? opts.form.save : opts.form.generate}</b>`); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html, WordPressVIPMinimum.JS.StringConcat.Found\n }\n })\n .on( 'ready woo_feed_config_loaded', function(){\n\n if( $('#ftpenabled').val() === '0' ){\n $('.google-merchant-message').hide('slow');\n $('.woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select').attr('disabled','disabled');\n } else {\n if( $('#provider').val() === 'google' ) {\n $('.google-merchant-message').show('slow');\n } else {\n $('.google-merchant-message').hide('slow');\n }\n $('.woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select').removeAttr('disabled');\n }\n\n $('#ftpenabled').on('change', function(){\n if( $('#ftpenabled').val() === '0' ){\n $('.google-merchant-message').hide('slow');\n $('.woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select').attr('disabled','disabled');\n } else {\n\n $('.woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select').removeAttr('disabled');\n\n // Google merchant specific message\n if( $('#provider').val() === 'google' ){\n $('.google-merchant-message').show('slow');\n } else {\n $('.google-merchant-message').hide('slow');\n }\n\n }\n });\n })\n .on('change', '.ftporsftp', function () {\n let server = $(this).val(),\n status = $('.ssh2_status');\n\n if (server === 'sftp') {\n // noinspection JSUnresolvedVariable\n status.show().css('color', 'dodgerblue').text(opts.form.sftp_checking);\n wpAjax.post('get_ssh2_status', {\n _ajax_nonce: opts.nonce,\n server: server\n }).then(function (response) {\n if (response === 'exists') {\n // noinspection JSUnresolvedVariable\n status.css('color', '#2CC185').text(opts.form.sftp_available);\n setTimeout(function () {\n status.hide();\n }, 1500);\n } else {\n // noinspection JSUnresolvedVariable\n status.show().css('color', 'red').text(opts.form.sftp_warning);\n }\n }).fail(function (e) {\n status.hide();\n helper.ajax_fail(e);\n });\n } else {\n status.hide();\n }\n })\n .on('click', '[name=\"save_feed_config\"]', function (e) {\n e.preventDefault();\n $('#updatefeed').trigger('submit', {\n save: true\n });\n })\n .on('change', '#provider', function (event) {\n event.preventDefault();\n\n let merchant = $(this).val(),\n templateName = $(this).find(':selected').text(),\n name = $('#filename').val(),\n feedType = $(\"#feedType\"),\n feedForm = $(\"#providerPage\"),\n merchantInfo = $('#feed_merchant_info'); // set loading..\n\n // noinspection JSUnresolvedVariable\n feedForm.html('<h3><span style=\"float:none;margin: -3px 0 0;\" class=\"spinner is-active\"></span> ' + opts.form.loading_tmpl + '</h3>'); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html, WordPressVIPMinimum.JS.StringConcat.Found\n\n merchantInfo.find('.spinner').addClass('is-active');\n feedType.disabled(!0); // disable dropdown\n\n feedType.parent().find('.spinner').addClass('is-active');\n merchantInfo.find('.merchant-info-section .data').html(''); // remove previous data\n // Get Merchant info for selected Provider/Merchant\n\n if (merchantInfoCache.hasOwnProperty(merchant)) {\n feedEditor.renderMerchantInfo(merchantInfo, feedType, merchantInfoCache[merchant]);\n\n /**\n * Triggers after merchant configuration is fetched & loaded\n * */\n $(document).trigger('woo_feed_config_loaded');\n\n } else {\n wpAjax.send('woo_feed_get_merchant_info', {\n type: 'GET',\n data: {\n nonce: opts.nonce,\n provider: merchant,\n templateName: templateName\n }\n }).then(function (r) {\n merchantInfoCache[merchant] = r;\n feedEditor.renderMerchantInfo(merchantInfo, feedType, r);\n }).then(function(){\n\n /**\n * Triggers after merchant configuration is fetched & loaded\n * */\n $(document).trigger('woo_feed_config_loaded');\n\n }).fail(helper.ajax_fail);\n } // Get FeedForm For Selected Provider/Merchant\n\n\n if (merchantTemplateCache.hasOwnProperty(merchant)) {\n feedEditor.renderMerchantTemplate(feedForm, merchantTemplateCache[merchant]);\n\n /**\n * Triggers after merchant configuration is fetched & loaded\n * */\n $(document).trigger('woo_feed_config_loaded');\n\n } else {\n wpAjax.post('get_feed_merchant', {\n _ajax_nonce: opts.nonce,\n merchant: merchant\n }).then(function (r) {\n merchantTemplateCache[merchant] = r;\n feedEditor.renderMerchantTemplate(feedForm, r);\n $('#utm_source').val(templateName);\n $('#utm_campaign').val(name);\n //when merchant is bing, change delimiter and enclosure\n if( 'bing' === merchant ) {\n //delimiter value\n $(\"#delimiter option\").removeAttr('selected');\n $(\"#delimiter option[value=\\\"tab\\\"]\").attr('selected', 'selected');\n\n //enclosure value\n $(\"#enclosure option\").removeAttr('selected');\n $(\"#enclosure option[value=\\\" \\\"]\").attr('selected', 'selected');\n }\n\n //reviewer options hide\n if( 'google_product_review' !== merchant) {\n $('.wf_attributes option[value=\"reviewer_name\"]').hide();\n }\n }).then(function(){\n\n /**\n * Triggers after merchant configuration is fetched & loaded\n * */\n $(document).trigger('woo_feed_config_loaded');\n\n }).fail(helper.ajax_fail);\n }\n })\n // Feed Active and Inactive status change via ajax\n .on('change', '.woo_feed_status_input', function () {\n let self = $(this);\n wpAjax.post('update_feed_status', {\n _ajax_nonce: opts.nonce,\n feedName: self.val(),\n status: self[0].checked ? 1 : 0\n });\n });\n // event with trigger\n $(document)\n .on('change', '[name=\"is_outOfStock\"], [name=\"product_visibility\"]', function () {\n let outOfStockVisibilityRow = $('.out-of-stock-visibility');\n if ($('[name=\"is_outOfStock\"]:checked').val() === 'n' && $('[name=\"product_visibility\"]:checked').val() === '1') {\n outOfStockVisibilityRow.show();\n } else {\n outOfStockVisibilityRow.hide();\n }\n })\n .on('change', '.attr_type', function () {\n // Attribute type selection\n let self = $(this),\n type = self.val(),\n row = self.closest('tr');\n\n if (type === 'pattern') {\n row.find('.wf_attr').hide();\n row.find('.wf_attr').val('');\n row.find('.wf_default').show();\n } else {\n row.find('.wf_attr').show();\n row.find('.wf_default').hide();\n row.find('.wf_default').val('');\n }\n })\n .on('change', '.wf_mattributes, .attr_type', function () {\n let row = $(this).closest('tr'),\n attribute = row.find('.wf_mattributes'),\n type = row.find('.attr_type'),\n valueColumn = row.find('td:eq(4)'),\n provider = $('#provider').val();\n\n // noinspection JSUnresolvedVariable\n if (opts.form.google_category.hasOwnProperty(attribute.val()) && type.val() === 'pattern' && helper.in_array(provider, opts.form.google_category[attribute.val()])) {\n if (valueColumn.find('select.selectize').length === 0) {\n valueColumn.find('input.wf_default').remove();\n valueColumn.append('<span class=\"wf_default wf_attributes\"><select name=\"default[]\" class=\"selectize\"></select></span>');\n // noinspection JSUnresolvedVariable\n valueColumn.append(`<span style=\"font-size:x-small;\"><a style=\"color: red\" href=\"https://webappick.com/docs/woo-feed/feed-configuration/how-to-map-store-category-with-merchant-category/\" target=\"_blank\">${opts.learn_more}</a></span>`);\n\n if (!googleCategories || !facebookCategories) {\n valueColumn.append('<span class=\"spinner is-active\" style=\"margin: 0;\"></span>');\n }\n\n let select = valueColumn.find('.wf_attributes select');\n // noinspection JSUnresolvedVariable\n helper.selectize(select, {\n preload: true,\n placeholder: opts.form.select_category,\n load: function load(query, cb) {\n if (!googleCategories) {\n wpAjax.send('get_google_categories', {\n type: 'GET',\n data: {\n _ajax_nonce: opts.nonce,\n action: \"get_google_categories\",\n provider: provider\n }\n }).then(function (r) {\n googleCategories = r;\n cb(googleCategories);\n valueColumn.find('.spinner').remove();\n }).fail(helper.ajax_fail);\n } else {\n cb(googleCategories);\n }\n\n //for facebook product category merchant attribute\n if (!facebookCategories && \"facebook\" === provider && \"fb_product_category\" === attribute.val()) {\n wpAjax.send('get_facebook_categories', {\n type: 'GET',\n data: {\n _ajax_nonce: opts.nonce,\n action: \"get_facebook_categories\",\n provider: provider\n }\n }).then(function (r) {\n facebookCategories = r;\n cb(facebookCategories);\n valueColumn.find('.spinner').remove();\n }).fail(helper.ajax_fail);\n } else {\n cb(facebookCategories);\n }\n }\n });\n }\n } else {\n if ( attribute.val() !== 'current_category' && valueColumn.find('input.wf_default').length === 0) {\n valueColumn.find('span').remove();\n valueColumn.append('<input autocomplete=\"off\" class=\"wf_default wf_attributes\" type=\"text\" name=\"default[]\" value=\"\">');\n\n if (type.val() !== 'pattern') {\n valueColumn.find('input.wf_default').hide();\n }\n }\n }\n })\n .on('change', '#feedType,#provider', function (e) {\n let type = $('#feedType').val(),\n provider = $('#provider').val(),\n itemWrapper = $('.itemWrapper'),\n wf_csv_txt = $('.wf_csvtxt');\n\n // noinspection JSUnresolvedVariable\n if (type !== '' && helper.in_array(provider, opts.form.item_wrapper_hidden)) {\n itemWrapper.hide();\n }\n\n //when feed type is changed\n if( 'feedType' === e.target.id ) {\n if (type === 'csv' || type === 'txt' || type === 'tsv') {\n wf_csv_txt.show();\n itemWrapper.hide();\n \n if( 'tsv' === type ) {\n $('#delimiter option:last').prop(\"selected\", \"selected\");\n } else if( 'csv' === type ) {\n $('#delimiter option:first').prop(\"selected\", \"selected\");\n }\n } else if( 'xml' === type && \"custom\" === provider ) {\n itemWrapper.show();\n wf_csv_txt.hide();\n } else if( 'json' === type ) {\n wf_csv_txt.hide();\n }\n }\n\n // when template is not custom template 1 hide the item wrapper\n if( \"custom\" !== provider ) {\n itemWrapper.hide();\n }\n\n })\n .trigger('change');\n\n\n $(document)\n\t\t\t.on('click', '.woofeed-custom-fields [id*=\"-switcher\"]', function () {\n\t\t\t $(this).closest('td').find('.switch-loader').show();\n\t\t\t\tlet field = $(this).attr( 'id' ).split( '-' )[0],\n\t\t\t\t\tisTaxonomy = $(this).data( 'taxonomy' ),\n\t\t\t\t\tstatus = $(this).prop( 'checked' );\n\t\t\t\tnew WooFeedCustomFields( field, status, isTaxonomy );\n\n\t\t\t})\n\n\t\t\t// Remove sticky cart on feature page\n\t\t\t.ready(function() {\n\t\t\t\tvar s = $(\".wapk-feed-buy-now-container\");\n\t\t\t\t$(window).scroll(function() {\n\t\t\t\t\tvar windowpos = $(window).scrollTop();\n\t\t\t\t\tif ( windowpos <= 5000 ) {\n\t\t\t\t\t\ts.addClass(\"fixed\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts.removeClass(\"fixed\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n });\n\n $(document)\n\t\t.on('click', '#woo-feed-debug-log-download', function (e) {\n\t\t\te.preventDefault();\n\t\t\t$(\"<a />\", {\n\t\t\t\tdownload: new Date() + \".log\",\n\t\t\t\thref: URL.createObjectURL(\n\t\t\t\t\tnew Blob([$(\"#woo-feed-debug-log\").val()], {\n\t\t\t\t\t\ttype: \"text/plain\"\n\t\t\t\t\t})),\n\t\t\t}).appendTo(\"body\")[0].click();\n\t\t})\n\t\t.on('keyup', '#filename', function() {\n\t\t\tvar name = $('#filename').val();\n\t\t\t$('#utm_campaign').val(name);\n\t\t})\n\n .on('click', '.wf-tab-name', function(e) {\n $('.wf-tab-name.activate').removeClass('activate');\n $(this).addClass('activate');\n\n let for_attr = $(this).attr('for');\n $('.wf_tabs li.active').removeClass('active');\n $('.wf_tabs .wf-tab-content#' + for_attr).parent().addClass('active');\n })\n\n\t\t.on('change', '#category-mapping-form #providers', function() {\n\t\t\tvar provider = $(this).find(':selected').val(),\n\t\t\t\tgoogleMap = ['google', 'facebook', 'pinterest', 'bing', 'bing_local_inventory', 'snapchat'];\n\t\t\tif( googleMap.indexOf(provider) !== -1 ) {\n\t\t\t\t$('input[id*=\"cat_mapping_\"]').css('display', 'none');\n\t\t\t\t$('.wf_default.wf_attributes').css('display', 'block').css('width', '100%');\n\n var cat_init = new WooFeedFeedCategories();\n if( \"facebook\" === provider ) {\n cat_init.wooFeed_get_facebook_categories();\n }else {\n cat_init.wooFeed_get_google_categories();\n }\n\n } else {\n\t\t\t\t$('input[id*=\"cat_mapping_\"]').css('display', 'block');\n\t\t\t\t$('.wf_default.wf_attributes').css('display', 'none').css('width', '100%');\n\t\t\t}\n\t\t})\n\n // Copy parent category ids to child categories.\n\t\t.on('click', 'span[id*=\"cat-map-\"]', function(e) {\n\t\t\te.preventDefault();\n\t\t\tvar providerName = $('#category-mapping-form #providers').val(),\n\t\t\t\tgoogleMap = ['google', 'facebook', 'pinterest', 'bing', 'bing_local_inventory', 'snapchat'],\n\t\t\t\tcatId = $(this).attr('id').replace(/[^\\d.]/g, ''),\n\t\t\t\tgroupId = 'group-child-' + catId;\n\n\t\t\tif( googleMap.indexOf(providerName) !== -1) {\n\t\t\t\tvar catField = $(this).parents('tr').find('.selectized').val();\n\n\t\t\t\tif (catField) {\n\t\t\t\t\t$('.' + groupId).parents('tr').find('select').each(function (i, v) {\n\t\t\t\t\t\t$(v).data('selectize').setValue(catField);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tvar value = $('#cat_mapping_'+catId).val();\n\t\t\t\t$('.'+groupId).parents('tr').find('input').val(value);\n\t\t\t}\n\n\t\t});\n\n $(document).ready(function () {\n var provider = $(\"#providers\").val();\n var cat_init = new WooFeedFeedCategories();\n\n if( \"facebook\" === provider ) {\n cat_init.wooFeed_get_facebook_categories();\n } else {\n cat_init.wooFeed_get_google_categories();\n }\n\n });\n\n /*\n * Issue fix for feed edit page unsupported `Feed Type` not disabling\n *\n * @since 4.4.22\n * */\n $(document).on( \"feed_editor_init\", function(){\n\n let types = $('.merchant-info-section.feed_file_type .data').html().split(\",\").map(function(t) {\n return t.trim().toLowerCase();\n });\n\n let feedType = $(\"#feedType\");\n\n if (types.length) {\n feedType.find('option').each(function() {\n let opt = $(this);\n opt.val() && !helper.in_array(opt.val(), types) ? opt.disabled(!0) : opt.disabled(!1);\n });\n if (types.length === 1) feedType.find('option[value=\"' + types[0] + '\"]').attr('selected', 'selected');\n } else feedType.find('option').disabled(!1);\n\n } );\n\n /**\n * Automatically adding postfix for corresponding attribute selection.\n *\n * @since 4.4.32\n */\n $(document).on('ready', function(){\n\n function update_postfix(){\n var attribute_list = {\n\n 'price': wpf_ajax_obj.woocommerce.currency,\n 'current_price': wpf_ajax_obj.woocommerce.currency,\n 'sale_price': wpf_ajax_obj.woocommerce.currency,\n 'price_with_tax': wpf_ajax_obj.woocommerce.currency,\n 'current_price_with_tax': wpf_ajax_obj.woocommerce.currency,\n 'sale_price_with_tax': wpf_ajax_obj.woocommerce.currency,\n\n\n 'weight': wpf_ajax_obj.woocommerce.weight,\n 'weight_unit': wpf_ajax_obj.woocommerce.weight,\n\n\n 'height': wpf_ajax_obj.woocommerce.dimension,\n 'length': wpf_ajax_obj.woocommerce.dimension,\n 'width': wpf_ajax_obj.woocommerce.dimension\n\n };\n\n if (typeof wpf_ajax_obj.feed_rules !== 'undefined' && wpf_ajax_obj.feed_rules !== null) {\n var feed_rules = wpf_ajax_obj.feed_rules;\n var current_feed_currency = feed_rules.feedCurrency;\n }\n\n //get current action name of the page\n var queryString = window.location.search;\n var urlParams = new URLSearchParams(queryString);\n var action = urlParams.get('action');\n\n $( '.wf_attr.wf_attributes' ).each( function( key, value){\n\n var attribute_value = $(value).val();\n var current_Value = $( 'input[name^=\"suffix\"]' ).eq( parseInt( key ) ).val();\n\n if( -1 !== $.inArray( current_Value, [\n ' ' + wpf_ajax_obj.woocommerce.currency,\n ' ' + wpf_ajax_obj.woocommerce.weight,\n ' ' + wpf_ajax_obj.woocommerce.dimension\n ] ) ){\n $( 'input[name^=\"suffix\"]' ).eq( parseInt( key ) ).val('');\n }\n\n $.each(attribute_list, function (_key, _value){\n if( attribute_value === _key ){\n _value = null !== current_feed_currency && \"undefined\" !== typeof current_feed_currency ? current_feed_currency : _value;\n\n if( \"undefined\" !== action && \"edit-feed\" !== action ) {\n $( 'input[name^=\"suffix\"]' ).eq( parseInt( key ) ).val( ' ' + _value );\n } else {\n $( 'input[name^=\"suffix\"]' ).eq( parseInt( key ) ).val( current_Value );\n }\n\n }\n });\n } );\n\n $(document).trigger( 'feedEditor.after.free.postfix.update' );\n }\n\n $(document).on('feedEditor.init', function(){\n update_postfix();\n });\n\n });\n\n})(jQuery, window, document, wp.ajax, wpf_ajax_obj);\n"]}
1
+ {"version":3,"sources":["woo-feed-admin.js"],"names":["_defineProperties","target","props","descriptor","i","enumerable","configurable","writable","Object","defineProperty","key","_createClass","Constructor","protoProps","staticProps","prototype","window","wpAjax","$","document","opts","self","prop","status","addClass","removeClass","hasClass","currentTarget","clearTooltip","userAgent","actionMsg","match","actionKey","index","join","removeAttr","elem","attr","msg","extend","_default","_args","valueField","$copyBtn","feedGenerator","this","on","ClipboardJS","event","action","showTooltip","trigger","test","navigator","ajax_fail","alert","facebookCategories","url","data","_classCallCheck","WooFeedCustomFields","productCustomFields","field","isTaxonomy","value","ajax","nonce","method","response","wpf_ajax_obj","wpf_ajax_url","success","_this","cacheClear","closest","find","hide","selectize","WooFeedFeedCategories","options","render","send","type","item","_ajax_nonce","then","fail","helper","labelField","placeholder","searchField","escape","concat","text","in_array","needle","haystack","indexOf","sortable","onDrop","column_count","warn","wf_sortable","containerSelector","e","hasOwnProperty","error","statusText","el","config","column","each","_super","handle","$item","container","create","group","draggedClass","plugins","bodyClass","numb","trim","replace","_onDrop","selectize_render_item","not","fancySelect","maxItemShow","split","map","s","reindex_config_table","itemSelector","init","renderMerchantInfo","form","length","common","jQuery","k","opt","merchantInfo","feedType","r","types","html","t","toLowerCase","na","disabled","val","_loop2","contentSettings","feedForm","feedEditor","is","merchantInfoCache","tooltip","css","top","_regenerate","isRegenerating","title","_current_btn","feed","_limit","generator","limit","_progress","_timer","_product_ids","_progress_per_batch","_refresh","mousemove","_feed","pageX","generate","clip","fallbackMessage","condition","URLSearchParams","_color","preventDefault","parent","_log","regenerate","_all_btn","current_page_query","page_name","_block_button","_current_btn_label","message","product","setTimeout","_this2","_stopProgressBar","_process_batch","_updateProgressStatus","_current_batch","_total_batch","post","_save_feed_file","loop","_unblock_button","_resetProgressBar","console","refreshInterval","arguments","undefined","clearInterval","setInterval","_updateProgressBar","update","_toggleProgressBar","table","show","color","width","pagenow","attr_name","hover","renderMerchantTemplate","_loop","appendTo","remove","clipboard","confirm","href","slideToggle","loader","reload","button","status_area","select","execCommand","current_attribute_value","fancyOption","fancyDataPicker","selectIf","currency","price_attributes","selectKey","progress_message","parents","includes","outputSelect","feedCurrency","woocommerce","del_confirm_multi","add_postbox_toggles","row","_ajax_clean_nonce","validate","save","server","sftp_checking","sftp_available","merchant","sftp_warning","name","templateName","provider","valid","merchantTemplateCache","outOfStockVisibilityRow","feedName","checked","valueColumn","append","attribute","preload","load","google_category","query","googleCategories","learn_more","cb","itemWrapper","item_wrapper_hidden","wf_csv_txt","id","windowpos","scroll","click","cat_init","wooFeed_get_facebook_categories","wooFeed_get_google_categories","for_attr","setValue","catField","catId","groupId","v","ready","attribute_list","googleMap","current_feed_currency","price","providerName","location","queryString","weight","attribute_value","height","current_Value","dimension","feed_rules","search","get","eq","parseInt","inArray","_key","_value"],"mappings":"yHAAA,SAAAA,kBAAAC,EAAAC,G,4BACA,IAAAC,EAAAD,EAAAE,GACAD,EAAAE,WAAAF,EAAAE,aAAA,EACAF,EAAAG,cAAA,EACA,UAAAH,IAAAA,EAAAI,UAAA,GACAC,OAAAC,eAAAR,EAAAE,EAAAO,IAAAP,IALA,SAAAQ,aAAAC,EAAAC,EAAAC,GAEA,OAOAD,GAAAb,kBAAAY,EAAAG,UAAAF,GARAC,GAAAE,kBAAAC,EAAAH,GACAF,GAcA,SAAAM,EAAAF,EAAAG,EAAAF,EAAAG,G,yDAqBgBC,IAAAA,EAAAA,EAAAA,MADJC,EAAAD,gBAIC,IAAAA,EAAAA,KAAAC,GAHGD,EAAAA,KAAAA,OAAAA,IAAAA,IAAAA,IAAAA,IAQZ,IAAAE,EAAAF,EAAAG,SAAAF,GAAAD,EAAAI,YAAAH,K,iCAII,IACIA,EAAAA,EAAAA,MACJJ,EAAA,WAHJ,YACI,IAAAG,EAAAC,KAAAA,GAAAD,EAAAC,KAAAA,GAAAD,EAAAK,SAAAJ,IAUQK,SAWRC,EAXoCC,GAAAC,EAAAA,EAAAA,eAAiCC,YAAMC,SAAhBC,EAA4CC,GAAYT,OAAAA,EAAAA,MAAAA,sBAAAA,IAAAA,KAAAA,OADvHK,YAAA,cAAAK,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,gB,8DAYiBR,EArElBF,aAAAY,WAqE8B5D,cAIPe,IAAAA,EAAnBtP,EAAA4R,SAAAQ,OAEOlS,EADM4Q,IAAAA,gBAAAA,GACNuB,IAAA,UACMtB,EAAAA,0BAAAA,KAAAA,SAAAA,EAAAA,GAPjB,IAAAgB,EAAA7R,EAAA8C,GAAAuF,MAYA0J,EAjFA/R,EAAA,yBAAAoS,GAAAC,SAAA7S,IAAA6I,OAoFJpI,IAAAA,EAAAqS,QAAAP,EAAA,CAAA,IAAA5O,aAAAmL,YAAAR,SAAA,IAAA3K,aAAAmL,YAAAsD,OAAA,IAAAzO,aAAAmL,YAAA0D,aACAhS,EAAA,yBAAAoS,GAAAC,SAAA7S,IAAA6I,IAAA,IAGYN,EAAAA,KAAAA,EAAU,SAAAwK,EAAAC,GAFhBvS,IAAAA,IA1EHuS,EAAA,MAAAjB,EAAAA,EAAAiB,4MAjxCH","file":"woo-feed-admin.min.js","sourcesContent":["// noinspection JSUnresolvedletiable\n/**!\n * WooFeed Scripts\n * @version 3.3.6\n * @package WooFeed\n * @copyright 2020 WebAppick\n *\n */\n/* global ajaxurl, wpAjax, postboxes, pagenow, alert, deleteUserSetting, typenow, adminpage, thousandsSeparator, decimalPoint, isRtl */\n// noinspection JSUnresolvedVariable\n(function($, window, document, wpAjax, opts) {\n \"use strict\";\n /**\n * All of the code for your admin-facing JavaScript source\n * should reside in this file.\n *\n * Note: It has been assumed you will write jQuery code here, so the\n * $ function reference has been prepared for usage within the scope\n * of this function.\n *\n * This enables you to define handlers, for when the DOM is ready:\n */\n\n /**\n * disable element utility\n *\n * @since 3.1.9\n *\n * @param {*} status\n * @returns {$|HTMLElement}\n */\n $.fn.disabled = function(status) {\n $(this).each(function() {\n let self = $(this),\n prop = 'disabled';\n\n if (typeof self.prop(prop) !== 'undefined') {\n self.prop(prop, status === void 0 || status === true);\n } else {\n !0 === status ? self.addClass(prop) : self.removeClass(prop);\n }\n });\n return self; // method chaining\n };\n\n /**\n * Check if a HTMLElement or jQuery is disabled\n */\n $.fn.isDisabled = function() {\n let self = $(this),\n prop = 'disabled';\n return typeof self.prop(prop) !== 'undefined' ? self.prop(prop) : self.hasClass(prop);\n };\n\n /**\n * Clear Tooltip for clip board js\n * @param {Object} event\n */\n const clearTooltip = (event) => {\n $(event.currentTarget).removeClass( (index, className) => (className.match(/\\btooltipped-\\S+/g) || []).join(' ') ).removeClass('tooltipped').removeAttr('aria-label');\n };\n\n const showTooltip = (elem, msg) => {\n $(elem).addClass('tooltipped tooltipped-s').attr('aria-label', msg);\n };\n\n const fallbackMessage = (action) =>{\n let actionMsg,\n actionKey = action === 'cut' ? 'X' : 'C';\n\n if (/iPhone|iPad/i.test(navigator.userAgent)) {\n actionMsg = 'No support :(';\n } else if (/Mac/i.test(navigator.userAgent)) {\n actionMsg = 'Press ⌘-' + actionKey + ' to ' + action;\n } else {\n actionMsg = 'Press Ctrl-' + actionKey + ' to ' + action;\n }\n\n return actionMsg;\n };\n\n /**\n * Alias of jQuery.extend()\n * @param {Object} _default\n * @param {Object} _args\n */\n const extend = (_default, _args) => $.extend(true, {}, _default, _args);\n\n\t/*\n\t* Handles product attributes\n\t*\n\t* @since 4.4.18\n\t* */\n\tclass WooFeedCustomFields {\n\n\t\tconstructor( field, status, isTaxonomy ) {\n\t\t\tthis.productCustomFields( field, status, isTaxonomy );\n\t\t}\n\n\t\tcacheClear() {\n\t\t\tlet data = {\n\t\t\t\taction: 'woo_feed_product_attribute_cache_remove',\n\t\t\t\tnonce: wpf_ajax_obj.ajax.nonce,\n\t\t\t};\n\t\t\t$.ajax({\n\t\t\t\tmethod: 'POST',\n\t\t\t\turl: wpf_ajax_obj.wpf_ajax_url,\n\t\t\t\tdata\n\t\t\t});\n\t\t}\n\n\t\tproductCustomFields( field, status = false, isTaxonomy ) {\n\t\t\tlet data = {\n\t\t\t\taction: 'woo_feed_custom_fields_status_change',\n\t\t\t\tnonce: wpf_ajax_obj.ajax.nonce,\n\t\t\t\tfield,\n\t\t\t\tstatus,\n\t\t\t\tisTaxonomy\n\t\t\t};\n\t\t\t$.ajax({\n\t\t\t\tmethod: 'POST',\n\t\t\t\turl: wpf_ajax_obj.wpf_ajax_url,\n\t\t\t\tdata,\n\t\t\t\tsuccess: ( response ) => {\n\t\t\t\t\tif( response.success ) {\n\t\t\t\t\t\tthis.cacheClear();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log( response );\n\t\t\t\t\t}\n $('#'+field+'-switcher').closest('td').find('.switch-loader').hide();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n /*\n * Handles product categories\n *\n * @since 4.4.39\n * */\n class WooFeedFeedCategories {\n wooFeed_get_google_categories () {\n wpAjax.send('get_google_categories', {\n type: 'GET',\n data: {\n _ajax_nonce: opts.nonce,\n action: \"get_google_categories\",\n // provider: provider\n }\n }).then(function (response) {\n $('.selectize-google-category').selectize({\n valueField: 'value',\n labelField: 'text',\n placeholder: 'Select a category',\n searchField: ['value', 'text'],\n options: response,\n render: {\n option: (data, escape) => `<div class=\"item wapk-selectize-item\">${escape(data.value + ' - ' + data.text)}</div>`,\n item: (data, escape) => `<div class=\"item wapk-selectize-item\">${escape(data.value + ' - ' + data.text)}</div>`\n }\n });\n }).fail(helper.ajax_fail);\n }\n\n wooFeed_get_facebook_categories() {\n // get facebook categories\n wpAjax.send('get_facebook_categories', {\n type: 'GET',\n data: {\n _ajax_nonce: opts.nonce,\n action: \"get_facebook_categories\",\n // provider: provider\n }\n }).then(function (response) {\n $('.selectize-google-category').selectize({\n valueField: 'value',\n labelField: 'text',\n placeholder: 'Select a Facebook category',\n searchField: ['value', 'text'],\n options: response,\n render: {\n option: (data, escape) => `<div class=\"item wapk-selectize-item\">${escape(data.value + ' - ' + data.text)}</div>`,\n item: (data, escape) => `<div class=\"item wapk-selectize-item\">${escape(data.value + ' - ' + data.text)}</div>`\n }\n });\n }).fail(helper.ajax_fail);\n }\n }\n\n let $copyBtn,\n clipboard,\n googleCategories,\n facebookCategories,\n helper = {\n in_array: (needle, haystack) => {\n try {\n return haystack.indexOf(needle) !== -1;\n } catch (e) {\n return false;\n }\n },\n selectize_render_item: (data, escape) => `<div class=\"item wapk-selectize-item\">${escape(data.text)}</div>`, // phpcs:ignore WordPressVIPMinimum.JS.StringConcat.Found,\n ajax_fail: e => {\n console.warn(e);\n alert(e.hasOwnProperty('statusText') && e.hasOwnProperty('status') ? opts.ajax.error + '\\n' + e.statusText + ' (' + e.status + ')' : e);\n },\n /**\n * Initialize Sortable\n * @param {$|HTMLElement} el\n * @param {object} config\n * @param {int|boolean} column\n * @param {function} onDrop\n * @return {$|HTMLElement}\n */\n sortable: (el, config, column, onDrop) => {\n return (el || $('.sorted_table')).each(function() {\n let self = $(this),\n column_count = self.find('tbody > tr:eq(0) > td').length || column || 9;\n self.wf_sortable(extend({\n containerSelector: 'table',\n itemPath: '> tbody',\n itemSelector: 'tr',\n handle: 'i.wf_sortedtable',\n placeholder: `<tr class=\"placeholder\"><td colspan=\"${column_count}\"></td></tr>`,\n onDrop: ($item, container, _super, event) => {\n $item.removeClass(container.group.options.draggedClass).removeAttr('style');\n $(\"body\").removeClass(container.group.options.bodyClass);\n var numb = $item.find(\".wf_mattributes\").attr(\"name\").replace(/\\D/g, \"\");\n $item.find(\"input.wf_attributes\").attr(\"name\", \"default[\"+ numb +\"]\");\n if ( onDrop && 'function' === typeof( onDrop ) ) {\n onDrop( $item, container, _super, event );\n }\n },\n }, config));\n });\n },\n selectize: (el, config) => {\n return (el || $('select.selectize')).not('.selectized').not('.selectize-google-category').each(function() {\n let self = $(this);\n self.selectize(extend({\n create: self.data('create') || false,\n plugins: self.data('plugins') ? self.data('plugins').split(',').map(function(s) {\n return s.trim();\n }) : [],\n //['remove_button'],\n render: {\n item: helper.selectize_render_item\n }\n }, config));\n });\n },\n fancySelect: (el, config) => {\n return (el || $('select.fancySelect')).not('.FancySelectInit').each(function() {\n let self = $(this);\n self.fancySelect(extend({\n maxItemShow: 3\n }, config));\n });\n },\n reindex_config_table: () => {\n $('#table-1').find('tbody tr').each( ( x, el ) => {\n $(el).find('[name]').each( ( x1, el ) => {\n $(el).attr('name', $(el).attr('name').replace(/(\\[\\d\\])/g, `[${x}]`));\n } );\n } );\n },\n common: () => {\n helper.sortable( $('.sorted_table'), {}, 9, helper.reindex_config_table );\n helper.selectize();\n helper.fancySelect($('.outputType'));\n }\n },\n // helper functions\n feedEditor = {\n /**\n * The Editor Form Elem.\n * @type {$|HTMLElement}\n */\n form: null,\n\n /**\n * Initialize The Feed Editor {Tabs...}\n * @returns {void}\n */\n init: function () {\n let self = this;\n self.form = $('.generateFeed');\n if (!self.form.length) return;\n helper.common();\n // noinspection JSUnresolvedVariable\n $(document).trigger('feed_editor_init');\n $(document).trigger(new jQuery.Event('feedEditor.init', {\n target: this.form\n }));\n },\n\n /**\n * Render Merchant info ajax response and handle allowed feed type for selected merchant\n * @param {$|HTMLElement} merchantInfo jQuery dom object\n * @param {$|HTMLElement} feedType jQuery dom object\n * @param {Object} r ajax response object\n */\n renderMerchantInfo: function (merchantInfo, feedType, r) {\n for (let k in r) {\n if (r.hasOwnProperty(k)) {\n merchantInfo.find('.merchant-info-section.' + k + ' .data').html(r[k]); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html\n\n if ('feed_file_type' === k) {\n (function() {\n let types = r[k].split(\",\").map(function(t) {\n return t.trim().toLowerCase();\n }).filter(function(t) {\n // noinspection JSUnresolvedVariable\n return t !== '' && t !== opts.na.toLowerCase();\n });\n\n if (types.length) {\n feedType.find('option').removeAttr('selected').each(function() {\n let opt = $(this);\n opt.val() && !helper.in_array(opt.val(), types) ? opt.disabled(!0) : opt.disabled(!1);\n });\n if (types.length === 1) feedType.find('option[value=\"' + types[0] + '\"]').attr('selected', 'selected');\n } else feedType.find('option').disabled(!1);\n })();\n }\n }\n }\n\n merchantInfo.find('.spinner').removeClass('is-active');\n feedType.disabled(!1);\n feedType.trigger('change');\n\n /**\n * Triggers after merchant configuration is fetched & loaded\n * */\n $(document).trigger('woo_feed_config_loaded');\n\n feedType.parent().find('.spinner').removeClass('is-active');\n },\n\n /**\n * Render Feed Template Tabs and settings while creating new feed.\n * @param {$|HTMLElement} feedForm feed from query dom object\n * @param {object} r merchant template ajax response object\n */\n renderMerchantTemplate: function (feedForm, r) {\n let _loop = function _loop(k) {\n if (r.hasOwnProperty(k)) {\n if ('tabs' === k) {\n // noinspection JSUnresolvedFunction\n feedForm.html(r[k]); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html\n } else {\n let contentSettings = $('[name=\"' + k + '\"]');\n\n if (contentSettings.length) {\n contentSettings.each(function() {\n let elem = $(this);\n\n if (elem.is('select')) {\n elem.find('[value=\"' + r[k] + '\"]').prop('selected', true);\n } else if ((elem.is('[type=checkbox]') || elem.is('[type=radio]')) && elem.val() === r[k]) {\n elem.prop('checked', true);\n } else {\n elem.val(r[k]); // type=text\n }\n }).trigger('change');\n }\n }\n }\n };\n\n for (let k in r) {\n _loop(k);\n }\n\n feedEditor.init();\n }\n },\n // Feed Editor Table\n merchantInfoCache = [],\n merchantTemplateCache = [],\n tooltip = () => {\n // Tooltip only Text\n $('.wfmasterTooltip')\n .hover(function () {\n // Hover over code\n let self = $(this), title = self.attr('wftitle');\n self.data('tipText', title).removeAttr('wftitle');\n $('<p class=\"wftooltip\"></p>').text(title).appendTo('body').fadeIn('slow');\n }, function () {\n // Hover out code\n let self = $(this);\n self.attr('wftitle', self.data('tipText'));\n $('.wftooltip').remove();\n })\n .mousemove(function (e) {\n $('.wftooltip').css({\n top: e.pageY + 10,\n left: e.pageX + 20\n });\n });\n },\n clip = () => {\n $copyBtn = $('.toClipboard');\n if (!ClipboardJS.isSupported() || /iPhone|iPad/i.test(navigator.userAgent)) {\n $copyBtn.find('img').hide(0);\n } else {\n $copyBtn.each(function() {\n $(this).on('mouseleave', clearTooltip).on('blur', clearTooltip);\n });\n clipboard = new ClipboardJS('.toClipboard');\n clipboard.on('error', function(event) {\n showTooltip(event.trigger, fallbackMessage(event.action));\n }).on('success', function(event) {\n showTooltip(event.trigger, 'Copied');\n });\n }\n };\n\n /**\n * Feed Generator Module\n */\n class feedGenerator {\n\n /**\n * Constructor\n * @constructor\n */\n constructor() {\n this._feed = opts.generator.feed; // wf_config+xxxx\n this._limit = opts.generator.limit;\n this._progress = 0;\n this._timer = null;\n this._color = false;\n // batch info\n this._total_batch = 0;\n this._current_batch = 0;\n this._product_ids = [];\n this._progress_per_batch = 0;\n this._refresh = true;\n // noinspection JSUnresolvedVariable\n this._regenerate = opts.generator.regenerate;\n window.isRegenerating = false;\n this._all_btn = $('.wpf_regenerate');\n this._current_btn = $(`#${this._feed.replace( 'wf_config', 'wf_feed_' )}`);\n this._current_btn_label = '';\n }\n\n /**\n * Init Hooks (Event)\n * @return {feedGenerator}\n */\n init() {\n let self = this;\n if ( '' !== this._feed && this._regenerate && false === window.isRegenerating ) {\n this.generate();\n }\n\n //thickbox body add feed plugin class to make it unique and custom style\n let current_page_query = window.location.search;\n let params = new URLSearchParams(current_page_query);\n let page_name = params.get(\"page\");\n if( \"webappick-manage-feeds\" === page_name ) {\n $('body').addClass('woo-import-popup-body');\n }\n\n $(document).on('click', '.woo-feed-campaign-close-button', function(event) {\n event.preventDefault();\n\n $(this).parent('.woo-feed-promotion').hide();\n let condition = $(this).data('condition');\n if(1 === condition) {\n wpAjax.post( 'woo_feed_hide_promotion', {\n _ajax_nonce: opts.nonce,\n condition: condition,\n } ).then( response => {\n self._log( response );\n } ).fail( error => {\n self._log( error );\n self._updateProgressStatus( error.message );\n self._color = 'red';\n } );\n }\n });\n\n $(document).on('click', '.wpf_regenerate', function(event) {\n event.preventDefault();\n self._current_btn = $( this );\n if( self._current_btn.hasClass('disabled') || window.isRegenerating === true ) return;\n self._feed = self._current_btn.attr('id').replace( 'wf_feed_', 'wf_config' );\n if( '' !== self._feed ) {\n self.generate();\n }\n });\n return this;\n }\n\n _block_button() {\n if ( this._all_btn.length ) {\n this._all_btn.addClass('disabled');\n }\n if ( this._current_btn.length ) {\n this._current_btn.find('span').addClass('wpf_spin reverse_spin');\n this._current_btn_label = this._current_btn.attr('title');\n // noinspection JSUnresolvedVariable\n this._current_btn.attr( 'aria-label', opts.regenerate ).attr( 'title', opts.regenerate );\n }\n }\n\n _unblock_button() {\n if ( this._all_btn.length ) {\n this._all_btn.removeClass('disabled');\n }\n if ( this._current_btn.length ) {\n this._current_btn.find('span').removeClass('wpf_spin');\n this._current_btn.find('span').removeClass('reverse_spin');\n this._current_btn.attr( 'aria-label', this._current_btn_label ).attr( 'title', this._current_btn_label );\n }\n }\n\n /**\n * Generate Feed\n * @return void\n */\n generate() {\n let self = this;\n window.isRegenerating = true;\n this._block_button();\n this._resetProgressBar();\n this._progressBarActive();\n this._log( 'Counting Total Products' );\n this._updateProgressStatus( 'Fetching products.' );\n this._get_product_ids().then( response => {\n this._progress = 10;\n self._log( {response} );\n if(response.success) {\n self._log( `Total ${response.total} Products found.` );\n self._product_ids = response.product;\n self._total_batch = this._product_ids.length;\n self._current_batch = 0;\n self._progress_per_batch = ( 90 - this._progress ) / this._total_batch;\n self._process_batch();\n self._updateProgressStatus( 'Processing Products...' );\n } else {\n self._updateProgressStatus( response.data.message );\n }\n }).fail( error => {\n self._log( error );\n self._updateProgressStatus( error.message );\n self._color = 'red';\n setTimeout( function(){\n self._stopProgressBar();\n self._unblock_button();\n }, 1500 );\n } );\n }\n\n /**\n * Get Product Ids\n * @returns {$.promise}\n * @private\n */\n _get_product_ids() {\n this._progress = 5;\n return wpAjax.post( 'get_product_information', {\n _ajax_nonce: opts.nonce,\n feed: this._feed,\n limit: this._limit,\n } );\n }\n\n /**\n * Run the Batch\n * @private\n */\n _process_batch() {\n let self = this;\n let status = `Processing Batch ${this._current_batch+1} of ${this._total_batch}`;\n this._updateProgressStatus( status );\n this._log( status );\n wpAjax.post( 'make_batch_feed', {\n _ajax_nonce: opts.nonce,\n feed: this._feed,\n products: this._product_ids[this._current_batch],\n loop: this._current_batch,\n } ).then( response => {\n self._current_batch++;\n self._log( `Batch ${self._current_batch} Completed` );\n self._log( response );\n if ( self._current_batch < self._total_batch ) {\n self._process_batch();\n self._progress += self._progress_per_batch;\n }\n if ( self._current_batch === self._total_batch ) {\n self._save_feed_file();\n }\n } ).fail( error => {\n self._log( error );\n self._updateProgressStatus( error.message );\n self._color = 'red';\n setTimeout( function(){\n self._stopProgressBar();\n self._unblock_button();\n }, 1500 );\n } );\n }\n\n /**\n * Save Feed Data from temp to feed file\n * @private\n */\n _save_feed_file() {\n let self = this;\n this._log( 'Saving feed file' );\n this._updateProgressStatus( 'Saving feed file' );\n wpAjax.post( 'save_feed_file', {\n _ajax_nonce: opts.nonce,\n feed: this._feed,\n } ).then( response => {\n self._log( response );\n self._progress = 100;\n if ( self._refresh ) {\n window.location.href = `${opts.pages.list.feed}&link=${response.url}&cat=${response.cat}`;\n }\n setTimeout( function(){\n self._stopProgressBar();\n setTimeout( function(){\n self._resetProgressBar( true );\n self._unblock_button();\n }, 3000 );\n }, 2500 );\n } ).fail( error => {\n self._log( error );\n self._updateProgressStatus( error.message );\n self._color = 'red';\n setTimeout( function(){\n self._stopProgressBar();\n self._unblock_button();\n }, 1500 );\n } );\n }\n\n /**\n * Console log wrapper with debug settings.\n * @param data\n * @returns {feedGenerator}\n * @private\n */\n _log( data ) {\n // noinspection JSUnresolvedVariable\n if ( opts.wpf_debug ) {\n console.log( data );\n }\n return this;\n }\n\n /**\n * Run the progressbar refresh interval\n * @param {int} refreshInterval\n * @returns {feedGenerator}\n * @private\n */\n _progressBarActive( refreshInterval = 0 ) {\n let self = this;\n this._toggleProgressBar( true );\n this._timer = setInterval( function(){\n self._updateProgressBar();\n }, refreshInterval || 1000 );\n return this;\n }\n\n /**\n * Stop Progressbar\n * @returns {feedGenerator}\n * @private\n */\n _stopProgressBar() {\n clearInterval( this._timer );\n return this;\n }\n\n /**\n * Reset Progressbar\n * @returns {feedGenerator}\n * @private\n */\n _resetProgressBar( update ) {\n this._toggleProgressBar( false );\n this._updateProgressStatus( '' );\n clearInterval( this._timer );\n this._color = false;\n this._timer = null;\n this._progress = 0;\n if ( update ) {\n this._updateProgressBar();\n }\n return this;\n }\n\n /**\n * Show hide the progress bar el\n * @param status\n * @returns {feedGenerator}\n * @private\n */\n _toggleProgressBar( status ) {\n let table = $('#feed_progress_table');\n if ( status ) {\n table.show();\n } else {\n table.hide();\n }\n return this;\n }\n\n /**\n * Update Progress bar text status\n * @param {string} status\n * @returns {feedGenerator}\n * @private\n */\n _updateProgressStatus( status ) {\n $( '.feed-progress-status' ).html( status );\n return this;\n }\n\n _getErrorMessageByCode( error ){\n let progress_message = $( '.feed-progress-status' );\n progress_message.css( {'color':this._color});\n $( '.feed-progress-percentage' ).css( {'color':this._color});\n $( '.wpf_spin' ).css( {'color':this._color});\n\n let message=error.status +' : '+ error.statusText+'. ';\n if(500===error.status){\n message+= \"Please increase your PHP max_execution_time. Please <a target='_blank' href='https://webappick.com/docs/woo-feed/faq-for-woocommerce-product-feed/how-to-solve-processing-10-feed-generation-stuck-error/'>read this doc</a>.\";\n }\n\n this._updateProgressStatus(message);\n\n }\n\n /**\n * Update Progress Data\n * hooked with setInterval\n * @private\n */\n _updateProgressBar() {\n let percentage = $( '.feed-progress-percentage' ),\n bar = $( '.feed-progress-bar-fill' ),\n _progress = `${Math.round( this._progress )}%`;\n bar.css( {\n width: _progress,\n } );\n percentage.text( _progress );\n }\n }\n // expose to the global scope\n window.wf = {\n helper: helper,\n feedEditor: feedEditor,\n generator: feedGenerator,\n };\n\n $(window).on('load', function() {\n // Template loading ui conflict\n if ($(location).attr(\"href\").match(/webappick.*feed/g) !== null) {\n $('#wpbody-content').addClass('woofeed-body-content');\n }\n\n // ClipBoardJS\n clip();\n // postbox toggle\n postboxes.add_postbox_toggles(pagenow);\n // initialize generator\n let generator = new feedGenerator();\n generator.init();\n // noinspection JSUnresolvedVariable\n if( '' !== opts.generator.feed && opts.generator.regenerate ) {\n\n }\n // initialize editor\n feedEditor.init();\n helper.common(); // Generate Feed Add Table Row\n tooltip();\n // validate feed editor\n $(\".generateFeed\").validate();\n\n // document events\n $(document)\n .on('blur', 'input[name=\"wfDAttributeName\"]', function(e) {\n e.preventDefault();\n let attr_name = $(this).val();\n attr_name = attr_name.toLowerCase();\n attr_name = attr_name.split(' ').join('_');\n\n $('#wfDAttributeCode').val(attr_name);\n\n })\n .on('click', '[data-toggle_slide]', function(e) {\n e.preventDefault();\n $($(this).data('toggle_slide')).slideToggle('fast');\n })\n // XML Feed Wrapper\n .on('click', '#wf_newRow', function () {\n let tbody = $('#table-1 tbody'),\n template = $('#feed_config_template').text().trim().replace(/__idx__/g, tbody.find('tr').length);\n tbody.append(template);\n helper.fancySelect($('.outputType'));\n })\n // feed delete alert.\n .on('click', '.single-feed-delete', function (event) {\n event.preventDefault();\n // noinspection JSUnresolvedVariable\n if (confirm(opts.form.del_confirm)) {\n window.location.href = $(this).attr('val');\n }\n })\n // clear cache data.\n .on('click', '.wf_clean_cache_wrapper', function(event) {\n event.preventDefault();\n var nonce = $('.woo-feed-clean-cache-nonce').val();\n var loader = $('.woo-feed-cache-loader');\n\n //show loader\n loader.show();\n\n // passed cache nonce\n wpAjax.post('clear_cache_data', {\n _ajax_clean_nonce: nonce\n }).then(function (response) {\n if( response.success ) {\n loader.hide(); //hide loader\n location.reload();\n }\n }).fail(function () {\n console.log('something wrong');\n });\n\n })// Copy Status\n .on('click', '#woo-feed-copy-status-btn', function(event) {\n event.preventDefault();\n let button = $('#woo-feed-copy-status-btn');\n let status_area = $('#woo-feed-status-area');\n button.val('Copied');\n status_area.css('visibility','visible');\n status_area.select();\n\n document.execCommand('copy');\n })\n // feed value dropdown change.\n .on('change', '.wf_attr.wf_attributes', function(event) {\n event.preventDefault();\n\n $('.fancy-picker-picked').trigger(\"click\"); // trigger fancy select box clicked\n\n // price attributes\n var price_attributes = ['price', 'current_price', 'sale_price', 'price_with_tax', 'current_price_with_tax', 'sale_price_with_tax', 'shipping_cost'];\n // current value\n var current_attribute_value = $(this).val();\n var outputSelect = $(this).parents('tr').find('.outputType');\n var fancyOption = $(this).parents('tr').find('.fancy-picker-content .fancy-picker-option');\n var fancyDataPicker = $(this).parents('tr').find('.fancy-picker-data span');\n var selectIf, selectKey;\n var currency;\n\n // when any attribute is selected, pick the key\n if( price_attributes.includes(current_attribute_value) ) {\n // when select any price attribute\n selectIf = 'for_price';\n selectKey = \"Price\";\n } else if ( \"\" !== current_attribute_value && -1 !== current_attribute_value.indexOf('wf_taxo') ) {\n\n // when select any custom taxonomy\n selectIf = 'for_custom_taxo';\n selectKey = \"parent_if_empty\";\n } else {\n\n selectIf = 'for_all';\n selectKey = 'Default';\n }\n\n // remove selected class from old selected option\n fancyOption.removeClass('selected');\n\n // when value dropdown is selected as price or any custom taxonomy\n if( selectIf === 'for_custom_taxo' || selectIf === 'for_price' ) {\n // update \"Option Type\" when select key matches\n fancyOption.each(function() {\n if( selectKey === $(this).text() ) {\n $(this).addClass('selected');\n fancyDataPicker.text(selectKey);\n outputSelect.find(\"option\").text(selectKey);\n outputSelect.find(\"option\").val( $(this).data('value') );\n }\n });\n\n if( \"for_price\" === selectIf ) {\n var feedCurrency = $('#feedCurrency').val();\n if( \"undefined\" !== typeof feedCurrency && null !== feedCurrency ) {\n currency = feedCurrency;\n }else {\n currency = wpf_ajax_obj.woocommerce.currency;\n }\n\n //for price add currency to the suffix\n $(this).closest(\"tr\").find(\"td:eq(5) input\").val(\" \" + currency);\n }\n\n } else {\n fancyOption.each(function(){\n if( selectKey === $(this).text() ){\n $(this).addClass('selected');\n fancyDataPicker.text(selectKey);\n outputSelect.find(\"option\").text(selectKey);\n outputSelect.find(\"option\").val( $(this).data(\"value\") );\n }\n });\n\n $(this).closest(\"tr\").find(\"td:eq(5) input\").val(\"\");\n }\n\n })\n // bulk delete alert.\n .on('click', '#doaction, #doaction2', function () {\n // noinspection JSUnresolvedVariable\n return confirm(opts.form.del_confirm_multi);\n })\n // Generate Feed Table Row Delete\n .on('change', '.dType', function () {\n let self = $(this),\n type = self.val(),\n row = self.closest('tr');\n\n if (type === 'pattern') {\n row.find('.value_attribute').hide();\n row.find('.value_pattern').show();\n } else if (type === 'attribute') {\n row.find('.value_attribute').show();\n row.find('.value_pattern').hide();\n } else if (type === 'remove') {\n row.find('.value_attribute').hide();\n row.find('.value_pattern').hide();\n }\n })\n // Generate Feed Form Submit\n .on('click', '.delRow', function (e) {\n e.preventDefault();\n $(this).closest('tr').remove();\n helper.reindex_config_table();\n })\n .on('submit', '#generateFeed', function () {\n // Feed Generating form validation\n $(this).validate();\n\n if ($(this).valid()) {\n $(\".makeFeedResponse\")\n .show()\n .html(`<b style=\"color: darkblue;\"><i class=\"dashicons dashicons-sos wpf_spin\"></i> ${opts.form.generate}</b>`); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html, WordPressVIPMinimum.JS.StringConcat.Found\n }\n })\n // Generate Update Feed Form Submit\n .on('submit', '#updatefeed', function (e, data) {\n // Feed Generating form validation\n $(this).validate();\n\n if ($(this).valid()) {\n $(\".makeFeedResponse\")\n .show()\n .html(`<b style=\"color: darkblue;\"><i class=\"dashicons dashicons-sos wpf_spin\"></i> ${data && data.save ? opts.form.save : opts.form.generate}</b>`); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html, WordPressVIPMinimum.JS.StringConcat.Found\n }\n })\n .on( 'ready woo_feed_config_loaded', function(){\n\n if( $('#ftpenabled').val() === '0' ){\n $('.google-merchant-message').hide('slow');\n $('.woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select').attr('disabled','disabled');\n } else {\n if( $('#provider').val() === 'google' ) {\n $('.google-merchant-message').show('slow');\n } else {\n $('.google-merchant-message').hide('slow');\n }\n $('.woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select').removeAttr('disabled');\n }\n\n $('#ftpenabled').on('change', function(){\n if( $('#ftpenabled').val() === '0' ){\n $('.google-merchant-message').hide('slow');\n $('.woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select').attr('disabled','disabled');\n } else {\n\n $('.woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) input, .woo-feed-ftp .ftpconfig tr:not(.ftpcontroller) select').removeAttr('disabled');\n\n // Google merchant specific message\n if( $('#provider').val() === 'google' ){\n $('.google-merchant-message').show('slow');\n } else {\n $('.google-merchant-message').hide('slow');\n }\n\n }\n });\n })\n .on('change', '.ftporsftp', function () {\n let server = $(this).val(),\n status = $('.ssh2_status');\n\n if (server === 'sftp') {\n // noinspection JSUnresolvedVariable\n status.show().css('color', 'dodgerblue').text(opts.form.sftp_checking);\n wpAjax.post('get_ssh2_status', {\n _ajax_nonce: opts.nonce,\n server: server\n }).then(function (response) {\n if (response === 'exists') {\n // noinspection JSUnresolvedVariable\n status.css('color', '#2CC185').text(opts.form.sftp_available);\n setTimeout(function () {\n status.hide();\n }, 1500);\n } else {\n // noinspection JSUnresolvedVariable\n status.show().css('color', 'red').text(opts.form.sftp_warning);\n }\n }).fail(function (e) {\n status.hide();\n helper.ajax_fail(e);\n });\n } else {\n status.hide();\n }\n })\n .on('click', '[name=\"save_feed_config\"]', function (e) {\n e.preventDefault();\n $('#updatefeed').trigger('submit', {\n save: true\n });\n })\n .on('change', '#provider', function (event) {\n event.preventDefault();\n\n let merchant = $(this).val(),\n templateName = $(this).find(':selected').text(),\n name = $('#filename').val(),\n feedType = $(\"#feedType\"),\n feedForm = $(\"#providerPage\"),\n merchantInfo = $('#feed_merchant_info'); // set loading..\n\n // noinspection JSUnresolvedVariable\n feedForm.html('<h3><span style=\"float:none;margin: -3px 0 0;\" class=\"spinner is-active\"></span> ' + opts.form.loading_tmpl + '</h3>'); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html, WordPressVIPMinimum.JS.StringConcat.Found\n\n merchantInfo.find('.spinner').addClass('is-active');\n feedType.disabled(!0); // disable dropdown\n\n feedType.parent().find('.spinner').addClass('is-active');\n merchantInfo.find('.merchant-info-section .data').html(''); // remove previous data\n // Get Merchant info for selected Provider/Merchant\n\n if (merchantInfoCache.hasOwnProperty(merchant)) {\n feedEditor.renderMerchantInfo(merchantInfo, feedType, merchantInfoCache[merchant]);\n\n /**\n * Triggers after merchant configuration is fetched & loaded\n * */\n $(document).trigger('woo_feed_config_loaded');\n\n } else {\n wpAjax.send('woo_feed_get_merchant_info', {\n type: 'GET',\n data: {\n nonce: opts.nonce,\n provider: merchant,\n templateName: templateName\n }\n }).then(function (r) {\n merchantInfoCache[merchant] = r;\n feedEditor.renderMerchantInfo(merchantInfo, feedType, r);\n }).then(function(){\n\n /**\n * Triggers after merchant configuration is fetched & loaded\n * */\n $(document).trigger('woo_feed_config_loaded');\n\n }).fail(helper.ajax_fail);\n } // Get FeedForm For Selected Provider/Merchant\n\n\n if (merchantTemplateCache.hasOwnProperty(merchant)) {\n feedEditor.renderMerchantTemplate(feedForm, merchantTemplateCache[merchant]);\n\n /**\n * Triggers after merchant configuration is fetched & loaded\n * */\n $(document).trigger('woo_feed_config_loaded');\n\n } else {\n wpAjax.post('get_feed_merchant', {\n _ajax_nonce: opts.nonce,\n merchant: merchant\n }).then(function (r) {\n merchantTemplateCache[merchant] = r;\n feedEditor.renderMerchantTemplate(feedForm, r);\n $('#utm_source').val(templateName);\n $('#utm_campaign').val(name);\n //when merchant is bing, change delimiter and enclosure\n if( 'bing' === merchant ) {\n //delimiter value\n $(\"#delimiter option\").removeAttr('selected');\n $(\"#delimiter option[value=\\\"tab\\\"]\").attr('selected', 'selected');\n\n //enclosure value\n $(\"#enclosure option\").removeAttr('selected');\n $(\"#enclosure option[value=\\\" \\\"]\").attr('selected', 'selected');\n }\n\n //reviewer options hide\n if( 'google_product_review' !== merchant) {\n $('.wf_attributes option[value=\"reviewer_name\"]').hide();\n }\n }).then(function(){\n\n /**\n * Triggers after merchant configuration is fetched & loaded\n * */\n $(document).trigger('woo_feed_config_loaded');\n\n }).fail(helper.ajax_fail);\n }\n })\n // Feed Active and Inactive status change via ajax\n .on('change', '.woo_feed_status_input', function () {\n let self = $(this);\n wpAjax.post('update_feed_status', {\n _ajax_nonce: opts.nonce,\n feedName: self.val(),\n status: self[0].checked ? 1 : 0\n });\n });\n // event with trigger\n $(document)\n .on('change', '[name=\"is_outOfStock\"], [name=\"product_visibility\"]', function () {\n let outOfStockVisibilityRow = $('.out-of-stock-visibility');\n if ($('[name=\"is_outOfStock\"]:checked').val() === 'n' && $('[name=\"product_visibility\"]:checked').val() === '1') {\n outOfStockVisibilityRow.show();\n } else {\n outOfStockVisibilityRow.hide();\n }\n })\n .on('change', '.attr_type', function () {\n // Attribute type selection\n let self = $(this),\n type = self.val(),\n row = self.closest('tr');\n\n if (type === 'pattern') {\n row.find('.wf_attr').hide();\n row.find('.wf_attr').val('');\n row.find('.wf_default').show();\n } else {\n row.find('.wf_attr').show();\n row.find('.wf_default').hide();\n row.find('.wf_default').val('');\n }\n })\n .on('change', '.wf_mattributes, .attr_type', function () {\n let row = $(this).closest('tr'),\n attribute = row.find('.wf_mattributes'),\n type = row.find('.attr_type'),\n valueColumn = row.find('td:eq(4)'),\n provider = $('#provider').val();\n\n // noinspection JSUnresolvedVariable\n if (opts.form.google_category.hasOwnProperty(attribute.val()) && type.val() === 'pattern' && helper.in_array(provider, opts.form.google_category[attribute.val()])) {\n if (valueColumn.find('select.selectize').length === 0) {\n valueColumn.find('input.wf_default').remove();\n valueColumn.append('<span class=\"wf_default wf_attributes\"><select name=\"default[]\" class=\"selectize\"></select></span>');\n // noinspection JSUnresolvedVariable\n valueColumn.append(`<span style=\"font-size:x-small;\"><a style=\"color: red\" href=\"https://webappick.com/docs/woo-feed/feed-configuration/how-to-map-store-category-with-merchant-category/\" target=\"_blank\">${opts.learn_more}</a></span>`);\n\n if (!googleCategories || !facebookCategories) {\n valueColumn.append('<span class=\"spinner is-active\" style=\"margin: 0;\"></span>');\n }\n\n let select = valueColumn.find('.wf_attributes select');\n // noinspection JSUnresolvedVariable\n helper.selectize(select, {\n preload: true,\n placeholder: opts.form.select_category,\n load: function load(query, cb) {\n if (!googleCategories) {\n wpAjax.send('get_google_categories', {\n type: 'GET',\n data: {\n _ajax_nonce: opts.nonce,\n action: \"get_google_categories\",\n provider: provider\n }\n }).then(function (r) {\n googleCategories = r;\n cb(googleCategories);\n valueColumn.find('.spinner').remove();\n }).fail(helper.ajax_fail);\n } else {\n cb(googleCategories);\n }\n\n //for facebook product category merchant attribute\n if (!facebookCategories && \"facebook\" === provider && \"fb_product_category\" === attribute.val()) {\n wpAjax.send('get_facebook_categories', {\n type: 'GET',\n data: {\n _ajax_nonce: opts.nonce,\n action: \"get_facebook_categories\",\n provider: provider\n }\n }).then(function (r) {\n facebookCategories = r;\n cb(facebookCategories);\n valueColumn.find('.spinner').remove();\n }).fail(helper.ajax_fail);\n } else {\n cb(facebookCategories);\n }\n }\n });\n }\n } else {\n if ( attribute.val() !== 'current_category' && valueColumn.find('input.wf_default').length === 0) {\n valueColumn.find('span').remove();\n valueColumn.append('<input autocomplete=\"off\" class=\"wf_default wf_attributes\" type=\"text\" name=\"default[]\" value=\"\">');\n\n if (type.val() !== 'pattern') {\n valueColumn.find('input.wf_default').hide();\n }\n }\n }\n })\n .on('change', '#feedType,#provider', function (e) {\n let type = $('#feedType').val(),\n provider = $('#provider').val(),\n itemWrapper = $('.itemWrapper'),\n wf_csv_txt = $('.wf_csvtxt');\n\n // noinspection JSUnresolvedVariable\n if (type !== '' && helper.in_array(provider, opts.form.item_wrapper_hidden)) {\n itemWrapper.hide();\n }\n\n //when feed type is changed\n if( 'feedType' === e.target.id ) {\n if (type === 'csv' || type === 'txt' || type === 'tsv') {\n wf_csv_txt.show();\n itemWrapper.hide();\n \n if( 'tsv' === type ) {\n $('#delimiter option:last').prop(\"selected\", \"selected\");\n } else if( 'csv' === type ) {\n $('#delimiter option:first').prop(\"selected\", \"selected\");\n }\n } else if( 'xml' === type && \"custom\" === provider ) {\n itemWrapper.show();\n wf_csv_txt.hide();\n } else if( 'json' === type ) {\n wf_csv_txt.hide();\n }\n }\n\n // when template is not custom template 1 hide the item wrapper\n if( \"custom\" !== provider ) {\n itemWrapper.hide();\n }\n\n })\n .trigger('change');\n\n\n $(document)\n\t\t\t.on('click', '.woofeed-custom-fields [id*=\"-switcher\"]', function () {\n\t\t\t $(this).closest('td').find('.switch-loader').show();\n\t\t\t\tlet field = $(this).attr( 'id' ).split( '-' )[0],\n\t\t\t\t\tisTaxonomy = $(this).data( 'taxonomy' ),\n\t\t\t\t\tstatus = $(this).prop( 'checked' );\n\t\t\t\tnew WooFeedCustomFields( field, status, isTaxonomy );\n\n\t\t\t})\n\n\t\t\t// Remove sticky cart on feature page\n\t\t\t.ready(function() {\n\t\t\t\tvar s = $(\".wapk-feed-buy-now-container\");\n\t\t\t\t$(window).scroll(function() {\n\t\t\t\t\tvar windowpos = $(window).scrollTop();\n\t\t\t\t\tif ( windowpos <= 5000 ) {\n\t\t\t\t\t\ts.addClass(\"fixed\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts.removeClass(\"fixed\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n });\n\n $(document)\n\t\t.on('click', '#woo-feed-debug-log-download', function (e) {\n\t\t\te.preventDefault();\n\t\t\t$(\"<a />\", {\n\t\t\t\tdownload: new Date() + \".log\",\n\t\t\t\thref: URL.createObjectURL(\n\t\t\t\t\tnew Blob([$(\"#woo-feed-debug-log\").val()], {\n\t\t\t\t\t\ttype: \"text/plain\"\n\t\t\t\t\t})),\n\t\t\t}).appendTo(\"body\")[0].click();\n\t\t})\n\t\t.on('keyup', '#filename', function() {\n\t\t\tvar name = $('#filename').val();\n\t\t\t$('#utm_campaign').val(name);\n\t\t})\n\n .on('click', '.wf-tab-name', function(e) {\n $('.wf-tab-name.activate').removeClass('activate');\n $(this).addClass('activate');\n\n let for_attr = $(this).attr('for');\n $('.wf_tabs li.active').removeClass('active');\n $('.wf_tabs .wf-tab-content#' + for_attr).parent().addClass('active');\n })\n\n\t\t.on('change', '#category-mapping-form #providers', function() {\n\t\t\tvar provider = $(this).find(':selected').val(),\n\t\t\t\tgoogleMap = ['google', 'facebook', 'pinterest', 'bing', 'bing_local_inventory', 'snapchat'];\n\t\t\tif( googleMap.indexOf(provider) !== -1 ) {\n\t\t\t\t$('input[id*=\"cat_mapping_\"]').css('display', 'none');\n\t\t\t\t$('.wf_default.wf_attributes').css('display', 'block').css('width', '100%');\n\n var cat_init = new WooFeedFeedCategories();\n if( \"facebook\" === provider ) {\n cat_init.wooFeed_get_facebook_categories();\n }else {\n cat_init.wooFeed_get_google_categories();\n }\n\n } else {\n\t\t\t\t$('input[id*=\"cat_mapping_\"]').css('display', 'block');\n\t\t\t\t$('.wf_default.wf_attributes').css('display', 'none').css('width', '100%');\n\t\t\t}\n\t\t})\n\n // Copy parent category ids to child categories.\n\t\t.on('click', 'span[id*=\"cat-map-\"]', function(e) {\n\t\t\te.preventDefault();\n\t\t\tvar providerName = $('#category-mapping-form #providers').val(),\n\t\t\t\tgoogleMap = ['google', 'facebook', 'pinterest', 'bing', 'bing_local_inventory', 'snapchat'],\n\t\t\t\tcatId = $(this).attr('id').replace(/[^\\d.]/g, ''),\n\t\t\t\tgroupId = 'group-child-' + catId;\n\n\t\t\tif( googleMap.indexOf(providerName) !== -1) {\n\t\t\t\tvar catField = $(this).parents('tr').find('.selectized').val();\n\n\t\t\t\tif (catField) {\n\t\t\t\t\t$('.' + groupId).parents('tr').find('select').each(function (i, v) {\n\t\t\t\t\t\t$(v).data('selectize').setValue(catField);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tvar value = $('#cat_mapping_'+catId).val();\n\t\t\t\t$('.'+groupId).parents('tr').find('input').val(value);\n\t\t\t}\n\n\t\t});\n\n $(document).ready(function () {\n var provider = $(\"#providers\").val();\n var cat_init = new WooFeedFeedCategories();\n\n if( \"facebook\" === provider ) {\n cat_init.wooFeed_get_facebook_categories();\n } else {\n cat_init.wooFeed_get_google_categories();\n }\n\n });\n\n /*\n * Issue fix for feed edit page unsupported `Feed Type` not disabling\n *\n * @since 4.4.22\n * */\n $(document).on( \"feed_editor_init\", function(){\n\n let types = $('.merchant-info-section.feed_file_type .data').html().split(\",\").map(function(t) {\n return t.trim().toLowerCase();\n });\n\n let feedType = $(\"#feedType\");\n\n if (types.length) {\n feedType.find('option').each(function() {\n let opt = $(this);\n opt.val() && !helper.in_array(opt.val(), types) ? opt.disabled(!0) : opt.disabled(!1);\n });\n if (types.length === 1) feedType.find('option[value=\"' + types[0] + '\"]').attr('selected', 'selected');\n } else feedType.find('option').disabled(!1);\n\n } );\n\n /**\n * Automatically adding postfix for corresponding attribute selection.\n *\n * @since 4.4.32\n */\n $(document).on('ready', function(){\n\n function update_postfix(){\n var attribute_list = {\n\n 'price': wpf_ajax_obj.woocommerce.currency,\n 'current_price': wpf_ajax_obj.woocommerce.currency,\n 'sale_price': wpf_ajax_obj.woocommerce.currency,\n 'price_with_tax': wpf_ajax_obj.woocommerce.currency,\n 'current_price_with_tax': wpf_ajax_obj.woocommerce.currency,\n 'sale_price_with_tax': wpf_ajax_obj.woocommerce.currency,\n\n\n 'weight': wpf_ajax_obj.woocommerce.weight,\n 'weight_unit': wpf_ajax_obj.woocommerce.weight,\n\n\n 'height': wpf_ajax_obj.woocommerce.dimension,\n 'length': wpf_ajax_obj.woocommerce.dimension,\n 'width': wpf_ajax_obj.woocommerce.dimension\n\n };\n\n if (typeof wpf_ajax_obj.feed_rules !== 'undefined' && wpf_ajax_obj.feed_rules !== null) {\n var feed_rules = wpf_ajax_obj.feed_rules;\n var current_feed_currency = feed_rules.feedCurrency;\n }\n\n //get current action name of the page\n var queryString = window.location.search;\n var urlParams = new URLSearchParams(queryString);\n var action = urlParams.get('action');\n\n $( '.wf_attr.wf_attributes' ).each( function( key, value){\n\n var attribute_value = $(value).val();\n var current_Value = $( 'input[name^=\"suffix\"]' ).eq( parseInt( key ) ).val();\n\n if( -1 !== $.inArray( current_Value, [\n ' ' + wpf_ajax_obj.woocommerce.currency,\n ' ' + wpf_ajax_obj.woocommerce.weight,\n ' ' + wpf_ajax_obj.woocommerce.dimension\n ] ) ){\n $( 'input[name^=\"suffix\"]' ).eq( parseInt( key ) ).val('');\n }\n\n $.each(attribute_list, function (_key, _value){\n if( attribute_value === _key ){\n _value = null !== current_feed_currency && \"undefined\" !== typeof current_feed_currency ? current_feed_currency : _value;\n\n if( \"undefined\" !== action && \"edit-feed\" !== action ) {\n $( 'input[name^=\"suffix\"]' ).eq( parseInt( key ) ).val( ' ' + _value );\n } else {\n $( 'input[name^=\"suffix\"]' ).eq( parseInt( key ) ).val( current_Value );\n }\n\n }\n });\n } );\n\n $(document).trigger( 'feedEditor.after.free.postfix.update' );\n }\n\n $(document).on('feedEditor.init', function(){\n update_postfix();\n });\n\n });\n\n})(jQuery, window, document, wp.ajax, wpf_ajax_obj);\n"]}
admin/partials/woo-feed-edit-config.php CHANGED
@@ -77,7 +77,7 @@ if ( ! defined( 'ABSPATH' ) ) {
77
  </span>
78
  <span style="font-size:x-small;"><a style="color: red" href="http://webappick.helpscoutdocs.com/article/19-how-to-map-store-category-with-merchant-category" target="_blank">Learn More..</a></span>
79
  <?php } else { ?>
80
- <input <?php echo ( 'pattern' == $attr_type[ $k ] ) ? '' : 'style=" display: none;"'; ?>autocomplete="off" class="wf_default wf_attributes " type="text" name="default[<?php echo esc_attr( $k ); ?>]" value="<?php echo esc_attr( $default[ $k ] ); ?>"/>
81
  <?php } ?>
82
  </td>
83
  <td>
77
  </span>
78
  <span style="font-size:x-small;"><a style="color: red" href="http://webappick.helpscoutdocs.com/article/19-how-to-map-store-category-with-merchant-category" target="_blank">Learn More..</a></span>
79
  <?php } else { ?>
80
+ <input <?php echo ( 'pattern' == $attr_type[$k] ) ? '' : 'style=" display: none;"'; ?>autocomplete="off" class="wf_default wf_attributes " type="text" name="default[<?php echo esc_attr( $k ); ?>]" value="<?php echo isset($default[ $k ]) ? esc_attr( $default[ $k ] ) : ""; ?>"/>
81
  <?php } ?>
82
  </td>
83
  <td>
includes/classes/class-woo-feed-constants.php CHANGED
@@ -22,7 +22,7 @@ class Woo_Feed_Constants {
22
  * @var string
23
  * @since 3.1.6
24
  */
25
- define( 'WOO_FEED_FREE_VERSION', '4.4.41' );
26
  }
27
 
28
  if ( ! defined( 'WOO_FEED_FREE_PATH' ) ) {
22
  * @var string
23
  * @since 3.1.6
24
  */
25
+ define( 'WOO_FEED_FREE_VERSION', '4.4.42' );
26
  }
27
 
28
  if ( ! defined( 'WOO_FEED_FREE_PATH' ) ) {
includes/classes/class-woo-feed-shipping.php CHANGED
@@ -32,6 +32,11 @@ class Woo_Feed_Shipping {
32
  */
33
  private $config;
34
 
 
 
 
 
 
35
  public function __construct( $product, $feed_config ) {
36
  $this->config = $feed_config;
37
  $this->product = $product;
@@ -40,6 +45,9 @@ class Woo_Feed_Shipping {
40
  $this->feed_country = $this->set_country();
41
  $this->settings = woo_feed_get_options( 'all' );
42
  $this->currency = $this->get_currency();
 
 
 
43
  }
44
 
45
 
@@ -429,8 +437,8 @@ class Woo_Feed_Shipping {
429
  if ('pattern' == $this->config['type'][$m_key]) {
430
  $attributeValue = $this->config['default'][$m_key];
431
  } else { // Get Attribute value
432
- $v3 = new Woo_Feed_Products_v3($this->config);
433
- $attributeValue = $v3->getAttributeValueByType($this->product, $this->config['attributes'][$m_key], $this->config['mattributes'][$m_key]);
434
  }
435
  } else {
436
  $attributeValue = isset($this->config['default'][ $m_key ]) ? $this->config['default'][ $m_key ] : "";
32
  */
33
  private $config;
34
 
35
+ /**
36
+ * @var mixed $obj_v3 Contain free version v3 object.
37
+ */
38
+ public $obj_v3;
39
+
40
  public function __construct( $product, $feed_config ) {
41
  $this->config = $feed_config;
42
  $this->product = $product;
45
  $this->feed_country = $this->set_country();
46
  $this->settings = woo_feed_get_options( 'all' );
47
  $this->currency = $this->get_currency();
48
+ //v3 object
49
+ $obj_v3 = new Woo_Feed_Products_v3($this->config);
50
+ $this->obj_v3 = apply_filters("woo_feed_filter_object_v3", $obj_v3);
51
  }
52
 
53
 
437
  if ('pattern' == $this->config['type'][$m_key]) {
438
  $attributeValue = $this->config['default'][$m_key];
439
  } else { // Get Attribute value
440
+ $attributeValue = $this->obj_v3->getAttributeValueByType($this->product, $this->config['attributes'][$m_key], $this->config['mattributes'][$m_key]);
441
+ $attributeValue = apply_filters("woo_feed_get_attribute_value_for_shipping", $attributeValue, $this->product, $this->config['attributes'][$m_key], $this->config['mattributes'][$m_key]);
442
  }
443
  } else {
444
  $attributeValue = isset($this->config['default'][ $m_key ]) ? $this->config['default'][ $m_key ] : "";
includes/helper.php CHANGED
@@ -3717,7 +3717,7 @@ if (!function_exists('woo_feed_brand_term_radio_checklist')) {
3717
  add_filter('wp_terms_checklist_args', 'woo_feed_brand_term_radio_checklist');
3718
  }
3719
 
3720
- if (!function_exists('woo_feed_product_structured_data')) {
3721
 
3722
  $settings = woo_feed_get_options('all');
3723
  $overridden_structured_data = $settings['overridden_structured_data'];
@@ -3731,212 +3731,41 @@ if (!function_exists('woo_feed_product_structured_data')) {
3731
  * @param $markup
3732
  * @param $product
3733
  *
3734
- * @return false
3735
  * @since 4.3.6
3736
  */
3737
  function woo_feed_filter_woocommerce_structured_data_product($markup, $product)
3738
  {
3739
- return false;
3740
- }
3741
-
3742
- add_filter('woocommerce_structured_data_product', 'woo_feed_filter_woocommerce_structured_data_product', 10, 2);
3743
 
 
 
3744
 
3745
- /**
3746
- * Product Structured data
3747
- */
3748
- function woo_feed_product_structured_data() {
3749
-
3750
- if (is_product()) {
3751
- global $post;
3752
- $product = wc_get_product($post->ID);
3753
 
3754
- if (!is_object($product)) {
3755
- global $product;
3756
- }
3757
-
3758
- if (!is_a($product, 'WC_Product')) {
3759
- return;
3760
- }
3761
-
3762
- $shop_name = get_bloginfo('name');
3763
- $shop_url = home_url();
3764
- $currency = get_woocommerce_currency();
3765
- $permalink = get_permalink($product->get_id());
3766
- $description = apply_filters('woo_feed_schema_description', wp_strip_all_tags($product->get_short_description() ? $product->get_short_description() : $product->get_description()), $product);
3767
- $image = wp_get_attachment_url($product->get_image_id());
3768
- $mpn = $product->get_meta('woo_feed_mpn');
3769
- $settings = woo_feed_get_options('all');
3770
- $disable_mpn = $settings['disable_mpn'];
3771
- $disable_brand = $settings['disable_brand'];
3772
- if ('enable' === $disable_brand) {
3773
- $brand_term = wp_get_post_terms($post->ID, 'woo-feed-brand', array('fields' => 'names'));
3774
- }
3775
-
3776
- $markup = array(
3777
- '@context' => 'https://schema.org',
3778
- '@type' => 'Product',
3779
- '@id' => $permalink . '#product',
3780
- // Append '#product' to differentiate between this @id and the @id generated for the Breadcrumblist.
3781
- 'name' => $product->get_name(),
3782
- 'url' => $permalink,
3783
- 'description' => $description,
3784
- );
3785
- if ($image) {
3786
- $markup['image'] = $image;
3787
- }
3788
- // Declare SKU or fallback to ID.
3789
- if ($product->get_sku()) {
3790
- $markup['sku'] = $product->get_sku();
3791
- } else {
3792
- $markup['sku'] = $product->get_id();
3793
- }
3794
- if ('' !== $product->get_price()) {
3795
- // Assume prices will be valid until the end of next year, unless on sale and there is an end date.
3796
- $price_valid_until = gmdate('Y-12-31', time() + YEAR_IN_SECONDS);
3797
- if ($product->is_type('variable')) {
3798
- $lowest = $product->get_variation_price('min', false);
3799
- $highest = $product->get_variation_price('max', false);
3800
-
3801
-
3802
- // If woocommerce tax enabled & Product is taxable
3803
- if ($product->is_taxable()) {
3804
- $highest = apply_filters('woo_feed_filter_product_sale_price_with_tax', $highest, $product, [], false);
3805
- $lowest = apply_filters('woo_feed_filter_product_sale_price_with_tax', $lowest, $product, [], false);
3806
- $lowest = woo_feed_get_price_with_tax($lowest, $product);
3807
- $highest = woo_feed_get_price_with_tax($highest, $product);
3808
- } else {
3809
- $highest = apply_filters('woo_feed_filter_product_sale_price', $highest, $product, [], false);
3810
- $lowest = apply_filters('woo_feed_filter_product_sale_price', $lowest, $product, [], false);
3811
- }
3812
-
3813
- if ($lowest === $highest) {
3814
- $markup_offer = array(
3815
- '@type' => 'Offer',
3816
- 'price' => wc_format_decimal($lowest, wc_get_price_decimals()),
3817
- 'priceValidUntil' => $price_valid_until,
3818
- 'priceSpecification' => array(
3819
- 'price' => wc_format_decimal($lowest, wc_get_price_decimals()),
3820
- 'priceCurrency' => $currency,
3821
- 'valueAddedTaxIncluded' => (wc_tax_enabled() && $product->is_taxable()) ? 'true' : 'false',
3822
- ),
3823
- );
3824
- } else {
3825
- $markup_offer = array(
3826
- '@type' => 'AggregateOffer',
3827
- 'lowPrice' => wc_format_decimal($lowest, wc_get_price_decimals()),
3828
- 'highPrice' => wc_format_decimal($highest, wc_get_price_decimals()),
3829
- 'offerCount' => count($product->get_children()),
3830
- );
3831
- }
3832
- } else {
3833
- if ($product->is_on_sale() && $product->get_date_on_sale_to()) {
3834
- $price_valid_until = gmdate('Y-m-d', $product->get_date_on_sale_to()->getTimestamp());
3835
- }
3836
-
3837
- /*
3838
- * If woocommerce tax enabled & Product is taxable
3839
- */
3840
- if ($product->is_taxable()) {
3841
- $price = apply_filters('woo_feed_filter_product_sale_price_with_tax',$product->get_price(),$product,[],true);
3842
- $price = woo_feed_get_price_with_tax($price, $product);
3843
- } else {
3844
- $price = apply_filters('woo_feed_filter_product_sale_price',$product->get_price(),$product,[],false);
3845
- }
3846
- #########################################
3847
-
3848
- $markup_offer = array(
3849
- '@type' => 'Offer',
3850
- 'price' => wc_format_decimal($price, wc_get_price_decimals()),
3851
- 'priceValidUntil' => $price_valid_until,
3852
- 'priceSpecification' => array(
3853
- 'price' => wc_format_decimal($price, wc_get_price_decimals()),
3854
- 'priceCurrency' => $currency,
3855
- 'valueAddedTaxIncluded' => (wc_tax_enabled() && $product->is_taxable()) ? 'true' : 'false',
3856
- ),
3857
- );
3858
- }
3859
- $markup_offer += array(
3860
- 'priceCurrency' => $currency,
3861
- 'availability' => 'http://schema.org/' . ($product->is_in_stock() ? 'InStock' : 'OutOfStock'),
3862
- 'url' => $permalink,
3863
- 'seller' => array(
3864
- '@type' => 'Organization',
3865
- 'name' => $shop_name,
3866
- 'url' => $shop_url,
3867
- ),
3868
- );
3869
- $markup['offers'] = array(apply_filters('woocommerce_structured_data_product_offer', $markup_offer, $product));
3870
- }
3871
- if ($product->get_rating_count() && wc_review_ratings_enabled()) {
3872
- $markup['aggregateRating'] = array(
3873
- '@type' => 'AggregateRating',
3874
- 'ratingValue' => $product->get_average_rating(),
3875
- 'reviewCount' => $product->get_review_count(),
3876
- );
3877
- // Markup 5 most recent rating/review.
3878
- $comments = get_comments(
3879
- array(
3880
- 'number' => 5,
3881
- 'post_id' => $product->get_id(),
3882
- 'status' => 'approve',
3883
- 'post_status' => 'publish',
3884
- 'post_type' => 'product',
3885
- 'parent' => 0,
3886
- 'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
3887
- array(
3888
- 'key' => 'rating',
3889
- 'type' => 'NUMERIC',
3890
- 'compare' => '>',
3891
- 'value' => 0,
3892
- ),
3893
- ),
3894
- )
3895
- );
3896
- if ($comments) {
3897
- $markup['review'] = array();
3898
- foreach ($comments as $comment) {
3899
- $markup['review'][] = array(
3900
- '@type' => 'Review',
3901
- 'reviewRating' => array(
3902
- '@type' => 'Rating',
3903
- 'bestRating' => '5',
3904
- 'ratingValue' => get_comment_meta($comment->comment_ID, 'rating', true),
3905
- 'worstRating' => '1',
3906
- ),
3907
- 'author' => array(
3908
- '@type' => 'Person',
3909
- 'name' => get_comment_author($comment),
3910
- ),
3911
- 'reviewBody' => get_comment_text($comment),
3912
- 'datePublished' => get_comment_date('c', $comment),
3913
- );
3914
- }
3915
- }
3916
- }
3917
- // Check we have required data.
3918
- if (empty($markup['aggregateRating']) && empty($markup['offers']) && empty($markup['review'])) {
3919
- return;
3920
- }
3921
-
3922
- // Check if we have mpn data.
3923
- if ('enable' === $disable_mpn && !empty($mpn)) {
3924
- $markup['mpn'] = $mpn;
3925
- }
3926
-
3927
- // Check if we have brand data.
3928
- if ('enable' === $disable_brand && !is_wp_error($brand_term)) {
3929
- if (isset($brand_term[0])) {
3930
- $markup['brand'] = $brand_term[0];
3931
  }
3932
  }
 
3933
 
3934
- echo '<script type="application/ld+json">' . json_encode($markup, JSON_UNESCAPED_SLASHES) . '</script>'; //encode schema for job posting
 
 
 
3935
  }
3936
 
 
 
 
3937
  }
3938
 
3939
- add_action('wp_head', 'woo_feed_product_structured_data');
 
3940
  }
3941
  }
3942
 
3717
  add_filter('wp_terms_checklist_args', 'woo_feed_brand_term_radio_checklist');
3718
  }
3719
 
3720
+ if (!function_exists('woo_feed_filter_woocommerce_structured_data_product')) {
3721
 
3722
  $settings = woo_feed_get_options('all');
3723
  $overridden_structured_data = $settings['overridden_structured_data'];
3731
  * @param $markup
3732
  * @param $product
3733
  *
3734
+ * @return array $markup
3735
  * @since 4.3.6
3736
  */
3737
  function woo_feed_filter_woocommerce_structured_data_product($markup, $product)
3738
  {
3739
+ $settings = woo_feed_get_options('all');
3740
+ $disable_mpn = $settings['disable_mpn'];
3741
+ $disable_brand = $settings['disable_brand'];
 
3742
 
3743
+ $description = apply_filters('woo_feed_schema_description', wp_strip_all_tags($product->get_short_description() ? $product->get_short_description() : $product->get_description()), $product);
3744
+ $markup["description"] = $description;
3745
 
3746
+ if ('enable' === $disable_brand) {
3747
+ $brand_term = wp_get_post_terms($product->get_id(), 'woo-feed-brand', array('fields' => 'names'));
 
 
 
 
 
 
3748
 
3749
+ if (!is_wp_error($brand_term)) {
3750
+ if ( isset($brand_term[0]) ) {
3751
+ $markup['brand']["name"] = $brand_term[0];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3752
  }
3753
  }
3754
+ }
3755
 
3756
+ // Check if we have mpn data.
3757
+ if ('enable' === $disable_mpn && !empty($mpn)) {
3758
+ $mpn = $product->get_meta('woo_feed_mpn');
3759
+ $markup['mpn'] = $mpn;
3760
  }
3761
 
3762
+ $markup = apply_filters("woo_feed_after_wc_product_structured_data", $markup, $product);
3763
+
3764
+ return $markup;
3765
  }
3766
 
3767
+ add_filter('woocommerce_structured_data_product', 'woo_feed_filter_woocommerce_structured_data_product', 10, 2);
3768
+
3769
  }
3770
  }
3771
 
languages/woo-feed.pot CHANGED
@@ -16,7 +16,7 @@ msgstr ""
16
  msgid "Unauthorized Action."
17
  msgstr ""
18
 
19
- #: woo-feed.php:141, woo-feed.php:260, includes/helper.php:853, includes/helper.php:1904, includes/helper.php:2949, includes/helper.php:2978, includes/helper.php:3370, includes/helper.php:3568, includes/helper.php:3596, includes/helper.php:5008, includes/helper.php:5517
20
  msgid "Invalid Request."
21
  msgstr ""
22
 
@@ -709,31 +709,31 @@ msgstr ""
709
  msgid "Choose from the most used"
710
  msgstr ""
711
 
712
- #: includes/helper.php:4696
713
  msgid "Option Successfully Added."
714
  msgstr ""
715
 
716
- #: includes/helper.php:4687
717
  msgid "Option Already Added."
718
  msgstr ""
719
 
720
- #: includes/helper.php:5422
721
  msgid "Delivery up to 30 days"
722
  msgstr ""
723
 
724
- #: includes/helper.php:5420
725
  msgid "Delivery 1 to 3 days"
726
  msgstr ""
727
 
728
- #: includes/helper.php:5525
729
  msgid "Feed data is empty. Can't duplicate feed."
730
  msgstr ""
731
 
732
- #: includes/helper.php:5541
733
  msgid "Unable to save the duplicate feed data."
734
  msgstr ""
735
 
736
- #: includes/helper.php:5551
737
  msgid "Feed Successfully Duplicated, but unable to generate the data file. Please click the \"Regenerate Button\""
738
  msgstr ""
739
 
16
  msgid "Unauthorized Action."
17
  msgstr ""
18
 
19
+ #: woo-feed.php:141, woo-feed.php:260, includes/helper.php:853, includes/helper.php:1904, includes/helper.php:2949, includes/helper.php:2978, includes/helper.php:3370, includes/helper.php:3568, includes/helper.php:3596, includes/helper.php:4837, includes/helper.php:5346
20
  msgid "Invalid Request."
21
  msgstr ""
22
 
709
  msgid "Choose from the most used"
710
  msgstr ""
711
 
712
+ #: includes/helper.php:4525
713
  msgid "Option Successfully Added."
714
  msgstr ""
715
 
716
+ #: includes/helper.php:4516
717
  msgid "Option Already Added."
718
  msgstr ""
719
 
720
+ #: includes/helper.php:5251
721
  msgid "Delivery up to 30 days"
722
  msgstr ""
723
 
724
+ #: includes/helper.php:5249
725
  msgid "Delivery 1 to 3 days"
726
  msgstr ""
727
 
728
+ #: includes/helper.php:5354
729
  msgid "Feed data is empty. Can't duplicate feed."
730
  msgstr ""
731
 
732
+ #: includes/helper.php:5370
733
  msgid "Unable to save the duplicate feed data."
734
  msgstr ""
735
 
736
+ #: includes/helper.php:5380
737
  msgid "Feed Successfully Duplicated, but unable to generate the data file. Please click the \"Regenerate Button\""
738
  msgstr ""
739
 
woo-feed.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: CTX Feed
11
  * Plugin URI: https://webappick.com/
12
  * Description: Easily generate woocommerce product feed for any marketing channel like Google Shopping(Merchant), Facebook Remarketing, Bing, eBay & more. Support 100+ Merchants.
13
- * Version: 4.4.41
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2
10
  * Plugin Name: CTX Feed
11
  * Plugin URI: https://webappick.com/
12
  * Description: Easily generate woocommerce product feed for any marketing channel like Google Shopping(Merchant), Facebook Remarketing, Bing, eBay & more. Support 100+ Merchants.
13
+ * Version: 4.4.42
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2