WooCommerce Wishlist Plugin - Version 1.28.4

Version Description

Release Date - 07 September 2021

  • Added integration with Quick Buy Now Button for WooCommerce plugin
  • Updated integration with WooCommerce Composite Products plugin
  • Updated integration with WooCommerce Gravity Forms Product Add-Ons plugin
Download this release

Release Info

Developer templateinvaders
Plugin Icon 128x128 WooCommerce Wishlist Plugin
Version 1.28.4
Comparing to
See all releases

Code changes from version 1.28.3 to 1.28.4

assets/css/admin-form-rtl.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
assets/css/admin-form.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
assets/css/admin-rtl.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  *{-webkit-box-sizing:border-box;box-sizing:border-box}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  *{-webkit-box-sizing:border-box;box-sizing:border-box}
assets/css/admin-setup-rtl.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  html{background:#f6f3ed}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  html{background:#f6f3ed}
assets/css/admin-setup.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  html{background:#f6f3ed}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  html{background:#f6f3ed}
assets/css/admin.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  *{-webkit-box-sizing:border-box;box-sizing:border-box}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  *{-webkit-box-sizing:border-box;box-sizing:border-box}
assets/css/public-rtl.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
assets/css/public.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
assets/css/theme-rtl.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type=button],.tinv-wishlist input[type=reset],.tinv-wishlist input[type=submit]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type=button],.tinv-wishlist input[type=reset],.tinv-wishlist input[type=submit]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
assets/css/theme.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type=button],.tinv-wishlist input[type=reset],.tinv-wishlist input[type=submit]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  .tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type=button],.tinv-wishlist input[type=reset],.tinv-wishlist input[type=submit]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
assets/css/webfont-rtl.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  @font-face{font-family:"tinvwl-webfont";font-display:block;src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  @font-face{font-family:"tinvwl-webfont";font-display:block;src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
assets/css/webfont.min.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  @font-face{font-family:"tinvwl-webfont";font-display:block;src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  @font-face{font-family:"tinvwl-webfont";font-display:block;src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
assets/img/upgrade_to_pro.jpg CHANGED
Binary file
assets/js/admin.min.js CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  "use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){return"{0}{1}{2}".format(n=n||".",this.pf,t)},this._tm=function(t){var n=$("script#{0}[type='text/template']".format(t));return n.length?n.html():""},this.formElm=function(){if($(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker){var e=function(t){var n=t.substring(1),i=parseInt(n,16);return.2126*(i>>16&255)+.7152*(i>>8&255)+.0722*(i>>0&255)},n=this._csel("-form-color");$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){$(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)).iris("hide"):$(n).iris("hide")})}},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),e=t.parents("form").eq(0);i&&("-1"!==i.val()&&e.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){var i=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");i&&""===i.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t=this.n;if(this.ho){var n=new Date;t=t+n.getFullYear()+n.getMonth()+n.getDate()}window[t]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})}),function(o){var n=o.n,ho=o.ho,c="";for(var i in ho&&(c="t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),"),o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}(this)}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var n={onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},c=s.extend(!0,{},n,t);return s(this).each(function(){function t(){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),e=n.attr("tiwl-hide"),o=c.isChecked.call(n);return"string"==typeof i&&t(i,o),"string"==typeof e&&t(e,!o),n}var n=s(this);return n.is("input")&&"checkbox"==n.attr("type")?(s(this).on("change",t),t.call(n)):n})},s.fn.tiwl_byvalueblock=function(t){var n={onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},i=s.extend(!0,{},n,t);return s(this).each(function(){function t(e){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),o=n.attr("tiwl-hide"),c=e.onClick.call(n);return"string"==typeof i&&t(i,c),"string"==typeof o&&t(o,!c),n}var n=s(this);return n.is("input")||n.is("select")?(s(this).on("change",function(){t.call(this,i)}),t.call(n,i)):n})};var n=new TInvWL(s);s(document).ready(function(){if(n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover){var t=s(".tinvwl-help");t.popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})}s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})}),s(document).on("click",".tinvwl-chat-notice .notice-dismiss",function(t){s.post(tinvwl_comfirm.ajax_url,{action:"tinvwl_admin_chat_notice"})})}(jQuery);
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  "use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){return"{0}{1}{2}".format(n=n||".",this.pf,t)},this._tm=function(t){var n=$("script#{0}[type='text/template']".format(t));return n.length?n.html():""},this.formElm=function(){if($(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker){var e=function(t){var n=t.substring(1),i=parseInt(n,16);return.2126*(i>>16&255)+.7152*(i>>8&255)+.0722*(i>>0&255)},n=this._csel("-form-color");$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){$(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)).iris("hide"):$(n).iris("hide")})}},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),e=t.parents("form").eq(0);i&&("-1"!==i.val()&&e.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){var i=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");i&&""===i.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t=this.n;if(this.ho){var n=new Date;t=t+n.getFullYear()+n.getMonth()+n.getDate()}window[t]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})}),function(o){var n=o.n,ho=o.ho,c="";for(var i in ho&&(c="t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),"),o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}(this)}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var n={onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},c=s.extend(!0,{},n,t);return s(this).each(function(){function t(){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),e=n.attr("tiwl-hide"),o=c.isChecked.call(n);return"string"==typeof i&&t(i,o),"string"==typeof e&&t(e,!o),n}var n=s(this);return n.is("input")&&"checkbox"==n.attr("type")?(s(this).on("change",t),t.call(n)):n})},s.fn.tiwl_byvalueblock=function(t){var n={onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},i=s.extend(!0,{},n,t);return s(this).each(function(){function t(e){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),o=n.attr("tiwl-hide"),c=e.onClick.call(n);return"string"==typeof i&&t(i,c),"string"==typeof o&&t(o,!c),n}var n=s(this);return n.is("input")||n.is("select")?(s(this).on("change",function(){t.call(this,i)}),t.call(n,i)):n})};var n=new TInvWL(s);s(document).ready(function(){if(n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover){var t=s(".tinvwl-help");t.popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})}s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})}),s(document).on("click",".tinvwl-chat-notice .notice-dismiss",function(t){s.post(tinvwl_comfirm.ajax_url,{action:"tinvwl_admin_chat_notice"})})}(jQuery);
assets/js/public.min.js CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
- * @version 1.28.3
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(c){c.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href.split("?")[0],text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){c(this).append(c("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){c(t).addClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){c(t).removeClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(c(this).is(".disabled-add-wishlist"))return!1;c(this).is(".ftinvwl-animated")&&c(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):a.onActionProduct.call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var o={};return c("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val();("checkbox"!==i&&"radio"!==i||c(this).is(":checked"))&&(o["form"+t]=n)}),o=o.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof o)return t.in;var i=parseInt(o);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=a.onPrepareList.call(t)||t,t=a.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove();var n="";switch(t.length){case 0:break;default:n=c("<ul>");c.each(t,function(t,i){n.append(c("<li>").html(c("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}n.length&&c(this).closest(".tinv-modal-inner").find("img").after(c("<div>").addClass("already-in").html(a.text_already_in+" ").append(n))},onAction:{redirect:function(t){a.redirectTimer&&clearTimeout(a.redirectTimer),a.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(){},msg:function(t){if(!t)return!1;var i,n,o,e=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(e),i=c("body > .tinv-wishlist").find("select, input, textarea, button, a").filter(":visible"),n=i.first(),o=i.last(),n.focus().blur(),o.on("keydown",function(t){9!==t.which||t.shiftKey||(t.preventDefault(),n.focus())}),n.on("keydown",function(t){9===t.which&&t.shiftKey&&(t.preventDefault(),o.focus())}),e.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),e.remove(),a.redirectTimer&&clearTimeout(a.redirectTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(){},make_remove:function(){},wishlists_data:function(t){d(JSON.stringify(t))}}};i.onActionProduct=function(t,i){var r={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:c(this).attr("data-tinv-wl-producttype"),product_id:c(this).attr("data-tinv-wl-product")||0,product_variation:c(this).attr("data-tinv-wl-productvariation")||0,product_action:c(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},n=this,o=[],d=new FormData;tinvwl_add_to_wishlist.wpml&&(r.lang=tinvwl_add_to_wishlist.wpml),c('form.cart[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"], form.vtajaxform[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),o.length||(c(n).closest("form.cart[method=post], form.vtajaxform[method=post]").each(function(){o.push(c(this))}),o.length||o.push(c("form.cart[method=post]"))),c('.tinv-wraper[data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),c.each(o,function(t,i){c(i).find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){function e(t,i){if("object"!==_typeof(i))return i;for(var n in void 0===t&&(t={}),i)if(""===n){var o=-1;for(o in t)o=o;t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val(),o=10;if("button"!==i&&void 0!==t){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<o;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=n,n=l}t=a[1],o--}if("file"===i){var s=c(this)[0].files;s&&d.append(t,s[0])}"checkbox"===i||"radio"===i?c(this).is(":checked")&&(n.length||"object"===_typeof(n)||(n=!0),r.form[t]=e(r.form[t],n)):r.form[t]=e(r.form[t],n)}})}),r=a.onPrepareDataAction.call(n,n,r)||r,c.each(r,function(n,t){"form"===n?c.each(t,function(t,i){"object"===_typeof(i)&&(i=JSON.stringify(i)),d.append(n+"["+t+"]",i)}):d.append(n,t)}),c.ajax({url:a.api_url,method:"POST",contentType:!1,processData:!1,data:d}).done(function(t){if(a.onDialogHide.call(n.tinvwl_dialog,n),"object"===_typeof(t))for(var i in t)"function"==typeof a.onAction[i]&&a.onAction[i].call(n,t[i]);else"function"==typeof a.onAction.msg&&a.onAction.msg.call(n,t)})};var a=c.extend(!0,{},i,t);return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;if(a.dialogbox&&a.dialogbox.length&&(this.tinvwl_dialog=a.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=a.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=c(this).nextAll(a.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){a.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var n=c(this).find(a.class.select).eq(0);c(this).find(a.class.newtitle).hide().val(""),n.html(""),c.each(t,function(t,i){a.onCreateWishList.call(n,i)}),a.text_create&&a.onCreateWishList.call(n,{ID:"",title:a.text_create,in:!1}),a.onMultiProductAlreadyIn.call(n,t),a.onSelectWishList.call(n,t),c(this).find(a.class.newtitle).toggle(""===n.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=JSON.parse(c(this).attr("data-tinv-wl-list"))||[];t.length?(t=a.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),a.onDialogShow.call(this.tinvwl_dialog,this)):a.onActionProduct.call(this)});var o=this;c(this.tinvwl_dialog).find(a.class.dialogbutton).off("click").on("click",function(){var t,i=c(o.tinvwl_dialog).find(a.class.select),n=c(o.tinvwl_dialog).find(a.class.newtitle);i.val()||n.val()?a.onActionProduct.call(o,i.val(),n.val()):((t=n.is(":visible")?n:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}c(this).off("click").on("click",a.onClick),a.onInited.call(this,a)})},c(document).ready(function(){c("body").on("click keydown",".tinvwl_add_to_wishlist_button",function(t){if("keydown"===t.type){var i=void 0!==t.key?t.key:t.keyCode;if(!("Enter"===i||13===i||0<=["Spacebar"," "].indexOf(i)||32===i))return;t.preventDefault()}if(c("body").trigger("tinvwl_add_to_wishlist_button_click",[this]),c(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);c(this).is(".inited-add-wishlist")||c(this).tinvwl_to_wishlist({onInited:function(t){c(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),c(document).on("hide_variation",".variations_form",function(t){var i=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(i.attr("data-tinv-wl-productvariation",0),i.length&&i.attr("data-tinv-wl-list")){var n=JSON.parse(i.attr("data-tinv-wl-list")),o=!1,e="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var a in n)n[a].hasOwnProperty("in")&&Array.isArray(n[a].in)&&-1<(n[a].in||[]).indexOf(0)&&(o=!0);i.toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&e).attr("data-tinv-wl-action",o&&e?"remove":"addto")}i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),c(document).on("show_variation",".variations_form",function(t,i,n){var o=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(o.attr("data-tinv-wl-productvariation",i.variation_id),o.length&&o.attr("data-tinv-wl-list")){var e=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in e)e[s].hasOwnProperty("in")&&Array.isArray(e[s].in)&&-1<(e[s].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){if(s===t.originalEvent.key&&localStorage.getItem(s)!==sessionStorage.getItem(s)&&localStorage.getItem(s)){var i=JSON.parse(localStorage.getItem(s));"object"===_typeof(i)&&null!==i&&(i.hasOwnProperty("products")||i.hasOwnProperty("counter"))&&d(localStorage.getItem(s))}});var n=[],i=!1;c("a.tinvwl_add_to_wishlist_button").each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))}),c(".wishlist_products_counter_number").each(function(){i=!0});function o(){if(n.length||i){var t={};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.plugin_url+"includes/api/ajax.php",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)}).fail(function(){!function(){if(n.length||i){var t={ids:n,counter:i,tinvwl_request:!0};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.rest_root+"wishlist/v1/products",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)})}}()})}}function e(){if(l&&(tinvwl_add_to_wishlist.update_wishlists_data&&localStorage.setItem(s,""),localStorage.getItem(s))){var t=JSON.parse(localStorage.getItem(s));if("object"===_typeof(t)&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter"))&&(!t.hasOwnProperty("lang")&&!tinvwl_add_to_wishlist.wpml||tinvwl_add_to_wishlist.wpml&&t.lang===tinvwl_add_to_wishlist.wpml))return void r(t)}tinvwl_add_to_wishlist.block_ajax_wishlists_data||o()}e();var t=new MutationObserver(function(t){n=[],t.forEach(function(t){var i=t.addedNodes;null!==i&&c(i).each(function(){var t=c(this).find(".tinvwl_add_to_wishlist_button");t.length&&t.each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))})})}),n.length&&e()}),a=document.body;t.observe(a,{childList:!0,subtree:!0})});var l=!0,s=tinvwl_add_to_wishlist.hash_key;try{l="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("ti","test"),window.sessionStorage.removeItem("ti"),window.localStorage.setItem("ti","test"),window.localStorage.removeItem("ti")}catch(t){l=!1}function r(t){var l="1"==window.tinvwl_add_to_wishlist.simple_flow;l&&c("a.tinvwl_add_to_wishlist_button").each(function(){c(this).removeClass("tinvwl-product-make-remove").removeClass("tinvwl-product-already-on-wishlist").removeClass("tinvwl-product-in-list").attr("data-tinv-wl-action","addto").attr("data-tinv-wl-list","[]")}),c("body").trigger("tinvwl_wishlist_mark_products",[t]),c.each(t.products,function(t,e){var a=t;c('a.tinvwl_add_to_wishlist_button[data-tinv-wl-product="'+a+'"]').each(function(){var t=parseInt(c(this).attr("data-tinv-wl-productvariation")),i=c(this).data("tinv-wl-productvariations")||[],n=!1;for(var o in e)e[o].hasOwnProperty("in")&&Array.isArray(e[o].in)&&(-1<(e[o].in||[]).indexOf(a)||-1<(e[o].in||[]).indexOf(t)||i.some(function(t){return 0<=(e[o].in||[]).indexOf(t)}))&&(n=!0);c("body").trigger("tinvwl_wishlist_product_marked",[this,n]),c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",n).toggleClass("tinvwl-product-make-remove",n&&l).attr("data-tinv-wl-action",n&&l?"remove":"addto")})}),function(t){"1"==window.tinvwl_add_to_wishlist.hide_zero_counter&&0===t&&(t="false");jQuery("i.wishlist-icon").addClass("added"),"false"!==t?(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html(t),jQuery("i.wishlist-icon").attr("data-icon-label",t)):(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html("").closest("span.wishlist-counter-with-products").removeClass("wishlist-counter-with-products"),jQuery("i.wishlist-icon").removeAttr("data-icon-label"));var i=!("0"==t||"false"==t);jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",i),setTimeout(function(){jQuery("i.wishlist-icon").removeClass("added")},500)}(t.counter)}function d(t){l&&(localStorage.setItem(s,t),sessionStorage.setItem(s,t),r(JSON.parse(t)))}}(jQuery),function(o){o(document).ready(function(){if(o("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),o(".tinv-lists-nav").each(function(){o(this).html().trim().length||o(this).remove()}),o("body").on("click",".social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)",function(t){var i=window.open(o(this).attr("href"),o(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}o("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),o("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),o(this).parents(".tinv-modal:first").removeClass("tinv-modal-open"),o("body").trigger("tinvwl_modal_closed",[this])}),o("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){o(this).data("url")&&(t.preventDefault(),window.location=o(this).data("url"))});var n=o(".tinv-wishlist .navigation-button");n.length&&n.each(function(){var t=o(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),o(".tinv-login .showlogin").off("click").on("click",function(t){t.preventDefault(),o(this).closest(".tinv-login").find(".login").toggle()}),o(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){o(this).toggle(!!o(this).children().not(".look_in").length||!!o(this).children(".look_in").children().length)})})}(jQuery),function(o){o.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return o(this).val()},rule:function(){var t=o(this).parents("form").eq(0).find(n.selector),i=n.invert;return 0===t.length?n.ifempty:(t.each(function(){i&&!n.invert||!i&&n.invert||(i=Boolean(n.validate.call(o(this))))}),i)}},n=o.extend(!0,{},i,t);return o(this).each(function(){o(this).on("click",function(t){var i=[];void 0!==o(this).attr("tinvwl_break_submit")&&(i=o(this).attr("tinvwl_break_submit").split(",")),-1!==jQuery.inArray(n.selector,i)&&(i=[]),n.rule.call(o(this))||0!==i.length||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault()),i.push(n.selector),o(this).attr("tinvwl_break_submit",i),n.rule.call(o(this))&&o(this).removeAttr("tinvwl_break_submit")})})},o(document).ready(function(){o(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),o(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return o(this).is(":checked")}}),o(".global-cb").on("click",function(){o(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",o(this).is(":checked"))})})}(jQuery);
1
  /**
2
  * TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
3
+ * @version 1.28.4
4
  * @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
5
  */
6
  "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(c){c.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href.split("?")[0],text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){c(this).append(c("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){c(t).addClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){c(t).removeClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(c(this).is(".disabled-add-wishlist"))return!1;c(this).is(".ftinvwl-animated")&&c(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):a.onActionProduct.call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var o={};return c("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val();("checkbox"!==i&&"radio"!==i||c(this).is(":checked"))&&(o["form"+t]=n)}),o=o.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof o)return t.in;var i=parseInt(o);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=a.onPrepareList.call(t)||t,t=a.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove();var n="";switch(t.length){case 0:break;default:n=c("<ul>");c.each(t,function(t,i){n.append(c("<li>").html(c("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}n.length&&c(this).closest(".tinv-modal-inner").find("img").after(c("<div>").addClass("already-in").html(a.text_already_in+" ").append(n))},onAction:{redirect:function(t){a.redirectTimer&&clearTimeout(a.redirectTimer),a.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(){},msg:function(t){if(!t)return!1;var i,n,o,e=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(e),i=c("body > .tinv-wishlist").find("select, input, textarea, button, a").filter(":visible"),n=i.first(),o=i.last(),n.focus().blur(),o.on("keydown",function(t){9!==t.which||t.shiftKey||(t.preventDefault(),n.focus())}),n.on("keydown",function(t){9===t.which&&t.shiftKey&&(t.preventDefault(),o.focus())}),e.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),e.remove(),a.redirectTimer&&clearTimeout(a.redirectTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(){},make_remove:function(){},wishlists_data:function(t){d(JSON.stringify(t))}}};i.onActionProduct=function(t,i){var r={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:c(this).attr("data-tinv-wl-producttype"),product_id:c(this).attr("data-tinv-wl-product")||0,product_variation:c(this).attr("data-tinv-wl-productvariation")||0,product_action:c(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},n=this,o=[],d=new FormData;tinvwl_add_to_wishlist.wpml&&(r.lang=tinvwl_add_to_wishlist.wpml),c('form.cart[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"], form.vtajaxform[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),o.length||(c(n).closest("form.cart[method=post], form.vtajaxform[method=post]").each(function(){o.push(c(this))}),o.length||o.push(c("form.cart[method=post]"))),c('.tinv-wraper[data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),c.each(o,function(t,i){c(i).find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){function e(t,i){if("object"!==_typeof(i))return i;for(var n in void 0===t&&(t={}),i)if(""===n){var o=-1;for(o in t)o=o;t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val(),o=10;if("button"!==i&&void 0!==t){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<o;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=n,n=l}t=a[1],o--}if("file"===i){var s=c(this)[0].files;s&&d.append(t,s[0])}"checkbox"===i||"radio"===i?c(this).is(":checked")&&(n.length||"object"===_typeof(n)||(n=!0),r.form[t]=e(r.form[t],n)):r.form[t]=e(r.form[t],n)}})}),r=a.onPrepareDataAction.call(n,n,r)||r,c.each(r,function(n,t){"form"===n?c.each(t,function(t,i){"object"===_typeof(i)&&(i=JSON.stringify(i)),d.append(n+"["+t+"]",i)}):d.append(n,t)}),c.ajax({url:a.api_url,method:"POST",contentType:!1,processData:!1,data:d}).done(function(t){if(a.onDialogHide.call(n.tinvwl_dialog,n),"object"===_typeof(t))for(var i in t)"function"==typeof a.onAction[i]&&a.onAction[i].call(n,t[i]);else"function"==typeof a.onAction.msg&&a.onAction.msg.call(n,t)})};var a=c.extend(!0,{},i,t);return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;if(a.dialogbox&&a.dialogbox.length&&(this.tinvwl_dialog=a.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=a.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=c(this).nextAll(a.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){a.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var n=c(this).find(a.class.select).eq(0);c(this).find(a.class.newtitle).hide().val(""),n.html(""),c.each(t,function(t,i){a.onCreateWishList.call(n,i)}),a.text_create&&a.onCreateWishList.call(n,{ID:"",title:a.text_create,in:!1}),a.onMultiProductAlreadyIn.call(n,t),a.onSelectWishList.call(n,t),c(this).find(a.class.newtitle).toggle(""===n.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=JSON.parse(c(this).attr("data-tinv-wl-list"))||[];t.length?(t=a.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),a.onDialogShow.call(this.tinvwl_dialog,this)):a.onActionProduct.call(this)});var o=this;c(this.tinvwl_dialog).find(a.class.dialogbutton).off("click").on("click",function(){var t,i=c(o.tinvwl_dialog).find(a.class.select),n=c(o.tinvwl_dialog).find(a.class.newtitle);i.val()||n.val()?a.onActionProduct.call(o,i.val(),n.val()):((t=n.is(":visible")?n:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}c(this).off("click").on("click",a.onClick),a.onInited.call(this,a)})},c(document).ready(function(){c("body").on("click keydown",".tinvwl_add_to_wishlist_button",function(t){if("keydown"===t.type){var i=void 0!==t.key?t.key:t.keyCode;if(!("Enter"===i||13===i||0<=["Spacebar"," "].indexOf(i)||32===i))return;t.preventDefault()}if(c("body").trigger("tinvwl_add_to_wishlist_button_click",[this]),c(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);c(this).is(".inited-add-wishlist")||c(this).tinvwl_to_wishlist({onInited:function(t){c(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),c(document).on("hide_variation",".variations_form",function(t){var i=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(i.attr("data-tinv-wl-productvariation",0),i.length&&i.attr("data-tinv-wl-list")){var n=JSON.parse(i.attr("data-tinv-wl-list")),o=!1,e="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var a in n)n[a].hasOwnProperty("in")&&Array.isArray(n[a].in)&&-1<(n[a].in||[]).indexOf(0)&&(o=!0);i.toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&e).attr("data-tinv-wl-action",o&&e?"remove":"addto")}i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),c(document).on("show_variation",".variations_form",function(t,i,n){var o=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(o.attr("data-tinv-wl-productvariation",i.variation_id),o.length&&o.attr("data-tinv-wl-list")){var e=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in e)e[s].hasOwnProperty("in")&&Array.isArray(e[s].in)&&-1<(e[s].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){if(s===t.originalEvent.key&&localStorage.getItem(s)!==sessionStorage.getItem(s)&&localStorage.getItem(s)){var i=JSON.parse(localStorage.getItem(s));"object"===_typeof(i)&&null!==i&&(i.hasOwnProperty("products")||i.hasOwnProperty("counter"))&&d(localStorage.getItem(s))}});var n=[],i=!1;c("a.tinvwl_add_to_wishlist_button").each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))}),c(".wishlist_products_counter_number").each(function(){i=!0});function o(){if(n.length||i){var t={};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.plugin_url+"includes/api/ajax.php",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)}).fail(function(){!function(){if(n.length||i){var t={ids:n,counter:i,tinvwl_request:!0};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.rest_root+"wishlist/v1/products",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)})}}()})}}function e(){if(l&&(tinvwl_add_to_wishlist.update_wishlists_data&&localStorage.setItem(s,""),localStorage.getItem(s))){var t=JSON.parse(localStorage.getItem(s));if("object"===_typeof(t)&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter"))&&(!t.hasOwnProperty("lang")&&!tinvwl_add_to_wishlist.wpml||tinvwl_add_to_wishlist.wpml&&t.lang===tinvwl_add_to_wishlist.wpml))return void r(t)}tinvwl_add_to_wishlist.block_ajax_wishlists_data||o()}e();var t=new MutationObserver(function(t){n=[],t.forEach(function(t){var i=t.addedNodes;null!==i&&c(i).each(function(){var t=c(this).find(".tinvwl_add_to_wishlist_button");t.length&&t.each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))})})}),n.length&&e()}),a=document.body;t.observe(a,{childList:!0,subtree:!0})});var l=!0,s=tinvwl_add_to_wishlist.hash_key;try{l="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("ti","test"),window.sessionStorage.removeItem("ti"),window.localStorage.setItem("ti","test"),window.localStorage.removeItem("ti")}catch(t){l=!1}function r(t){var l="1"==window.tinvwl_add_to_wishlist.simple_flow;l&&c("a.tinvwl_add_to_wishlist_button").each(function(){c(this).removeClass("tinvwl-product-make-remove").removeClass("tinvwl-product-already-on-wishlist").removeClass("tinvwl-product-in-list").attr("data-tinv-wl-action","addto").attr("data-tinv-wl-list","[]")}),c("body").trigger("tinvwl_wishlist_mark_products",[t]),c.each(t.products,function(t,e){var a=t;c('a.tinvwl_add_to_wishlist_button[data-tinv-wl-product="'+a+'"]').each(function(){var t=parseInt(c(this).attr("data-tinv-wl-productvariation")),i=c(this).data("tinv-wl-productvariations")||[],n=!1;for(var o in e)e[o].hasOwnProperty("in")&&Array.isArray(e[o].in)&&(-1<(e[o].in||[]).indexOf(a)||-1<(e[o].in||[]).indexOf(t)||i.some(function(t){return 0<=(e[o].in||[]).indexOf(t)}))&&(n=!0);c("body").trigger("tinvwl_wishlist_product_marked",[this,n]),c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",n).toggleClass("tinvwl-product-make-remove",n&&l).attr("data-tinv-wl-action",n&&l?"remove":"addto")})}),function(t){"1"==window.tinvwl_add_to_wishlist.hide_zero_counter&&0===t&&(t="false");jQuery("i.wishlist-icon").addClass("added"),"false"!==t?(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html(t),jQuery("i.wishlist-icon").attr("data-icon-label",t)):(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html("").closest("span.wishlist-counter-with-products").removeClass("wishlist-counter-with-products"),jQuery("i.wishlist-icon").removeAttr("data-icon-label"));var i=!("0"==t||"false"==t);jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",i),setTimeout(function(){jQuery("i.wishlist-icon").removeClass("added")},500)}(t.counter)}function d(t){l&&(localStorage.setItem(s,t),sessionStorage.setItem(s,t),r(JSON.parse(t)))}}(jQuery),function(o){o(document).ready(function(){if(o("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),o(".tinv-lists-nav").each(function(){o(this).html().trim().length||o(this).remove()}),o("body").on("click",".social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)",function(t){var i=window.open(o(this).attr("href"),o(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}o("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),o("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),o(this).parents(".tinv-modal:first").removeClass("tinv-modal-open"),o("body").trigger("tinvwl_modal_closed",[this])}),o("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){o(this).data("url")&&(t.preventDefault(),window.location=o(this).data("url"))});var n=o(".tinv-wishlist .navigation-button");n.length&&n.each(function(){var t=o(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),o(".tinv-login .showlogin").off("click").on("click",function(t){t.preventDefault(),o(this).closest(".tinv-login").find(".login").toggle()}),o(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){o(this).toggle(!!o(this).children().not(".look_in").length||!!o(this).children(".look_in").children().length)})})}(jQuery),function(o){o.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return o(this).val()},rule:function(){var t=o(this).parents("form").eq(0).find(n.selector),i=n.invert;return 0===t.length?n.ifempty:(t.each(function(){i&&!n.invert||!i&&n.invert||(i=Boolean(n.validate.call(o(this))))}),i)}},n=o.extend(!0,{},i,t);return o(this).each(function(){o(this).on("click",function(t){var i=[];void 0!==o(this).attr("tinvwl_break_submit")&&(i=o(this).attr("tinvwl_break_submit").split(",")),-1!==jQuery.inArray(n.selector,i)&&(i=[]),n.rule.call(o(this))||0!==i.length||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault()),i.push(n.selector),o(this).attr("tinvwl_break_submit",i),n.rule.call(o(this))&&o(this).removeAttr("tinvwl_break_submit")})})},o(document).ready(function(){o(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),o(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return o(this).is(":checked")}}),o(".global-cb").on("click",function(){o(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",o(this).is(":checked"))})})}(jQuery);
integrations/buy-now-button-for-woocommerce.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * TI WooCommerce Wishlist integration with:
4
+ *
5
+ * @name Quick Buy Now Button for WooCommerce
6
+ *
7
+ * @version 1.3.6
8
+ *
9
+ * @slug buy-now-button-for-woocommerce
10
+ *
11
+ * @url https://woocommerce.com/products/quick-buy-now-button-for-woocommerce/
12
+ *
13
+ */
14
+
15
+ // If this file is called directly, abort.
16
+ if (!defined('ABSPATH')) {
17
+ exit;
18
+ }
19
+
20
+ // Load integration depends on current settings.
21
+ global $tinvwl_integrations;
22
+
23
+ $slug = "buy-now-button-for-woocommerce";
24
+
25
+ $name = "Quick Buy Now Button for WooCommerce";
26
+
27
+ $available = class_exists('Class_Addify_Quick_Buy');
28
+
29
+ $tinvwl_integrations = is_array($tinvwl_integrations) ? $tinvwl_integrations : [];
30
+
31
+ $tinvwl_integrations[$slug] = array(
32
+ 'name' => $name,
33
+ 'available' => $available,
34
+ );
35
+
36
+ if (!tinv_get_option('integrations', $slug)) {
37
+ return;
38
+ }
39
+
40
+ if (!$available) {
41
+ return;
42
+ }
43
+
44
+ /**
45
+ * Set description for meta Quick Buy Now Button for WooCommerce
46
+ *
47
+ * @param array $meta Meta array.
48
+ * @param array $wl_product Wishlist Product.
49
+ * @param \WC_Product $product Woocommerce Product.
50
+ *
51
+ * @return array
52
+ */
53
+
54
+ function tinv_wishlist_item_meta_apbgp($item_data, $product_id, $variation_id)
55
+ {
56
+ foreach (array_keys($item_data) as $key) {
57
+ if (strpos($key, 'aqbp') === 0 || strpos($key, 'afqb') === 0) {
58
+ unset($item_data[$key]);
59
+ }
60
+ }
61
+
62
+ return $item_data;
63
+ }
64
+
65
+ add_filter('tinvwl_wishlist_item_meta_post', 'tinv_wishlist_item_meta_apbgp', 10, 3);
integrations/woocommerce-composite-products.php CHANGED
@@ -83,6 +83,8 @@ if (!function_exists('tinvwl_row_woocommerce_composite_products')) {
83
 
84
  $composited_variation_id = isset($wl_product['meta']['wccp_variation_id'][$component_id]) ? wc_clean($wl_product['meta']['wccp_variation_id'][$component_id]) : '';
85
 
 
 
86
  if ($composited_product_id) {
87
 
88
  $composited_product_wrapper = $component->get_option($composited_variation_id ? $composited_variation_id : $composited_product_id);
@@ -296,3 +298,40 @@ if (!function_exists('tinv_wishlist_metaprepare_woocommerce_composite_products')
296
 
297
  add_filter('tinvwl_product_prepare_meta', 'tinv_wishlist_metaprepare_woocommerce_composite_products');
298
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
  $composited_variation_id = isset($wl_product['meta']['wccp_variation_id'][$component_id]) ? wc_clean($wl_product['meta']['wccp_variation_id'][$component_id]) : '';
85
 
86
+ $composited_product_id = isset($wl_product['meta']['wccp_component_selection_nil'], $wl_product['meta']['wccp_component_selection_nil'][$component_id]) ? '' : $composited_product_id;
87
+
88
  if ($composited_product_id) {
89
 
90
  $composited_product_wrapper = $component->get_option($composited_variation_id ? $composited_variation_id : $composited_product_id);
298
 
299
  add_filter('tinvwl_product_prepare_meta', 'tinv_wishlist_metaprepare_woocommerce_composite_products');
300
  }
301
+
302
+ function tinv_add_to_wishlist_woocommerce_composite_products()
303
+ {
304
+
305
+ wp_add_inline_script('tinvwl', "
306
+ jQuery(document).ready(function($){
307
+ $(document).on('tinvwl_wishlist_button_clicked', function (e, el, data) {
308
+ var button = $(el), composite_form =[];
309
+
310
+ $( 'form.cart[method=post][data-product_id=\"' + button.attr( 'data-tinv-wl-product' ) + '\"], form.vtajaxform[method=post][data-product_id=\"' + button.attr( 'data-tinv-wl-product' ) + '\"]' ).each( function() {
311
+ composite_form.push( $( this ) );
312
+ });
313
+
314
+ if ( ! composite_form.length ) {
315
+ button.closest( 'form.cart[method=post], form.vtajaxform[method=post]' ).each( function() {
316
+ composite_form.push( $( this ) );
317
+ });
318
+ if ( ! composite_form.length ) {
319
+ composite_form.push( $( 'form.cart[method=post]' ) );
320
+ }
321
+
322
+ $.each( composite_form, function( index, element ) {
323
+ $( element ).find( 'div.composite_component' ).not(':visible').each( function() {
324
+ var id = $(this).attr('data-item_id');
325
+ if (!data.form.hasOwnProperty('wccp_component_selection_nil')) {
326
+ data.form.wccp_component_selection_nil = {};
327
+ }
328
+ data.form.wccp_component_selection_nil[id] = '1';
329
+ });
330
+ });
331
+ }
332
+ });
333
+ });
334
+ ");
335
+ }
336
+
337
+ add_action('wp_enqueue_scripts', 'tinv_add_to_wishlist_woocommerce_composite_products', 100, 1);
integrations/woocommerce-gravityforms-product-addons.php CHANGED
@@ -100,29 +100,21 @@ if (!function_exists('tinv_wishlist_metasupport_wc_gf_addons')) {
100
  add_filter('tinvwl_wishlist_item_meta_post', 'tinv_wishlist_metasupport_wc_gf_addons');
101
  }
102
 
103
- if (!function_exists('tinvwl_wishlist_item_name_wc_gf_addons')) {
104
 
105
- function tinvwl_wishlist_item_name_wc_gf_addons($name, $wl_product, $product)
106
  {
107
- if (!$product->is_visible()) {
108
- return $name;
109
- }
110
 
111
  $gravity_form_data = wc_gfpa()->get_gravity_form_data($product->get_id());
112
 
113
  if (isset($gravity_form_data['enable_cart_edit']) && $gravity_form_data['enable_cart_edit'] !== 'no') {
114
- $permalink = add_query_arg(array('wc_gforms_wishlist_product_id' => $wl_product['ID']), $product->get_permalink());
115
-
116
- $name = sprintf('<a href="%s">%s</a>', esc_url($permalink), is_callable(array(
117
- $product,
118
- 'get_name'
119
- )) ? $product->get_name() : $product->get_title());
120
  }
121
 
122
- return $name;
123
  }
124
 
125
- add_filter('tinvwl_wishlist_item_name', 'tinvwl_wishlist_item_name_wc_gf_addons', 10, 3);
126
  }
127
 
128
  if (!function_exists('tinvwl_item_price_wc_gf_addons')) {
100
  add_filter('tinvwl_wishlist_item_meta_post', 'tinv_wishlist_metasupport_wc_gf_addons');
101
  }
102
 
103
+ if (!function_exists('tinvwl_wishlist_item_url_wc_gf_addons')) {
104
 
105
+ function tinvwl_wishlist_item_url_wc_gf_addons($url, $wl_product, $product)
106
  {
 
 
 
107
 
108
  $gravity_form_data = wc_gfpa()->get_gravity_form_data($product->get_id());
109
 
110
  if (isset($gravity_form_data['enable_cart_edit']) && $gravity_form_data['enable_cart_edit'] !== 'no') {
111
+ $url = add_query_arg(array('wc_gforms_wishlist_product_id' => $wl_product['ID']), $product->get_permalink());
 
 
 
 
 
112
  }
113
 
114
+ return $url;
115
  }
116
 
117
+ add_filter('tinvwl_wishlist_item_url', 'tinvwl_wishlist_item_url_wc_gf_addons', 10, 3);
118
  }
119
 
120
  if (!function_exists('tinvwl_item_price_wc_gf_addons')) {
languages/ti-woocommerce-wishlist.pot CHANGED
@@ -1,8 +1,8 @@
1
- # Copyright (C) 2021 TI WooCommerce Wishlist Plugin - 1.28.3
2
- # This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.28.3 package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.28.3\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
@@ -1152,7 +1152,7 @@ msgstr ""
1152
  msgid "Custom Title"
1153
  msgstr ""
1154
 
1155
- #: integrations/woo-product-bundle.php:115, integrations/woocommerce-composite-products.php:142, integrations/woocommerce-mix-and-match-products.php:112, integrations/woocommerce-product-bundles.php:136, integrations/yith-woocommerce-product-bundles.php:165, templates/ti-wishlist-user.php:145, templates/ti-wishlist.php:153
1156
  msgid "In stock"
1157
  msgstr ""
1158
 
1
+ # Copyright (C) 2021 TI WooCommerce Wishlist Plugin - 1.28.4
2
+ # This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.28.4 package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.28.4\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
1152
  msgid "Custom Title"
1153
  msgstr ""
1154
 
1155
+ #: integrations/woo-product-bundle.php:115, integrations/woocommerce-composite-products.php:144, integrations/woocommerce-mix-and-match-products.php:112, integrations/woocommerce-product-bundles.php:136, integrations/yith-woocommerce-product-bundles.php:165, templates/ti-wishlist-user.php:145, templates/ti-wishlist.php:153
1156
  msgid "In stock"
1157
  msgstr ""
1158
 
public/wishlist/view.class.php CHANGED
@@ -1,887 +1,887 @@
1
- <?php
2
- /**
3
- * Wishlist shortcode
4
- *
5
- * @since 1.0.0
6
- * @package TInvWishlist\Public
7
- */
8
-
9
- // If this file is called directly, abort.
10
- if (!defined('ABSPATH')) {
11
- die;
12
- }
13
-
14
- /**
15
- * Wishlist shortcode
16
- */
17
- class TInvWL_Public_Wishlist_View
18
- {
19
-
20
- /**
21
- * Plugin name
22
- *
23
- * @var string
24
- */
25
- private $_name;
26
-
27
- /**
28
- * List per page
29
- *
30
- * @var integer
31
- */
32
- private $lists_per_page;
33
-
34
- /**
35
- * Current wishlist
36
- *
37
- * @var array
38
- */
39
- private $current_wishlist;
40
-
41
- /**
42
- * Current products
43
- *
44
- * @var array
45
- */
46
- private $current_products_query;
47
-
48
- /**
49
- * Social image
50
- *
51
- * @var string
52
- */
53
- public $social_image;
54
-
55
- /**
56
- * Total pages
57
- *
58
- * @var int
59
- */
60
- public $pages;
61
-
62
- /**
63
- * Wishlist full URL
64
- *
65
- * @var string
66
- */
67
- public $wishlist_url;
68
-
69
- /**
70
- * Wishlist product helper
71
- *
72
- * @var TInvWL_Product
73
- */
74
- public $wishlist_products_helper;
75
-
76
- /**
77
- * This class
78
- *
79
- * @var \TInvWL_Public_Wishlist_View
80
- */
81
- protected static $_instance = null;
82
-
83
- /**
84
- * Get this class object
85
- *
86
- * @param string $plugin_name Plugin name.
87
- *
88
- * @return \TInvWL_Public_Wishlist_View
89
- */
90
- public static function instance($plugin_name = TINVWL_PREFIX)
91
- {
92
- if (is_null(self::$_instance)) {
93
- self::$_instance = new self($plugin_name);
94
- }
95
-
96
- return self::$_instance;
97
- }
98
-
99
- /**
100
- * Constructor
101
- *
102
- * @param string $plugin_name Plugin name.
103
- */
104
- function __construct($plugin_name)
105
- {
106
- $this->_name = $plugin_name;
107
- $this->define_hooks();
108
- }
109
-
110
- /**
111
- * Defined shortcode and hooks
112
- */
113
- function define_hooks()
114
- {
115
- add_action('template_redirect', array($this, 'login_redirect'));
116
-
117
- add_action('wp_loaded', array($this, 'login_post_redirect'), 19);
118
-
119
- add_action('wp', array($this, 'wishlist_action'), 0);
120
- add_action('wp_head', array($this, 'add_meta_tags'), 1);
121
-
122
- add_action('tinvwl_before_wishlist', array($this, 'wishlist_header'));
123
-
124
- add_action('tinvwl_after_wishlist', array('TInvWL_Public_Wishlist_Social', 'init'));
125
- add_filter('tinvwl_wishlist_item_url', array($this, 'add_argument'), 10, 3);
126
- add_filter('tinvwl_wishlist_item_action_add_to_cart', array($this, 'product_allow_add_to_cart'), 10, 3);
127
- add_filter('tinvwl_wishlist_item_add_to_cart', array($this, 'external_text'), 10, 3);
128
- add_filter('tinvwl_wishlist_item_add_to_cart', array($this, 'variable_text'), 10, 3);
129
- add_action('tinvwl_after_wishlist_table', array($this, 'get_per_page'));
130
-
131
- TInvWL_Public_Wishlist_Buttons::init($this->_name);
132
- }
133
-
134
- /**
135
- * Redirect back after successful login.
136
- */
137
- public function login_post_redirect()
138
- {
139
- $nonce_value = isset($_REQUEST['woocommerce-login-nonce']) ? $_REQUEST['woocommerce-login-nonce'] : (isset($_REQUEST['_wpnonce']) ? $_REQUEST['_wpnonce'] : '');
140
- if (!empty($_POST['login']) && wp_verify_nonce($nonce_value, 'woocommerce-login') && !empty($_GET['tinvwl_redirect'])) {
141
- $_POST['redirect'] = $_GET['tinvwl_redirect']; // Force WC Login form handler to do redirect.
142
- }
143
- }
144
-
145
- /**
146
- * Redirect guests to login page.
147
- */
148
- public function login_redirect()
149
- {
150
- if (!wc_get_page_id('myaccount') && is_page(apply_filters('wpml_object_id', tinv_get_option('page', 'wishlist'), 'page', true)) && !is_user_logged_in() && tinv_get_option('general', 'require_login')) {
151
- $full_link = get_permalink();
152
- $share_key = get_query_var('tinvwlID', null);
153
- if (!empty($share_key)) {
154
- if (get_option('permalink_structure')) {
155
- if (!preg_match('/\/$/', $full_link)) {
156
- $full_link .= '/';
157
- }
158
- $full_link .= $share_key . '/';
159
- } else {
160
- $full_link = add_query_arg('tinvwlID', $share_key, $full_link);
161
- }
162
- }
163
- wp_safe_redirect(add_query_arg('tinvwl_redirect', rawurlencode($full_link), wc_get_page_permalink('myaccount')));
164
- exit;
165
- }
166
- }
167
-
168
- /**
169
- * Change Text for external product
170
- *
171
- * @param string $text Text for button add to cart.
172
- * @param array $wl_product Wishlist Product.
173
- * @param WC_Product $_product Product.
174
- *
175
- * @return string
176
- */
177
- function external_text($text, $wl_product, $_product)
178
- {
179
- global $product;
180
- // store global product data.
181
- $_product_tmp = $product;
182
- // override global product data.
183
- $product = $_product;
184
-
185
- if ('external' === ($product->get_type())) {
186
-
187
- $text = $product->single_add_to_cart_text();
188
-
189
- // restore global product data.
190
- $product = $_product_tmp;
191
- }
192
-
193
- return $text;
194
- }
195
-
196
- /**
197
- * Change Text for variable product that requires to select some variations.
198
- *
199
- * @param string $text Text for button add to cart.
200
- * @param array $wl_product Wishlist Product.
201
- * @param WC_Product $_product Product.
202
- *
203
- * @return string
204
- */
205
- function variable_text($text, $wl_product, $_product)
206
- {
207
- global $product;
208
- // store global product data.
209
- $_product_tmp = $product;
210
- // override global product data.
211
- $product = $_product;
212
- if (apply_filters('tinvwl_product_add_to_cart_need_redirect', false, $product, $product->get_permalink(), $wl_product)
213
- && in_array($product->get_type(), array(
214
- 'variable',
215
- 'variable-subscription',
216
- ))) {
217
-
218
- $text = $product->add_to_cart_text();
219
-
220
- // restore global product data.
221
- $product = $_product_tmp;
222
- }
223
-
224
- return $text;
225
- }
226
-
227
- /**
228
- * Add analytics argument for url
229
- *
230
- * @param string $url Product url.
231
- * @param array $wl_product Wishlist product.
232
- * @param object $product Product.
233
- *
234
- * @return type
235
- */
236
- function add_argument($url, $wl_product, $product)
237
- {
238
- return add_query_arg('tiwp', $wl_product['ID'], $url);
239
- }
240
-
241
- /**
242
- * Get current wishlist
243
- *
244
- * @return array
245
- */
246
- function get_current_wishlist()
247
- {
248
- if (empty($this->current_wishlist)) {
249
- $this->current_wishlist = apply_filters('tinvwl_get_current_wishlist', tinv_wishlist_get());
250
- }
251
-
252
- return $this->current_wishlist;
253
- }
254
-
255
- /**
256
- * Get current products query
257
- *
258
- * @return array
259
- */
260
- function get_current_products_query()
261
- {
262
- if (!is_array($this->current_products_query)) {
263
- return false;
264
- }
265
-
266
- return $this->current_products_query;
267
- }
268
-
269
- /**
270
- * Get current products from wishlist
271
- *
272
- * @param array $wishlist Wishlist object.
273
- * @param boolean $external Get woocommerce product info.
274
- * @param integer $lists_per_page Count per page.
275
- *
276
- * @return array
277
- */
278
- function get_current_products($wishlist = null, $external = true, $lists_per_page = 10)
279
- {
280
- if (empty($wishlist) || $wishlist === $this->get_current_wishlist()) {
281
- $wishlist = $this->get_current_wishlist();
282
-
283
- if (!$this->wishlist_products_helper) {
284
- $wlp = null;
285
- if (isset($wishlist['ID']) && 0 === $wishlist['ID']) {
286
- $wlp = TInvWL_Product_Local::instance();
287
- } else {
288
- $wlp = new TInvWL_Product($wishlist);
289
- }
290
- $this->wishlist_products_helper = $wlp;
291
- } else {
292
- $wlp = $this->wishlist_products_helper;
293
- }
294
-
295
- } else {
296
- $wlp = null;
297
- if (isset($wishlist['ID']) && 0 === $wishlist['ID']) {
298
- $wlp = TInvWL_Product_Local::instance();
299
- } else {
300
- $wlp = new TInvWL_Product($wishlist);
301
- }
302
- }
303
-
304
- if (empty($wlp)) {
305
- return array();
306
- }
307
-
308
- $paged = absint(get_query_var('wl_paged', 1));
309
- $this->pages = ceil(absint($wlp->get_wishlist(array(
310
- 'count' => 9999999,
311
- 'external' => false,
312
- ), true)) / absint($lists_per_page));
313
-
314
- $paged = $this->pages < $paged ? $this->pages : $paged;
315
-
316
- $product_data = array(
317
- 'count' => absint($lists_per_page),
318
- 'offset' => absint($lists_per_page) * (absint($paged) - 1),
319
- 'external' => $external,
320
- 'order_by' => 'date',
321
- 'order' => 'DESC',
322
- );
323
-
324
- $product_data = apply_filters('tinvwl_before_get_current_product', $product_data);
325
- $products = $wlp->get_wishlist($product_data);
326
- $products = apply_filters('tinvwl_after_get_current_product', $products);
327
-
328
- if (10 === absint($lists_per_page)) {
329
- $this->current_products_query = $products;
330
- }
331
-
332
- return $products;
333
- }
334
-
335
- /**
336
- * Allow show button add to cart
337
- *
338
- * @param boolean $allow Settings flag.
339
- * @param array $wlproduct Wishlist Product.
340
- * @param WC_Product $product Product.
341
- *
342
- * @return boolean
343
- */
344
- function product_allow_add_to_cart($allow, $wlproduct, $product)
345
- {
346
- if (!$allow) {
347
- return false;
348
- }
349
-
350
- return ($product->is_purchasable() || 'external' === $product->get_type()) && ($product->is_in_stock() || $product->backorders_allowed());
351
- }
352
-
353
- /**
354
- * Basic validation actions
355
- *
356
- * @return boolean
357
- */
358
- function wishlist_action()
359
- {
360
-
361
- $wishlist_page_id = apply_filters('wpml_object_id', tinv_get_option('page', 'wishlist'), 'page', true);
362
-
363
- if (is_page($wishlist_page_id)
364
- || (is_home() && 'page' === get_option('show_on_front') && absint(get_option('page_on_front')) === $wishlist_page_id)
365
- || (is_shop() && wc_get_page_id('shop') === $wishlist_page_id)) {
366
- $wishlist = $this->get_current_wishlist();
367
- if (empty($wishlist)) {
368
- return false;
369
- }
370
-
371
- if (version_compare(WC_VERSION, '3.2.0', '<')) {
372
- if (!defined('DONOTCACHEPAGE')) {
373
- define('DONOTCACHEPAGE', true);
374
- }
375
- if (!defined('DONOTCACHEOBJECT')) {
376
- define('DONOTCACHEOBJECT', true);
377
- }
378
- if (!defined('DONOTCACHEDB')) {
379
- define('DONOTCACHEDB', true);
380
- }
381
- } else {
382
- WC_Cache_Helper::set_nocache_constants(true);
383
- nocache_headers();
384
- }
385
-
386
- $is_owner = is_user_logged_in() ? (get_current_user_id() === $wishlist['author']) : $wishlist['is_owner'];
387
- $nonce = filter_input(INPUT_POST, 'wishlist_nonce');
388
- if ($nonce && wp_verify_nonce($nonce, 'tinvwl_wishlist_owner') && $is_owner) {
389
- do_action('tinvwl_before_action_owner', $wishlist);
390
- $this->wishlist_actions($wishlist, true);
391
- do_action('tinvwl_after_action_owner', $wishlist);
392
- }
393
- if ($nonce && wp_verify_nonce($nonce, 'tinvwl_wishlist_user') && !$is_owner) {
394
- do_action('tinvwl_before_action_user', $wishlist);
395
- $this->wishlist_actions($wishlist, false);
396
- do_action('tinvwl_after_action_user', $wishlist);
397
- }
398
- }
399
- }
400
-
401
- /**
402
- * Create social meta tags
403
- */
404
- function add_meta_tags()
405
- {
406
- if (is_page(apply_filters('wpml_object_id', tinv_get_option('page', 'wishlist'), 'page', true))) {
407
- $wishlist = $this->get_current_wishlist();
408
- if ($wishlist && 0 < $wishlist['ID']) {
409
- $this->wishlist_url = tinv_url_wishlist($wishlist['share_key']);
410
- if ('private' !== $wishlist['status'] && tinv_get_option('social', 'facebook')) {
411
- if (is_user_logged_in()) {
412
- $user = get_user_by('id', $wishlist['author']);
413
- if ($user && $user->exists()) {
414
- $user_name = trim(sprintf('%s %s', $user->user_firstname, $user->user_lastname));
415
- $user = @$user->display_name; // @codingStandardsIgnoreLine Generic.PHP.NoSilencedErrors.Discouraged
416
- } else {
417
- $user_name = '';
418
- $user = '';
419
- }
420
- } else {
421
- $user_name = '';
422
- $user = '';
423
- }
424
-
425
- if (is_array($this->get_current_products_query())) {
426
- $products = $this->current_products_query;
427
- } else {
428
- $products = $this->get_current_products($wishlist, true);
429
- }
430
-
431
- $products_title = array();
432
- foreach ($products as $product) {
433
- if (!empty($product) && !empty($product['data'])) {
434
- $title = is_callable(array(
435
- $product['data'],
436
- 'get_name'
437
- )) ? $product['data']->get_name() : $product['data']->get_title();
438
- if (!in_array($title, $products_title)) {
439
- $products_title[] = $title;
440
- }
441
- }
442
- }
443
- $product = array_shift($products);
444
- $image = '';
445
- if (!empty($product) && !empty($product['data'])) {
446
- list($image) = wp_get_attachment_image_src($product['data']->get_image_id(), 'full');
447
- }
448
-
449
- $this->social_image = $image;
450
-
451
-
452
- $meta = apply_filters('tinvwl_social_header_meta', array(
453
- 'url' => $this->wishlist_url,
454
- 'type' => 'product.group',
455
- 'title' => sprintf(__('%1$s by %2$s', 'ti-woocommerce-wishlist'), $wishlist['title'], (empty($user_name) ? $user : $user_name)),
456
- 'description' => implode(', ', $products_title),
457
- 'image' => $image,
458
- ));
459
-
460
- foreach ($meta as $name => $content) {
461
- echo sprintf('<meta property="og:%s" content="%s" />', esc_attr($name), esc_attr($content));
462
- }
463
- echo "\n";
464
- }
465
- } // End if().
466
- } // End if().
467
- }
468
-
469
- /**
470
- * Basic actions
471
- *
472
- * @param array $wishlist Wishlist object.
473
- * @param boolean $owner Is Owner.
474
- *
475
- * @return boolean
476
- */
477
- function wishlist_actions($wishlist, $owner = false)
478
- {
479
- $post = filter_input_array(INPUT_POST, array(
480
- 'wishlist_pr' => array(
481
- 'filter' => FILTER_VALIDATE_INT,
482
- 'flags' => FILTER_FORCE_ARRAY,
483
- ),
484
- 'wishlist_qty' => array(
485
- 'filter' => FILTER_VALIDATE_INT,
486
- 'flags' => FILTER_FORCE_ARRAY,
487
- 'options' => array('min_range' => 0, 'default' => 1),
488
- ),
489
- 'tinvwl-add-to-cart' => FILTER_VALIDATE_INT,
490
- 'tinvwl-remove' => FILTER_VALIDATE_INT,
491
- 'tinvwl-action' => FILTER_SANITIZE_STRING,
492
- ));
493
-
494
- if (!empty($post['tinvwl-add-to-cart'])) {
495
- $product = $post['tinvwl-add-to-cart'];
496
- $quantity = array_key_exists($product, (array)$post['wishlist_qty']) ? $post['wishlist_qty'][$product] : 1;
497
-
498
- return $this->button_addtocart($wishlist, $product, $quantity, $owner);
499
- }
500
- if (!empty($post['tinvwl-remove'])) {
501
- if (!$wishlist['is_owner']) {
502
- return false;
503
- }
504
- $product = $post['tinvwl-remove'];
505
- if (0 === $wishlist['ID']) {
506
- $wlp = TInvWL_Product_Local::instance();
507
- } else {
508
- $wlp = new TInvWL_Product($wishlist);
509
- }
510
- if (empty($wlp)) {
511
- return false;
512
- }
513
- $product_data = $wlp->get_wishlist(array('ID' => $product));
514
- $product_data = array_shift($product_data);
515
- if (empty($product_data)) {
516
- return false;
517
- }
518
- $title = sprintf(__('&ldquo;%s&rdquo;', 'ti-woocommerce-wishlist'), is_callable(array(
519
- $product_data['data'],
520
- 'get_name'
521
- )) ? $product_data['data']->get_name() : $product_data['data']->get_title());
522
- if ($wlp->remove($product_data)) {
523
- add_action('tinvwl_before_wishlist', array(
524
- 'TInvWL_Public_Wishlist_View',
525
- 'check_cart_hash',
526
- ), 99, 1);
527
- add_action('woocommerce_set_cart_cookies', array(
528
- 'TInvWL_Public_Wishlist_View',
529
- 'reset_cart_hash',
530
- ), 99, 1);
531
- wc_add_notice(sprintf(__('%s has been removed from wishlist.', 'ti-woocommerce-wishlist'), $title));
532
- } else {
533
- wc_add_notice(sprintf(__('%s has not been removed from wishlist.', 'ti-woocommerce-wishlist'), $title), 'error');
534
- }
535
-
536
- return true;
537
- }
538
- do_action('tinvwl_action_' . $post['tinvwl-action'], $wishlist, $post['wishlist_pr'], $post['wishlist_qty'], $owner); // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidHookName.UseUnderscores
539
- }
540
-
541
- /**
542
- * Check cart hash to trigger WC fragments refresh on wishlist update.
543
- *
544
- * @param $wishlist
545
- */
546
- public static function check_cart_hash($wishlist)
547
- {
548
- wp_add_inline_script('woocommerce', "
549
- jQuery(document).ready(function($){
550
- if ( typeof wc_cart_fragments_params === 'undefined' ) {
551
- return false;
552
- }
553
-
554
- var cart_hash_key = wc_cart_fragments_params.cart_hash_key,
555
- cart_hash = sessionStorage.getItem( cart_hash_key );
556
-
557
- if ( cart_hash === null || cart_hash === undefined || cart_hash === '' ) {
558
- sessionStorage.setItem( cart_hash_key, 'empty' );
559
- }
560
- });
561
- ");
562
- }
563
-
564
- /**
565
- * Reset cart hash to trigger WC fragments refresh on wishlist update.
566
- *
567
- * @param bool $set
568
- */
569
- public static function reset_cart_hash($set)
570
- {
571
- wc_setcookie('woocommerce_cart_hash', 'reset', time() - HOUR_IN_SECONDS);
572
- }
573
-
574
- /**
575
- * Apply action add to cart
576
- *
577
- * @param array $wishlist Wishlist object.
578
- * @param integer $id Product id in wishlist.
579
- * @param integer $quantity Product quantity.
580
- * @param boolean $owner Is Owner.
581
- *
582
- * @return boolean
583
- */
584
- function button_addtocart($wishlist, $id, $quantity = 1, $owner = false)
585
- {
586
- $id = absint($id);
587
- $quantity = absint($quantity);
588
- if (empty($id) || empty($quantity)) {
589
- return false;
590
- }
591
-
592
- $wlp = null;
593
- if (0 === $wishlist['ID']) {
594
- $wlp = TInvWL_Product_Local::instance();
595
- } else {
596
- $wlp = new TInvWL_Product($wishlist);
597
- }
598
- if (empty($wlp)) {
599
- return false;
600
- }
601
-
602
- $_product = $wlp->get_wishlist(array('ID' => $id));
603
- $_product = array_shift($_product);
604
- if (empty($_product) || empty($_product['data'])) {
605
- return false;
606
- }
607
-
608
- global $product;
609
- // store global product data.
610
- $_product_tmp = $product;
611
- // override global product data.
612
- $product = $_product['data'];
613
-
614
- add_filter('clean_url', 'tinvwl_clean_url', 10, 2);
615
- $redirect_url = $_product['data']->add_to_cart_url();
616
- remove_filter('clean_url', 'tinvwl_clean_url', 10);
617
-
618
- // restore global product data.
619
- $product = $_product_tmp;
620
-
621
- $quantity = apply_filters('tinvwl_product_add_to_cart_quantity', $quantity, $_product['data']);
622
-
623
- if (apply_filters('tinvwl_product_add_to_cart_need_redirect', false, $_product['data'], $redirect_url, $_product)) {
624
- wp_redirect(apply_filters('tinvwl_product_add_to_cart_redirect_url', $redirect_url, $_product['data'], $_product)); // @codingStandardsIgnoreLine WordPress.VIP.RestrictedFunctions.wp_redirect
625
- exit;
626
- } elseif (apply_filters('tinvwl_allow_addtocart_in_wishlist', true, $wishlist, $owner)) {
627
- $add = TInvWL_Public_Cart::add($wishlist, $id, $quantity);
628
- if ($add) {
629
- wc_add_to_cart_message($add, true);
630
-
631
- if (tinv_get_option('processing', 'redirect_checkout')) {
632
- wp_safe_redirect(wc_get_checkout_url());
633
- exit;
634
- }
635
-
636
- if ('yes' === get_option('woocommerce_cart_redirect_after_add')) {
637
- wp_safe_redirect(wc_get_cart_url());
638
- exit;
639
- }
640
-
641
- return true;
642
- }
643
- }
644
-
645
- return false;
646
- }
647
-
648
- /**
649
- * Output page
650
- *
651
- * @param array $atts Array parameter for shortcode.
652
- *
653
- * @return mixed
654
- */
655
- function htmloutput($atts)
656
- {
657
- $wishlist = $this->get_current_wishlist();
658
-
659
- if (empty($wishlist)) {
660
- $id = get_query_var('tinvwlID', null);
661
- if (empty($id) && (is_user_logged_in() || !tinv_get_option('general', 'require_login'))) {
662
- return $this->wishlist_empty(array(), array(
663
- 'ID' => '',
664
- 'author' => get_current_user_id(),
665
- 'title' => apply_filters('tinvwl_default_wishlist_title', tinv_get_option('general', 'default_title')),
666
- 'status' => 'private',
667
- 'type' => 'default',
668
- 'share_key' => '',
669
- ));
670
- }
671
-
672
- return $this->wishlist_null();
673
- }
674
-
675
- if ('private' === $wishlist['status'] && !$wishlist['is_owner']) {
676
- return $this->wishlist_null();
677
- }
678
- if ('default' !== $wishlist['type'] && !tinv_get_option('general', 'multi')) {
679
- if ($wishlist['is_owner']) {
680
- printf('<p><a href="%s">%s</p><script type="text/javascript">window.location.href="%s"</script>', esc_attr(tinv_url_wishlist_default()), esc_html__('Return to Wishlist', 'ti-woocommerce-wishlist'), esc_attr(tinv_url_wishlist_default()));
681
-
682
- return false;
683
- } else {
684
- return $this->wishlist_null();
685
- }
686
- }
687
-
688
- $this->lists_per_page = absint($atts['lists_per_page']);
689
-
690
- if (10 === $this->lists_per_page && is_array($this->get_current_products_query())) {
691
- $products = $this->current_products_query;
692
- } else {
693
- $products = $this->get_current_products($wishlist, true, $this->lists_per_page);
694
- }
695
-
696
- $wla = new TInvWL_Analytics($wishlist, $this->_name);
697
- $wla->view_products($wishlist, $wishlist['is_owner']);
698
-
699
- foreach ($products as $key => $product) {
700
- if (!isset($product['data'])) {
701
- unset($products[$key]);
702
- }
703
- }
704
-
705
- if (empty($products)) {
706
-
707
- $this->pages = 0;
708
-
709
- return $this->wishlist_empty($products, $wishlist);
710
- }
711
-
712
- $wishlist_table_row = tinv_get_option('product_table');
713
- $wishlist_table_row['text_add_to_cart'] = apply_filters('tinvwl_add_to_cart_text', tinv_get_option('product_table', 'text_add_to_cart'));
714
-
715
- $data = array(
716
- 'products' => $products,
717
- 'wishlist' => $wishlist,
718
- 'wishlist_table' => tinv_get_option('table'),
719
- 'wishlist_table_row' => $wishlist_table_row,
720
- );
721
-
722
- $paged = absint(get_query_var('wl_paged', 1));
723
- $paged = $this->pages < $paged ? $this->pages : $paged;
724
-
725
- if (1 < $paged) {
726
- add_action('tinvwl_pagenation_wishlist', array($this, 'page_prev'));
727
- }
728
-
729
- if (1 < $this->pages) {
730
- add_action('tinvwl_pagenation_wishlist', array($this, 'pages'));
731
- }
732
- if ($this->pages > $paged) {
733
- add_action('tinvwl_pagenation_wishlist', array($this, 'page_next'));
734
- }
735
-
736
- if ($wishlist['is_owner']) {
737
- tinv_wishlist_template('ti-wishlist.php', $data);
738
- } else {
739
- if (class_exists('WC_Catalog_Visibility_Options')) {
740
- global $wc_cvo;
741
- if ('secured' === $wc_cvo->setting('wc_cvo_atc' && isset($data['wishlist_table_row']['add_to_cart']))) {
742
- unset($data['wishlist_table_row']['add_to_cart']);
743
- }
744
- if ('secured' === $wc_cvo->setting('wc_cvo_prices' && isset($data['wishlist_table_row']['colm_price']))) {
745
- unset($data['wishlist_table_row']['colm_price']);
746
- }
747
- }
748
-
749
- tinv_wishlist_template('ti-wishlist-user.php', $data);
750
- }
751
- }
752
-
753
- /**
754
- * Not Found Wishlist
755
- *
756
- * @param array $wishlist Wishlist object.
757
- */
758
- function wishlist_null($wishlist = array())
759
- {
760
- $data = array(
761
- 'wishlist' => $wishlist,
762
- );
763
- tinv_wishlist_template('ti-wishlist-null.php', $data);
764
- }
765
-
766
- /**
767
- * Empty Wishlist
768
- *
769
- * @param array $products Products wishlist.
770
- * @param array $wishlist Wishlist object.
771
- */
772
- function wishlist_empty($products = array(), $wishlist = array())
773
- {
774
- $data = array(
775
- 'products' => $products,
776
- 'wishlist' => $wishlist,
777
- 'wishlist_table' => tinv_get_option('table'),
778
- );
779
- tinv_wishlist_template('ti-wishlist-empty.php', $data);
780
- }
781
-
782
- /**
783
- * Header Wishlist
784
- *
785
- * @param array $wishlist Wishlist object.
786
- */
787
- function wishlist_header($wishlist)
788
- {
789
-
790
- $data = array(
791
- 'wishlist' => $wishlist,
792
- );
793
- tinv_wishlist_template('ti-wishlist-header.php', $data);
794
- }
795
-
796
- /**
797
- * Prev page button
798
- */
799
- function page_prev()
800
- {
801
- $paged = absint(get_query_var('wl_paged', 1));
802
- $paged = $this->pages < $paged ? $this->pages : $paged;
803
- $paged = 1 < $paged ? $paged - 1 : 0;
804
- $this->page($paged, sprintf('<i class="ftinvwl ftinvwl-chevron-left"></i><span>%s</span>', __('Previous Page', 'ti-woocommerce-wishlist')), array('class' => 'button tinv-prev'));
805
- }
806
-
807
- /**
808
- * Pages
809
- */
810
- function pages()
811
- {
812
-
813
- $paged = absint(get_query_var('wl_paged', 1));
814
- $paged = $this->pages < $paged ? $this->pages : $paged;
815
- if (1 === (int)$paged) {
816
- echo '<span></span>';
817
- }
818
-
819
- echo '<span>' . $paged . '/' . $this->pages . '</span>';
820
-
821
- if ((int)$this->pages === (int)$paged) {
822
- echo '<span></span>';
823
- }
824
- }
825
-
826
- /**
827
- * Next page button
828
- */
829
- function page_next()
830
- {
831
- $paged = absint(get_query_var('wl_paged', 1));
832
- $paged = $this->pages < $paged ? $this->pages : $paged;
833
- $paged = 1 < $paged ? $paged + 1 : 2;
834
- $this->page($paged, sprintf('<span>%s</span><i class="ftinvwl ftinvwl-chevron-right"></i>', __('Next Page', 'ti-woocommerce-wishlist')), array('class' => 'button tinv-next'));
835
- }
836
-
837
- /**
838
- * Page button
839
- *
840
- * @param integer $paged Index page.
841
- * @param string $text Text button.
842
- * @param style $style Style attribute.
843
- */
844
- function page($paged, $text, $style = array())
845
- {
846
- $paged = absint($paged);
847
- $wishlist = $this->get_current_wishlist();
848
- $link = tinv_url_wishlist($wishlist['share_key'], $paged, true);
849
- if (is_array($style)) {
850
- $style = TInvWL_Form::__atrtostr($style);
851
- }
852
- printf('<a href="%s" %s>%s</a>', esc_url($link), $style, $text); // WPCS: xss ok.
853
- }
854
-
855
- /**
856
- * Shortcode basic function
857
- *
858
- * @param array $atts Array parameter from shortcode.
859
- *
860
- * @return string
861
- */
862
- function shortcode($atts = array())
863
- {
864
- $default = array(
865
- 'lists_per_page' => 10,
866
- );
867
- $atts = shortcode_atts($default, $atts);
868
-
869
- ob_start();
870
- $this->htmloutput($atts);
871
-
872
- return ob_get_clean();
873
- }
874
-
875
- /**
876
- * Get per page items for buttons
877
- */
878
- function get_per_page()
879
- {
880
- if (!empty($this->lists_per_page)) {
881
- echo TInvWL_Form::_text(array( // WPCS: xss ok.
882
- 'type' => 'hidden',
883
- 'name' => 'lists_per_page',
884
- ), $this->lists_per_page);
885
- }
886
- }
887
- }
1
+ <?php
2
+ /**
3
+ * Wishlist shortcode
4
+ *
5
+ * @since 1.0.0
6
+ * @package TInvWishlist\Public
7
+ */
8
+
9
+ // If this file is called directly, abort.
10
+ if (!defined('ABSPATH')) {
11
+ die;
12
+ }
13
+
14
+ /**
15
+ * Wishlist shortcode
16
+ */
17
+ class TInvWL_Public_Wishlist_View
18
+ {
19
+
20
+ /**
21
+ * Plugin name
22
+ *
23
+ * @var string
24
+ */
25
+ private $_name;
26
+
27
+ /**
28
+ * List per page
29
+ *
30
+ * @var integer
31
+ */
32
+ private $lists_per_page;
33
+
34
+ /**
35
+ * Current wishlist
36
+ *
37
+ * @var array
38
+ */
39
+ private $current_wishlist;
40
+
41
+ /**
42
+ * Current products
43
+ *
44
+ * @var array
45
+ */
46
+ private $current_products_query;
47
+
48
+ /**
49
+ * Social image
50
+ *
51
+ * @var string
52
+ */
53
+ public $social_image;
54
+
55
+ /**
56
+ * Total pages
57
+ *
58
+ * @var int
59
+ */
60
+ public $pages;
61
+
62
+ /**
63
+ * Wishlist full URL
64
+ *
65
+ * @var string
66
+ */
67
+ public $wishlist_url;
68
+
69
+ /**
70
+ * Wishlist product helper
71
+ *
72
+ * @var TInvWL_Product
73
+ */
74
+ public $wishlist_products_helper;
75
+
76
+ /**
77
+ * This class
78
+ *
79
+ * @var \TInvWL_Public_Wishlist_View
80
+ */
81
+ protected static $_instance = null;
82
+
83
+ /**
84
+ * Get this class object
85
+ *
86
+ * @param string $plugin_name Plugin name.
87
+ *
88
+ * @return \TInvWL_Public_Wishlist_View
89
+ */
90
+ public static function instance($plugin_name = TINVWL_PREFIX)
91
+ {
92
+ if (is_null(self::$_instance)) {
93
+ self::$_instance = new self($plugin_name);
94
+ }
95
+
96
+ return self::$_instance;
97
+ }
98
+
99
+ /**
100
+ * Constructor
101
+ *
102
+ * @param string $plugin_name Plugin name.
103
+ */
104
+ function __construct($plugin_name)
105
+ {
106
+ $this->_name = $plugin_name;
107
+ $this->define_hooks();
108
+ }
109
+
110
+ /**
111
+ * Defined shortcode and hooks
112
+ */
113
+ function define_hooks()
114
+ {
115
+ add_action('template_redirect', array($this, 'login_redirect'));
116
+
117
+ add_action('wp_loaded', array($this, 'login_post_redirect'), 19);
118
+
119
+ add_action('wp', array($this, 'wishlist_action'), 0);
120
+ add_action('wp_head', array($this, 'add_meta_tags'), 1);
121
+
122
+ add_action('tinvwl_before_wishlist', array($this, 'wishlist_header'));
123
+
124
+ add_action('tinvwl_after_wishlist', array('TInvWL_Public_Wishlist_Social', 'init'));
125
+ add_filter('tinvwl_wishlist_item_url', array($this, 'add_argument'), 10, 3);
126
+ add_filter('tinvwl_wishlist_item_action_add_to_cart', array($this, 'product_allow_add_to_cart'), 10, 3);
127
+ add_filter('tinvwl_wishlist_item_add_to_cart', array($this, 'external_text'), 10, 3);
128
+ add_filter('tinvwl_wishlist_item_add_to_cart', array($this, 'variable_text'), 10, 3);
129
+ add_action('tinvwl_after_wishlist_table', array($this, 'get_per_page'));
130
+
131
+ TInvWL_Public_Wishlist_Buttons::init($this->_name);
132
+ }
133
+
134
+ /**
135
+ * Redirect back after successful login.
136
+ */
137
+ public function login_post_redirect()
138
+ {
139
+ $nonce_value = isset($_REQUEST['woocommerce-login-nonce']) ? $_REQUEST['woocommerce-login-nonce'] : (isset($_REQUEST['_wpnonce']) ? $_REQUEST['_wpnonce'] : '');
140
+ if (!empty($_POST['login']) && wp_verify_nonce($nonce_value, 'woocommerce-login') && !empty($_GET['tinvwl_redirect'])) {
141
+ $_POST['redirect'] = $_GET['tinvwl_redirect']; // Force WC Login form handler to do redirect.
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Redirect guests to login page.
147
+ */
148
+ public function login_redirect()
149
+ {
150
+ if (!wc_get_page_id('myaccount') && is_page(apply_filters('wpml_object_id', tinv_get_option('page', 'wishlist'), 'page', true)) && !is_user_logged_in() && tinv_get_option('general', 'require_login')) {
151
+ $full_link = get_permalink();
152
+ $share_key = get_query_var('tinvwlID', null);
153
+ if (!empty($share_key)) {
154
+ if (get_option('permalink_structure')) {
155
+ if (!preg_match('/\/$/', $full_link)) {
156
+ $full_link .= '/';
157
+ }
158
+ $full_link .= $share_key . '/';
159
+ } else {
160
+ $full_link = add_query_arg('tinvwlID', $share_key, $full_link);
161
+ }
162
+ }
163
+ wp_safe_redirect(add_query_arg('tinvwl_redirect', rawurlencode($full_link), wc_get_page_permalink('myaccount')));
164
+ exit;
165
+ }
166
+ }
167
+
168
+ /**
169
+ * Change Text for external product
170
+ *
171
+ * @param string $text Text for button add to cart.
172
+ * @param array $wl_product Wishlist Product.
173
+ * @param WC_Product $_product Product.
174
+ *
175
+ * @return string
176
+ */
177
+ function external_text($text, $wl_product, $_product)
178
+ {
179
+ global $product;
180
+ // store global product data.
181
+ $_product_tmp = $product;
182
+ // override global product data.
183
+ $product = $_product;
184
+
185
+ if ('external' === ($product->get_type())) {
186
+
187
+ $text = $product->single_add_to_cart_text();
188
+
189
+ // restore global product data.
190
+ $product = $_product_tmp;
191
+ }
192
+
193
+ return $text;
194
+ }
195
+
196
+ /**
197
+ * Change Text for variable product that requires to select some variations.
198
+ *
199
+ * @param string $text Text for button add to cart.
200
+ * @param array $wl_product Wishlist Product.
201
+ * @param WC_Product $_product Product.
202
+ *
203
+ * @return string
204
+ */
205
+ function variable_text($text, $wl_product, $_product)
206
+ {
207
+ global $product;
208
+ // store global product data.
209
+ $_product_tmp = $product;
210
+ // override global product data.
211
+ $product = $_product;
212
+ if (apply_filters('tinvwl_product_add_to_cart_need_redirect', false, $product, $product->get_permalink(), $wl_product)
213
+ && in_array($product->get_type(), array(
214
+ 'variable',
215
+ 'variable-subscription',
216
+ ))) {
217
+
218
+ $text = $product->add_to_cart_text();
219
+
220
+ // restore global product data.
221
+ $product = $_product_tmp;
222
+ }
223
+
224
+ return $text;
225
+ }
226
+
227
+ /**
228
+ * Add analytics argument for url
229
+ *
230
+ * @param string $url Product url.
231
+ * @param array $wl_product Wishlist product.
232
+ * @param object $product Product.
233
+ *
234
+ * @return type
235
+ */
236
+ function add_argument($url, $wl_product, $product)
237
+ {
238
+ return add_query_arg('tiwp', $wl_product['ID'], $url);
239
+ }
240
+
241
+ /**
242
+ * Get current wishlist
243
+ *
244
+ * @return array
245
+ */
246
+ function get_current_wishlist()
247
+ {
248
+ if (empty($this->current_wishlist)) {
249
+ $this->current_wishlist = apply_filters('tinvwl_get_current_wishlist', tinv_wishlist_get());
250
+ }
251
+
252
+ return $this->current_wishlist;
253
+ }
254
+
255
+ /**
256
+ * Get current products query
257
+ *
258
+ * @return array
259
+ */
260
+ function get_current_products_query()
261
+ {
262
+ if (!is_array($this->current_products_query)) {
263
+ return false;
264
+ }
265
+
266
+ return $this->current_products_query;
267
+ }
268
+
269
+ /**
270
+ * Get current products from wishlist
271
+ *
272
+ * @param array $wishlist Wishlist object.
273
+ * @param boolean $external Get woocommerce product info.
274
+ * @param integer $lists_per_page Count per page.
275
+ *
276
+ * @return array
277
+ */
278
+ function get_current_products($wishlist = null, $external = true, $lists_per_page = 10)
279
+ {
280
+ if (empty($wishlist) || $wishlist === $this->get_current_wishlist()) {
281
+ $wishlist = $this->get_current_wishlist();
282
+
283
+ if (!$this->wishlist_products_helper) {
284
+ $wlp = null;
285
+ if (isset($wishlist['ID']) && 0 === $wishlist['ID']) {
286
+ $wlp = TInvWL_Product_Local::instance();
287
+ } else {
288
+ $wlp = new TInvWL_Product($wishlist);
289
+ }
290
+ $this->wishlist_products_helper = $wlp;
291
+ } else {
292
+ $wlp = $this->wishlist_products_helper;
293
+ }
294
+
295
+ } else {
296
+ $wlp = null;
297
+ if (isset($wishlist['ID']) && 0 === $wishlist['ID']) {
298
+ $wlp = TInvWL_Product_Local::instance();
299
+ } else {
300
+ $wlp = new TInvWL_Product($wishlist);
301
+ }
302
+ }
303
+
304
+ if (empty($wlp)) {
305
+ return array();
306
+ }
307
+
308
+ $paged = absint(get_query_var('wl_paged', 1));
309
+ $this->pages = ceil(absint($wlp->get_wishlist(array(
310
+ 'count' => 9999999,
311
+ 'external' => false,
312
+ ), true)) / absint($lists_per_page));
313
+
314
+ $paged = $this->pages < $paged ? $this->pages : $paged;
315
+
316
+ $product_data = array(
317
+ 'count' => absint($lists_per_page),
318
+ 'offset' => absint($lists_per_page) * (absint($paged) - 1),
319
+ 'external' => $external,
320
+ 'order_by' => 'date',
321
+ 'order' => 'DESC',
322
+ );
323
+
324
+ $product_data = apply_filters('tinvwl_before_get_current_product', $product_data);
325
+ $products = $wlp->get_wishlist($product_data);
326
+ $products = apply_filters('tinvwl_after_get_current_product', $products);
327
+
328
+ if (10 === absint($lists_per_page)) {
329
+ $this->current_products_query = $products;
330
+ }
331
+
332
+ return $products;
333
+ }
334
+
335
+ /**
336
+ * Allow show button add to cart
337
+ *
338
+ * @param boolean $allow Settings flag.
339
+ * @param array $wlproduct Wishlist Product.
340
+ * @param WC_Product $product Product.
341
+ *
342
+ * @return boolean
343
+ */
344
+ function product_allow_add_to_cart($allow, $wlproduct, $product)
345
+ {
346
+ if (!$allow) {
347
+ return false;
348
+ }
349
+
350
+ return ($product->is_purchasable() || 'external' === $product->get_type()) && ($product->is_in_stock() || $product->backorders_allowed());
351
+ }
352
+
353
+ /**
354
+ * Basic validation actions
355
+ *
356
+ * @return boolean
357
+ */
358
+ function wishlist_action()
359
+ {
360
+
361
+ $wishlist_page_id = apply_filters('wpml_object_id', tinv_get_option('page', 'wishlist'), 'page', true);
362
+
363
+ if (is_page($wishlist_page_id)
364
+ || (is_home() && 'page' === get_option('show_on_front') && absint(get_option('page_on_front')) === $wishlist_page_id)
365
+ || (is_shop() && wc_get_page_id('shop') === $wishlist_page_id)) {
366
+ $wishlist = $this->get_current_wishlist();
367
+ if (empty($wishlist)) {
368
+ return false;
369
+ }
370
+
371
+ if (version_compare(WC_VERSION, '3.2.0', '<')) {
372
+ if (!defined('DONOTCACHEPAGE')) {
373
+ define('DONOTCACHEPAGE', true);
374
+ }
375
+ if (!defined('DONOTCACHEOBJECT')) {
376
+ define('DONOTCACHEOBJECT', true);
377
+ }
378
+ if (!defined('DONOTCACHEDB')) {
379
+ define('DONOTCACHEDB', true);
380
+ }
381
+ } else {
382
+ WC_Cache_Helper::set_nocache_constants(true);
383
+ nocache_headers();
384
+ }
385
+
386
+ $is_owner = is_user_logged_in() ? (get_current_user_id() === $wishlist['author']) : $wishlist['is_owner'];
387
+ $nonce = filter_input(INPUT_POST, 'wishlist_nonce');
388
+ if ($nonce && wp_verify_nonce($nonce, 'tinvwl_wishlist_owner') && $is_owner) {
389
+ do_action('tinvwl_before_action_owner', $wishlist);
390
+ $this->wishlist_actions($wishlist, true);
391
+ do_action('tinvwl_after_action_owner', $wishlist);
392
+ }
393
+ if ($nonce && wp_verify_nonce($nonce, 'tinvwl_wishlist_user') && !$is_owner) {
394
+ do_action('tinvwl_before_action_user', $wishlist);
395
+ $this->wishlist_actions($wishlist, false);
396
+ do_action('tinvwl_after_action_user', $wishlist);
397
+ }
398
+ }
399
+ }
400
+
401
+ /**
402
+ * Create social meta tags
403
+ */
404
+ function add_meta_tags()
405
+ {
406
+ if (is_page(apply_filters('wpml_object_id', tinv_get_option('page', 'wishlist'), 'page', true))) {
407
+ $wishlist = $this->get_current_wishlist();
408
+ if ($wishlist && 0 < $wishlist['ID']) {
409
+ $this->wishlist_url = tinv_url_wishlist($wishlist['share_key']);
410
+ if ('private' !== $wishlist['status'] && tinv_get_option('social', 'facebook')) {
411
+ if (is_user_logged_in()) {
412
+ $user = get_user_by('id', $wishlist['author']);
413
+ if ($user && $user->exists()) {
414
+ $user_name = trim(sprintf('%s %s', $user->user_firstname, $user->user_lastname));
415
+ $user = @$user->display_name; // @codingStandardsIgnoreLine Generic.PHP.NoSilencedErrors.Discouraged
416
+ } else {
417
+ $user_name = '';
418
+ $user = '';
419
+ }
420
+ } else {
421
+ $user_name = '';
422
+ $user = '';
423
+ }
424
+
425
+ if (is_array($this->get_current_products_query())) {
426
+ $products = $this->current_products_query;
427
+ } else {
428
+ $products = $this->get_current_products($wishlist, true);
429
+ }
430
+
431
+ $products_title = array();
432
+ foreach ($products as $product) {
433
+ if (!empty($product) && !empty($product['data'])) {
434
+ $title = is_callable(array(
435
+ $product['data'],
436
+ 'get_name'
437
+ )) ? $product['data']->get_name() : $product['data']->get_title();
438
+ if (!in_array($title, $products_title)) {
439
+ $products_title[] = $title;
440
+ }
441
+ }
442
+ }
443
+ $product = array_shift($products);
444
+ $image = '';
445
+ if (!empty($product) && !empty($product['data'])) {
446
+ list($image) = wp_get_attachment_image_src($product['data']->get_image_id(), 'full');
447
+ }
448
+
449
+ $this->social_image = $image;
450
+
451
+
452
+ $meta = apply_filters('tinvwl_social_header_meta', array(
453
+ 'url' => $this->wishlist_url,
454
+ 'type' => 'product.group',
455
+ 'title' => sprintf(__('%1$s by %2$s', 'ti-woocommerce-wishlist'), $wishlist['title'], (empty($user_name) ? $user : $user_name)),
456
+ 'description' => implode(', ', $products_title),
457
+ 'image' => $image,
458
+ ));
459
+
460
+ foreach ($meta as $name => $content) {
461
+ echo sprintf('<meta property="og:%s" content="%s" />', esc_attr($name), esc_attr($content));
462
+ }
463
+ echo "\n";
464
+ }
465
+ } // End if().
466
+ } // End if().
467
+ }
468
+
469
+ /**
470
+ * Basic actions
471
+ *
472
+ * @param array $wishlist Wishlist object.
473
+ * @param boolean $owner Is Owner.
474
+ *
475
+ * @return boolean
476
+ */
477
+ function wishlist_actions($wishlist, $owner = false)
478
+ {
479
+ $post = filter_input_array(INPUT_POST, array(
480
+ 'wishlist_pr' => array(
481
+ 'filter' => FILTER_VALIDATE_INT,
482
+ 'flags' => FILTER_FORCE_ARRAY,
483
+ ),
484
+ 'wishlist_qty' => array(
485
+ 'filter' => FILTER_VALIDATE_INT,
486
+ 'flags' => FILTER_FORCE_ARRAY,
487
+ 'options' => array('min_range' => 0, 'default' => 1),
488
+ ),
489
+ 'tinvwl-add-to-cart' => FILTER_VALIDATE_INT,
490
+ 'tinvwl-remove' => FILTER_VALIDATE_INT,
491
+ 'tinvwl-action' => FILTER_SANITIZE_STRING,
492
+ ));
493
+
494
+ if (!empty($post['tinvwl-add-to-cart'])) {
495
+ $product = $post['tinvwl-add-to-cart'];
496
+ $quantity = array_key_exists($product, (array)$post['wishlist_qty']) ? $post['wishlist_qty'][$product] : 1;
497
+
498
+ return $this->button_addtocart($wishlist, $product, $quantity, $owner);
499
+ }
500
+ if (!empty($post['tinvwl-remove'])) {
501
+ if (!$wishlist['is_owner']) {
502
+ return false;
503
+ }
504
+ $product = $post['tinvwl-remove'];
505
+ if (0 === $wishlist['ID']) {
506
+ $wlp = TInvWL_Product_Local::instance();
507
+ } else {
508
+ $wlp = new TInvWL_Product($wishlist);
509
+ }
510
+ if (empty($wlp)) {
511
+ return false;
512
+ }
513
+ $product_data = $wlp->get_wishlist(array('ID' => $product));
514
+ $product_data = array_shift($product_data);
515
+ if (empty($product_data)) {
516
+ return false;
517
+ }
518
+ $title = sprintf(__('&ldquo;%s&rdquo;', 'ti-woocommerce-wishlist'), is_callable(array(
519
+ $product_data['data'],
520
+ 'get_name'
521
+ )) ? $product_data['data']->get_name() : $product_data['data']->get_title());
522
+ if ($wlp->remove($product_data)) {
523
+ add_action('tinvwl_before_wishlist', array(
524
+ 'TInvWL_Public_Wishlist_View',
525
+ 'check_cart_hash',
526
+ ), 99, 1);
527
+ add_action('woocommerce_set_cart_cookies', array(
528
+ 'TInvWL_Public_Wishlist_View',
529
+ 'reset_cart_hash',
530
+ ), 99, 1);
531
+ wc_add_notice(sprintf(__('%s has been removed from wishlist.', 'ti-woocommerce-wishlist'), $title));
532
+ } else {
533
+ wc_add_notice(sprintf(__('%s has not been removed from wishlist.', 'ti-woocommerce-wishlist'), $title), 'error');
534
+ }
535
+
536
+ return true;
537
+ }
538
+ do_action('tinvwl_action_' . $post['tinvwl-action'], $wishlist, $post['wishlist_pr'], $post['wishlist_qty'], $owner); // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidHookName.UseUnderscores
539
+ }
540
+
541
+ /**
542
+ * Check cart hash to trigger WC fragments refresh on wishlist update.
543
+ *
544
+ * @param $wishlist
545
+ */
546
+ public static function check_cart_hash($wishlist)
547
+ {
548
+ wp_add_inline_script('woocommerce', "
549
+ jQuery(document).ready(function($){
550
+ if ( typeof wc_cart_fragments_params === 'undefined' ) {
551
+ return false;
552
+ }
553
+
554
+ var cart_hash_key = wc_cart_fragments_params.cart_hash_key,
555
+ cart_hash = sessionStorage.getItem( cart_hash_key );
556
+
557
+ if ( cart_hash === null || cart_hash === undefined || cart_hash === '' ) {
558
+ sessionStorage.setItem( cart_hash_key, 'empty' );
559
+ }
560
+ });
561
+ ");
562
+ }
563
+
564
+ /**
565
+ * Reset cart hash to trigger WC fragments refresh on wishlist update.
566
+ *
567
+ * @param bool $set
568
+ */
569
+ public static function reset_cart_hash($set)
570
+ {
571
+ wc_setcookie('woocommerce_cart_hash', 'reset', time() - HOUR_IN_SECONDS);
572
+ }
573
+
574
+ /**
575
+ * Apply action add to cart
576
+ *
577
+ * @param array $wishlist Wishlist object.
578
+ * @param integer $id Product id in wishlist.
579
+ * @param integer $quantity Product quantity.
580
+ * @param boolean $owner Is Owner.
581
+ *
582
+ * @return boolean
583
+ */
584
+ function button_addtocart($wishlist, $id, $quantity = 1, $owner = false)
585
+ {
586
+ $id = absint($id);
587
+ $quantity = absint($quantity);
588
+ if (empty($id) || empty($quantity)) {
589
+ return false;
590
+ }
591
+
592
+ $wlp = null;
593
+ if (0 === $wishlist['ID']) {
594
+ $wlp = TInvWL_Product_Local::instance();
595
+ } else {
596
+ $wlp = new TInvWL_Product($wishlist);
597
+ }
598
+ if (empty($wlp)) {
599
+ return false;
600
+ }
601
+
602
+ $_product = $wlp->get_wishlist(array('ID' => $id));
603
+ $_product = array_shift($_product);
604
+ if (empty($_product) || empty($_product['data'])) {
605
+ return false;
606
+ }
607
+
608
+ global $product;
609
+ // store global product data.
610
+ $_product_tmp = $product;
611
+ // override global product data.
612
+ $product = $_product['data'];
613
+
614
+ add_filter('clean_url', 'tinvwl_clean_url', 10, 2);
615
+ $redirect_url = $_product['data']->add_to_cart_url();
616
+ remove_filter('clean_url', 'tinvwl_clean_url', 10);
617
+
618
+ // restore global product data.
619
+ $product = $_product_tmp;
620
+
621
+ $quantity = apply_filters('tinvwl_product_add_to_cart_quantity', $quantity, $_product['data']);
622
+
623
+ if (apply_filters('tinvwl_product_add_to_cart_need_redirect', false, $_product['data'], $redirect_url, $_product)) {
624
+ wp_redirect(apply_filters('tinvwl_product_add_to_cart_redirect_url', $redirect_url, $_product['data'], $_product)); // @codingStandardsIgnoreLine WordPress.VIP.RestrictedFunctions.wp_redirect
625
+ exit;
626
+ } elseif (apply_filters('tinvwl_allow_addtocart_in_wishlist', true, $wishlist, $owner)) {
627
+ $add = TInvWL_Public_Cart::add($wishlist, $id, $quantity);
628
+ if ($add) {
629
+ wc_add_to_cart_message($add, true);
630
+
631
+ if (tinv_get_option('processing', 'redirect_checkout')) {
632
+ wp_safe_redirect(wc_get_checkout_url());
633
+ exit;
634
+ }
635
+
636
+ if ('yes' === get_option('woocommerce_cart_redirect_after_add')) {
637
+ wp_safe_redirect(wc_get_cart_url());
638
+ exit;
639
+ }
640
+
641
+ return true;
642
+ }
643
+ }
644
+
645
+ return false;
646
+ }
647
+
648
+ /**
649
+ * Output page
650
+ *
651
+ * @param array $atts Array parameter for shortcode.
652
+ *
653
+ * @return mixed
654
+ */
655
+ function htmloutput($atts)
656
+ {
657
+ $wishlist = $this->get_current_wishlist();
658
+
659
+ if (empty($wishlist)) {
660
+ $id = get_query_var('tinvwlID', null);
661
+ if (empty($id) && (is_user_logged_in() || !tinv_get_option('general', 'require_login'))) {
662
+ return $this->wishlist_empty(array(), array(
663
+ 'ID' => '',
664
+ 'author' => get_current_user_id(),
665
+ 'title' => apply_filters('tinvwl_default_wishlist_title', tinv_get_option('general', 'default_title')),
666
+ 'status' => 'private',
667
+ 'type' => 'default',
668
+ 'share_key' => '',
669
+ ));
670
+ }
671
+
672
+ return $this->wishlist_null();
673
+ }
674
+
675
+ if ('private' === $wishlist['status'] && !$wishlist['is_owner']) {
676
+ return $this->wishlist_null();
677
+ }
678
+ if ('default' !== $wishlist['type'] && !tinv_get_option('general', 'multi')) {
679
+ if ($wishlist['is_owner']) {
680
+ printf('<p><a href="%s">%s</p><script type="text/javascript">window.location.href="%s"</script>', esc_attr(tinv_url_wishlist_default()), esc_html__('Return to Wishlist', 'ti-woocommerce-wishlist'), esc_attr(tinv_url_wishlist_default()));
681
+
682
+ return false;
683
+ } else {
684
+ return $this->wishlist_null();
685
+ }
686
+ }
687
+
688
+ $this->lists_per_page = absint($atts['lists_per_page']);
689
+
690
+ if (10 === $this->lists_per_page && is_array($this->get_current_products_query())) {
691
+ $products = $this->current_products_query;
692
+ } else {
693
+ $products = $this->get_current_products($wishlist, true, $this->lists_per_page);
694
+ }
695
+
696
+ $wla = new TInvWL_Analytics($wishlist, $this->_name);
697
+ $wla->view_products($wishlist, $wishlist['is_owner']);
698
+
699
+ foreach ($products as $key => $product) {
700
+ if (!isset($product['data'])) {
701
+ unset($products[$key]);
702
+ }
703
+ }
704
+
705
+ if (empty($products)) {
706
+
707
+ $this->pages = 0;
708
+
709
+ return $this->wishlist_empty($products, $wishlist);
710
+ }
711
+
712
+ $wishlist_table_row = tinv_get_option('product_table');
713
+ $wishlist_table_row['text_add_to_cart'] = apply_filters('tinvwl_add_to_cart_text', tinv_get_option('product_table', 'text_add_to_cart'));
714
+
715
+ $data = array(
716
+ 'products' => $products,
717
+ 'wishlist' => $wishlist,
718
+ 'wishlist_table' => tinv_get_option('table'),
719
+ 'wishlist_table_row' => $wishlist_table_row,
720
+ );
721
+
722
+ $paged = absint(get_query_var('wl_paged', 1));
723
+ $paged = $this->pages < $paged ? $this->pages : $paged;
724
+
725
+ if (1 < $paged) {
726
+ add_action('tinvwl_pagenation_wishlist', array($this, 'page_prev'));
727
+ }
728
+
729
+ if (1 < $this->pages) {
730
+ add_action('tinvwl_pagenation_wishlist', array($this, 'pages'));
731
+ }
732
+ if ($this->pages > $paged) {
733
+ add_action('tinvwl_pagenation_wishlist', array($this, 'page_next'));
734
+ }
735
+
736
+ if ($wishlist['is_owner']) {
737
+ tinv_wishlist_template('ti-wishlist.php', $data);
738
+ } else {
739
+ if (class_exists('WC_Catalog_Visibility_Options')) {
740
+ global $wc_cvo;
741
+ if ('secured' === $wc_cvo->setting('wc_cvo_atc' && isset($data['wishlist_table_row']['add_to_cart']))) {
742
+ unset($data['wishlist_table_row']['add_to_cart']);
743
+ }
744
+ if ('secured' === $wc_cvo->setting('wc_cvo_prices' && isset($data['wishlist_table_row']['colm_price']))) {
745
+ unset($data['wishlist_table_row']['colm_price']);
746
+ }
747
+ }
748
+
749
+ tinv_wishlist_template('ti-wishlist-user.php', $data);
750
+ }
751
+ }
752
+
753
+ /**
754
+ * Not Found Wishlist
755
+ *
756
+ * @param array $wishlist Wishlist object.
757
+ */
758
+ function wishlist_null($wishlist = array())
759
+ {
760
+ $data = array(
761
+ 'wishlist' => $wishlist,
762
+ );
763
+ tinv_wishlist_template('ti-wishlist-null.php', $data);
764
+ }
765
+
766
+ /**
767
+ * Empty Wishlist
768
+ *
769
+ * @param array $products Products wishlist.
770
+ * @param array $wishlist Wishlist object.
771
+ */
772
+ function wishlist_empty($products = array(), $wishlist = array())
773
+ {
774
+ $data = array(
775
+ 'products' => $products,
776
+ 'wishlist' => $wishlist,
777
+ 'wishlist_table' => tinv_get_option('table'),
778
+ );
779
+ tinv_wishlist_template('ti-wishlist-empty.php', $data);
780
+ }
781
+
782
+ /**
783
+ * Header Wishlist
784
+ *
785
+ * @param array $wishlist Wishlist object.
786
+ */
787
+ function wishlist_header($wishlist)
788
+ {
789
+
790
+ $data = array(
791
+ 'wishlist' => $wishlist,
792
+ );
793
+ tinv_wishlist_template('ti-wishlist-header.php', $data);
794
+ }
795
+
796
+ /**
797
+ * Prev page button
798
+ */
799
+ function page_prev()
800
+ {
801
+ $paged = absint(get_query_var('wl_paged', 1));
802
+ $paged = $this->pages < $paged ? $this->pages : $paged;
803
+ $paged = 1 < $paged ? $paged - 1 : 0;
804
+ $this->page($paged, sprintf('<i class="ftinvwl ftinvwl-chevron-left"></i><span>%s</span>', __('Previous Page', 'ti-woocommerce-wishlist')), array('class' => 'button tinv-prev'));
805
+ }
806
+
807
+ /**
808
+ * Pages
809
+ */
810
+ function pages()
811
+ {
812
+
813
+ $paged = absint(get_query_var('wl_paged', 1));
814
+ $paged = $this->pages < $paged ? $this->pages : $paged;
815
+ if (1 === (int)$paged) {
816
+ echo '<span></span>';
817
+ }
818
+
819
+ echo '<span>' . $paged . '/' . $this->pages . '</span>';
820
+
821
+ if ((int)$this->pages === (int)$paged) {
822
+ echo '<span></span>';
823
+ }
824
+ }
825
+
826
+ /**
827
+ * Next page button
828
+ */
829
+ function page_next()
830
+ {
831
+ $paged = absint(get_query_var('wl_paged', 1));
832
+ $paged = $this->pages < $paged ? $this->pages : $paged;
833
+ $paged = 1 < $paged ? $paged + 1 : 2;
834
+ $this->page($paged, sprintf('<span>%s</span><i class="ftinvwl ftinvwl-chevron-right"></i>', __('Next Page', 'ti-woocommerce-wishlist')), array('class' => 'button tinv-next'));
835
+ }
836
+
837
+ /**
838
+ * Page button
839
+ *
840
+ * @param integer $paged Index page.
841
+ * @param string $text Text button.
842
+ * @param style $style Style attribute.
843
+ */
844
+ function page($paged, $text, $style = array())
845
+ {
846
+ $paged = absint($paged);
847
+ $wishlist = $this->get_current_wishlist();
848
+ $link = tinv_url_wishlist($wishlist['share_key'], $paged, true);
849
+ if (is_array($style)) {
850
+ $style = TInvWL_Form::__atrtostr($style);
851
+ }
852
+ printf('<a href="%s" %s>%s</a>', esc_url($link), $style, $text); // WPCS: xss ok.
853
+ }
854
+
855
+ /**
856
+ * Shortcode basic function
857
+ *
858
+ * @param array $atts Array parameter from shortcode.
859
+ *
860
+ * @return string
861
+ */
862
+ function shortcode($atts = array())
863
+ {
864
+ $default = array(
865
+ 'lists_per_page' => 10,
866
+ );
867
+ $atts = shortcode_atts($default, $atts);
868
+
869
+ ob_start();
870
+ $this->htmloutput($atts);
871
+
872
+ return ob_get_clean();
873
+ }
874
+
875
+ /**
876
+ * Get per page items for buttons
877
+ */
878
+ function get_per_page()
879
+ {
880
+ if (!empty($this->lists_per_page)) {
881
+ echo TInvWL_Form::_text(array( // WPCS: xss ok.
882
+ 'type' => 'hidden',
883
+ 'name' => 'lists_per_page',
884
+ ), $this->lists_per_page);
885
+ }
886
+ }
887
+ }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: templateinvaders
3
  Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
4
  Requires at least: 4.7
5
  Tested up to: 5.8
6
- Stable tag: 1.28.3
7
  License: GPLv3
8
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
9
  Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
@@ -163,7 +163,14 @@ Yes, you can! Join in on our [GitHub repository](https://github.com/TemplateInva
163
 
164
 
165
  == Changelog ==
166
- = 1.28.2 =
 
 
 
 
 
 
 
167
  *Release Date - 25 August 2021*
168
 
169
  * Fixed permalink issue for multilingual setups
3
  Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
4
  Requires at least: 4.7
5
  Tested up to: 5.8
6
+ Stable tag: 1.28.4
7
  License: GPLv3
8
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
9
  Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
163
 
164
 
165
  == Changelog ==
166
+ = 1.28.4 =
167
+ *Release Date - 07 September 2021*
168
+
169
+ * Added integration with [Quick Buy Now Button for WooCommerce](https://woocommerce.com/products/quick-buy-now-button-for-woocommerce/?aff=3955) plugin
170
+ * Updated integration with [WooCommerce Composite Products](https://woocommerce.com/products/composite-products/?aff=3955) plugin
171
+ * Updated integration with [WooCommerce Gravity Forms Product Add-Ons](https://woocommerce.com/products/gravity-forms-add-ons/?aff=3955) plugin
172
+
173
+ = 1.28.3 =
174
  *Release Date - 25 August 2021*
175
 
176
  * Fixed permalink issue for multilingual setups
ti-woocommerce-wishlist.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: TI WooCommerce Wishlist
5
  * Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
6
  * Description: Wishlist functionality for your WooCommerce store.
7
- * Version: 1.28.3
8
  * Requires at least: 4.7
9
  * Tested up to: 5.8
10
  * WC requires at least: 3.0
@@ -41,7 +41,7 @@ if (!defined('TINVWL_DOMAIN')) {
41
  }
42
 
43
  if (!defined('TINVWL_FVERSION')) {
44
- define('TINVWL_FVERSION', '1.28.3');
45
  }
46
 
47
  if (!defined('TINVWL_LOAD_FREE')) {
4
  * Plugin Name: TI WooCommerce Wishlist
5
  * Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
6
  * Description: Wishlist functionality for your WooCommerce store.
7
+ * Version: 1.28.4
8
  * Requires at least: 4.7
9
  * Tested up to: 5.8
10
  * WC requires at least: 3.0
41
  }
42
 
43
  if (!defined('TINVWL_FVERSION')) {
44
+ define('TINVWL_FVERSION', '1.28.4');
45
  }
46
 
47
  if (!defined('TINVWL_LOAD_FREE')) {