Version Description
Release Date - 09 March 2022
- WooCommerce 6.3 support
- Added integration with Anti-Spam by CleanTalk plugin
- Updated integration with WooCommerce Composite Products plugin
Download this release
Release Info
Developer | templateinvaders |
Plugin | WooCommerce Wishlist Plugin |
Version | 1.42.0 |
Comparing to | |
See all releases |
Code changes from version 1.41.1 to 1.42.0
- assets/css/admin-form-rtl.min.css +1 -1
- assets/css/admin-form.min.css +1 -1
- assets/css/admin-rtl.min.css +1 -1
- assets/css/admin-setup-rtl.min.css +1 -1
- assets/css/admin-setup.min.css +1 -1
- assets/css/admin.min.css +1 -1
- assets/css/public-rtl.min.css +1 -1
- assets/css/public.min.css +1 -1
- assets/css/theme-rtl.min.css +1 -1
- assets/css/theme.min.css +1 -1
- assets/css/webfont-rtl.min.css +1 -1
- assets/css/webfont.min.css +1 -1
- assets/js/admin.min.js +1 -1
- assets/js/public.min.js +1 -1
- integrations/cleantalk-spam-protect.php +68 -0
- integrations/woocommerce-composite-products.php +96 -101
- languages/ti-woocommerce-wishlist.pot +5 -5
- readme.txt +8 -1
- ti-woocommerce-wishlist.php +3 -3
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.
|
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.42.0
|
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.
|
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.42.0
|
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.
|
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.42.0
|
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.
|
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.42.0
|
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.
|
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.42.0
|
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.
|
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.42.0
|
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.
|
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.42.0
|
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.
|
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.42.0
|
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.
|
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.42.0
|
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.
|
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.42.0
|
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.
|
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.42.0
|
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.
|
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.42.0
|
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/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.
|
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){n=n||".";return"{0}{1}{2}".format(n,this.pf,t)},this._tm=function(t){t=$("script#{0}[type='text/template']".format(t));return t.length?t.html():""},this.formElm=function(){var e,n;$(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&&(e=function(t){t=t.substring(1),t=parseInt(t,16);return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(t>>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)):$(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]"),t=t.parents("form").eq(0);i&&("-1"!==i.val()&&t.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){t=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");t&&""===t.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t,n=this.n;this.ho&&(n=n+(t=new Date).getFullYear()+t.getMonth()+t.getDate()),window[n]=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})});var o=this,n=o.n,ho=o.ho,c=ho?"t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),":"",i;for(i in 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);};};")}!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 c=s.extend(!0,{},{onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},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 i=s.extend(!0,{},{onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},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(){var t;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&&((t=s(".tinvwl-help")).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.42.0
|
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){n=n||".";return"{0}{1}{2}".format(n,this.pf,t)},this._tm=function(t){t=$("script#{0}[type='text/template']".format(t));return t.length?t.html():""},this.formElm=function(){var e,n;$(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&&(e=function(t){t=t.substring(1),t=parseInt(t,16);return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(t>>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)):$(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]"),t=t.parents("form").eq(0);i&&("-1"!==i.val()&&t.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){t=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");t&&""===t.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t,n=this.n;this.ho&&(n=n+(t=new Date).getFullYear()+t.getMonth()+t.getDate()),window[n]=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})});var o=this,n=o.n,ho=o.ho,c=ho?"t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),":"",i;for(i in 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);};};")}!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 c=s.extend(!0,{},{onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},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 i=s.extend(!0,{},{onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},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(){var t;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&&((t=s(".tinvwl-help")).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.
|
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:e.onActionProduct).call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){var t=t||[],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){var i;return"object"===_typeof(t.in)&&"string"==typeof o?(i=parseInt(o),0<=t.in.indexOf(i)):t.in})},onMultiProductAlreadyIn:function(t){var t=t||[],n=(t=e.onPrepareList.call(t)||t,t=e.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove(),"");0===t.length||(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(e.text_already_in+" ").append(n))},onAction:{redirect:function(t){e.redirectTimer&&clearTimeout(e.redirectTimer),e.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(t){},msg:function(t){if(!t)return!1;var i,n,o=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(o),t=c(t="body > .tinv-wishlist").find("select, input, textarea, button, a").filter(":visible"),i=t.first(),n=t.last(),i.focus().blur(),n.on("keydown",function(t){9!==t.which||t.shiftKey||(t.preventDefault(),i.focus())}),i.on("keydown",function(t){9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}),e.redirectTimer||(e.removeTimer=window.setTimeout(function(){o.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer)},6e3)),o.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),o.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer),e.removeTimer&&clearTimeout(e.removeTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(t){},make_remove:function(t){},wishlists_data:function(t){d(JSON.stringify(t))}}},e=(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),tinvwl_add_to_wishlist.wpml_default&&(r.lang_default=tinvwl_add_to_wishlist.wpml_default),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);t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t,i=c(this).attr("name"),n=c(this).attr("type"),o=c(this).val(),l=10;if("button"!==n&&void 0!==i){for(;/^(.+)\[([^\[\]]*?)\]$/.test(i)&&0<l;){var a,s=i.match(/^(.+)\[([^\[\]]*?)\]$/);3===s.length&&((a={})[s[2]]=o,o=a),i=s[1],l--}"file"!==n||(t=c(this)[0].files)&&d.append(i,t[0]),"checkbox"===n||"radio"===n?c(this).is(":checked")&&(o.length||"object"===_typeof(o)||(o=!0),r.form[i]=e(r.form[i],o)):r.form[i]=e(r.form[i],o)}})}),r=e.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:e.api_url,method:"POST",contentType:!1,processData:!1,data:d}).done(function(t){if(e.onDialogHide.call(n.tinvwl_dialog,n),"object"===_typeof(t))for(var i in t)"function"==typeof e.onAction[i]&&e.onAction[i].call(n,t[i]);else"function"==typeof e.onAction.msg&&e.onAction.msg.call(n,t)})},c.extend(!0,{},i,t));return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;var t,o;e.dialogbox&&e.dialogbox.length&&(this.tinvwl_dialog=e.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=e.onGetDialogBox.call(this)),this.tinvwl_dialog||(t=c(this).nextAll(e.class.dialogbox).eq(0)).length&&(this.tinvwl_dialog=t),this.tinvwl_dialog&&(e.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var n=c(this).find(e.class.select).eq(0);c(this).find(e.class.newtitle).hide().val(""),n.html(""),c.each(t,function(t,i){e.onCreateWishList.call(n,i)}),e.text_create&&e.onCreateWishList.call(n,{ID:"",title:e.text_create,in:!1}),e.onMultiProductAlreadyIn.call(n,t),e.onSelectWishList.call(n,t),c(this).find(e.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=e.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),e.onDialogShow.call(this.tinvwl_dialog,this)):e.onActionProduct.call(this)}),c((o=this).tinvwl_dialog).find(e.class.dialogbutton).off("click").on("click",function(){var t,i=c(o.tinvwl_dialog).find(e.class.select),n=c(o.tinvwl_dialog).find(e.class.newtitle);i.val()||n.val()?e.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",e.onClick),e.onInited.call(this,e)})},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,o=JSON.parse(i.attr("data-tinv-wl-list")),e=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(n in o)o[n].hasOwnProperty("in")&&Array.isArray(o[n].in)&&-1<(o[n].in||[]).indexOf(0)&&(e=!0);i.toggleClass("tinvwl-product-in-list",e).toggleClass("tinvwl-product-make-remove",e&&l).attr("data-tinv-wl-action",e&&l?"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,l=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,s="1"==window.tinvwl_add_to_wishlist.simple_flow;for(e in l)l[e].hasOwnProperty("in")&&Array.isArray(l[e].in)&&-1<(l[e].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&s).attr("data-tinv-wl-action",a&&s?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){s===t.originalEvent.key&&localStorage.getItem(s)!==sessionStorage.getItem(s)&&(!localStorage.getItem(s)||"object"===_typeof(t=JSON.parse(localStorage.getItem(s)))&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter"))&&d(localStorage.getItem(s)))});function i(){if(a&&(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 r(t),0}tinvwl_add_to_wishlist.block_ajax_wishlists_data||(n.length||o)&&(t={},tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),tinvwl_add_to_wishlist.wpml_default&&(t.lang_default=tinvwl_add_to_wishlist.wpml_default),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(){e()}))}var n=[],o=!1,e=(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(){o=!0}),function(){var t;(n.length||o)&&(t={ids:n,counter:o,tinvwl_request:!0},tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),tinvwl_add_to_wishlist.wpml_default&&(t.lang_default=tinvwl_add_to_wishlist.wpml_default),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)}))}),t=(i(),new MutationObserver(function(t){n=[],t.forEach(function(t){t=t.addedNodes;null!==t&&c(t).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&&i()})),l=document.body;t.observe(l,{childList:!0,subtree:!0})});var a=!0,s=tinvwl_add_to_wishlist.hash_key;try{a="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){a=!1}function r(t){var a="1"==window.tinvwl_add_to_wishlist.simple_flow,t=(a&&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 l=t;c('a.tinvwl_add_to_wishlist_button[data-tinv-wl-product="'+l+'"]').each(function(){var i,t=parseInt(c(this).attr("data-tinv-wl-productvariation")),n=c(this).data("tinv-wl-productvariations")||[],o=!1;for(i in e)e[i].hasOwnProperty("in")&&Array.isArray(e[i].in)&&(-1<(e[i].in||[]).indexOf(l)||-1<(e[i].in||[]).indexOf(t)||n.some(function(t){return 0<=(e[i].in||[]).indexOf(t)}))&&(o=!0);c("body").trigger("tinvwl_wishlist_product_marked",[this,o]),c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&a).attr("data-tinv-wl-action",o&&a?"remove":"addto")})}),t.counter);"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")),t=!("0"==t||"false"==t),jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",t),setTimeout(function(){jQuery("i.wishlist-icon").removeClass("added")},500)}function d(t){a&&(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 n=o.extend(!0,{},{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)}},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.42.0
|
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:e.onActionProduct).call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){var t=t||[],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){var i;return"object"===_typeof(t.in)&&"string"==typeof o?(i=parseInt(o),0<=t.in.indexOf(i)):t.in})},onMultiProductAlreadyIn:function(t){var t=t||[],n=(t=e.onPrepareList.call(t)||t,t=e.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove(),"");0===t.length||(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(e.text_already_in+" ").append(n))},onAction:{redirect:function(t){e.redirectTimer&&clearTimeout(e.redirectTimer),e.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(t){},msg:function(t){if(!t)return!1;var i,n,o=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(o),t=c(t="body > .tinv-wishlist").find("select, input, textarea, button, a").filter(":visible"),i=t.first(),n=t.last(),i.focus().blur(),n.on("keydown",function(t){9!==t.which||t.shiftKey||(t.preventDefault(),i.focus())}),i.on("keydown",function(t){9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}),e.redirectTimer||(e.removeTimer=window.setTimeout(function(){o.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer)},6e3)),o.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),o.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer),e.removeTimer&&clearTimeout(e.removeTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(t){},make_remove:function(t){},wishlists_data:function(t){d(JSON.stringify(t))}}},e=(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),tinvwl_add_to_wishlist.wpml_default&&(r.lang_default=tinvwl_add_to_wishlist.wpml_default),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);t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t,i=c(this).attr("name"),n=c(this).attr("type"),o=c(this).val(),l=10;if("button"!==n&&void 0!==i){for(;/^(.+)\[([^\[\]]*?)\]$/.test(i)&&0<l;){var a,s=i.match(/^(.+)\[([^\[\]]*?)\]$/);3===s.length&&((a={})[s[2]]=o,o=a),i=s[1],l--}"file"!==n||(t=c(this)[0].files)&&d.append(i,t[0]),"checkbox"===n||"radio"===n?c(this).is(":checked")&&(o.length||"object"===_typeof(o)||(o=!0),r.form[i]=e(r.form[i],o)):r.form[i]=e(r.form[i],o)}})}),r=e.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:e.api_url,method:"POST",contentType:!1,processData:!1,data:d}).done(function(t){if(e.onDialogHide.call(n.tinvwl_dialog,n),"object"===_typeof(t))for(var i in t)"function"==typeof e.onAction[i]&&e.onAction[i].call(n,t[i]);else"function"==typeof e.onAction.msg&&e.onAction.msg.call(n,t)})},c.extend(!0,{},i,t));return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;var t,o;e.dialogbox&&e.dialogbox.length&&(this.tinvwl_dialog=e.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=e.onGetDialogBox.call(this)),this.tinvwl_dialog||(t=c(this).nextAll(e.class.dialogbox).eq(0)).length&&(this.tinvwl_dialog=t),this.tinvwl_dialog&&(e.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var n=c(this).find(e.class.select).eq(0);c(this).find(e.class.newtitle).hide().val(""),n.html(""),c.each(t,function(t,i){e.onCreateWishList.call(n,i)}),e.text_create&&e.onCreateWishList.call(n,{ID:"",title:e.text_create,in:!1}),e.onMultiProductAlreadyIn.call(n,t),e.onSelectWishList.call(n,t),c(this).find(e.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=e.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),e.onDialogShow.call(this.tinvwl_dialog,this)):e.onActionProduct.call(this)}),c((o=this).tinvwl_dialog).find(e.class.dialogbutton).off("click").on("click",function(){var t,i=c(o.tinvwl_dialog).find(e.class.select),n=c(o.tinvwl_dialog).find(e.class.newtitle);i.val()||n.val()?e.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",e.onClick),e.onInited.call(this,e)})},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,o=JSON.parse(i.attr("data-tinv-wl-list")),e=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(n in o)o[n].hasOwnProperty("in")&&Array.isArray(o[n].in)&&-1<(o[n].in||[]).indexOf(0)&&(e=!0);i.toggleClass("tinvwl-product-in-list",e).toggleClass("tinvwl-product-make-remove",e&&l).attr("data-tinv-wl-action",e&&l?"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,l=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,s="1"==window.tinvwl_add_to_wishlist.simple_flow;for(e in l)l[e].hasOwnProperty("in")&&Array.isArray(l[e].in)&&-1<(l[e].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&s).attr("data-tinv-wl-action",a&&s?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){s===t.originalEvent.key&&localStorage.getItem(s)!==sessionStorage.getItem(s)&&(!localStorage.getItem(s)||"object"===_typeof(t=JSON.parse(localStorage.getItem(s)))&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter"))&&d(localStorage.getItem(s)))});function i(){if(a&&(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 r(t),0}tinvwl_add_to_wishlist.block_ajax_wishlists_data||(n.length||o)&&(t={},tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),tinvwl_add_to_wishlist.wpml_default&&(t.lang_default=tinvwl_add_to_wishlist.wpml_default),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(){e()}))}var n=[],o=!1,e=(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(){o=!0}),function(){var t;(n.length||o)&&(t={ids:n,counter:o,tinvwl_request:!0},tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),tinvwl_add_to_wishlist.wpml_default&&(t.lang_default=tinvwl_add_to_wishlist.wpml_default),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)}))}),t=(i(),new MutationObserver(function(t){n=[],t.forEach(function(t){t=t.addedNodes;null!==t&&c(t).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&&i()})),l=document.body;t.observe(l,{childList:!0,subtree:!0})});var a=!0,s=tinvwl_add_to_wishlist.hash_key;try{a="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){a=!1}function r(t){var a="1"==window.tinvwl_add_to_wishlist.simple_flow,t=(a&&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 l=t;c('a.tinvwl_add_to_wishlist_button[data-tinv-wl-product="'+l+'"]').each(function(){var i,t=parseInt(c(this).attr("data-tinv-wl-productvariation")),n=c(this).data("tinv-wl-productvariations")||[],o=!1;for(i in e)e[i].hasOwnProperty("in")&&Array.isArray(e[i].in)&&(-1<(e[i].in||[]).indexOf(l)||-1<(e[i].in||[]).indexOf(t)||n.some(function(t){return 0<=(e[i].in||[]).indexOf(t)}))&&(o=!0);c("body").trigger("tinvwl_wishlist_product_marked",[this,o]),c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&a).attr("data-tinv-wl-action",o&&a?"remove":"addto")})}),t.counter);"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")),t=!("0"==t||"false"==t),jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",t),setTimeout(function(){jQuery("i.wishlist-icon").removeClass("added")},500)}function d(t){a&&(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 n=o.extend(!0,{},{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)}},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/cleantalk-spam-protect.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* TI WooCommerce Wishlist integration with:
|
4 |
+
*
|
5 |
+
* @name Anti-Spam by CleanTalk
|
6 |
+
*
|
7 |
+
* @version 5.173
|
8 |
+
*
|
9 |
+
* @slug cleantalk-spam-protect
|
10 |
+
*
|
11 |
+
* @url https://wordpress.org/plugins/cleantalk-spam-protect/
|
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 = "cleantalk-spam-protect";
|
24 |
+
|
25 |
+
$name = "Anti-Spam by CleanTalk";
|
26 |
+
|
27 |
+
$available = defined( 'APBCT_NAME' );
|
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 |
+
// Anti-Spam by CleanTalk compatibility.
|
45 |
+
if ( ! function_exists( 'tinvwl_wishlist_item_meta_post_cleantalk_spam_protect' ) ) {
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Set description for meta for Anti-Spam by CleanTalk
|
49 |
+
*
|
50 |
+
* @param array $meta Meta array.
|
51 |
+
* @param array $wl_product Wishlist Product.
|
52 |
+
* @param \WC_Product $product Woocommerce Product.
|
53 |
+
*
|
54 |
+
* @return array
|
55 |
+
*/
|
56 |
+
function tinvwl_wishlist_item_meta_post_cleantalk_spam_protect( $item_data, $product_id, $variation_id ) {
|
57 |
+
|
58 |
+
foreach ( array_keys( $item_data ) as $key ) {
|
59 |
+
if ( strpos( $key, 'apbct_' ) === 0 ) {
|
60 |
+
unset( $item_data[ $key ] );
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
return $item_data;
|
65 |
+
}
|
66 |
+
|
67 |
+
add_filter( 'tinvwl_wishlist_item_meta_post', 'tinvwl_wishlist_item_meta_post_cleantalk_spam_protect', 10, 3 );
|
68 |
+
}
|
integrations/woocommerce-composite-products.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @name WooCommerce Composite Products
|
6 |
*
|
7 |
-
* @version 8.
|
8 |
*
|
9 |
* @slug woocommerce-composite-products
|
10 |
*
|
@@ -13,7 +13,7 @@
|
|
13 |
*/
|
14 |
|
15 |
// If this file is called directly, abort.
|
16 |
-
if (!defined('ABSPATH')) {
|
17 |
exit;
|
18 |
}
|
19 |
|
@@ -24,24 +24,24 @@ $slug = "woocommerce-composite-products";
|
|
24 |
|
25 |
$name = "WooCommerce Composite Products";
|
26 |
|
27 |
-
$available = class_exists('WC_Composite_Products');
|
28 |
|
29 |
-
$tinvwl_integrations = is_array($tinvwl_integrations) ? $tinvwl_integrations : [];
|
30 |
|
31 |
-
$tinvwl_integrations[$slug] = array(
|
32 |
-
'name'
|
33 |
'available' => $available,
|
34 |
);
|
35 |
|
36 |
-
if (!tinv_get_option('integrations', $slug)) {
|
37 |
return;
|
38 |
}
|
39 |
|
40 |
-
if (
|
41 |
return;
|
42 |
}
|
43 |
|
44 |
-
if (!function_exists('tinv_wishlist_metasupport_woocommerce_composite_products')) {
|
45 |
|
46 |
/**
|
47 |
* Set description for meta WooCommerce Composite Products
|
@@ -51,19 +51,18 @@ if (!function_exists('tinv_wishlist_metasupport_woocommerce_composite_products')
|
|
51 |
*
|
52 |
* @return array
|
53 |
*/
|
54 |
-
function tinv_wishlist_metasupport_woocommerce_composite_products($meta, $product_id)
|
55 |
-
|
56 |
-
if (array_key_exists('wccp_component_selection', $meta) && is_array($meta['wccp_component_selection'])) {
|
57 |
$meta = array();
|
58 |
} // End if().
|
59 |
|
60 |
return $meta;
|
61 |
}
|
62 |
|
63 |
-
add_filter('tinvwl_wishlist_item_meta_post', 'tinv_wishlist_metasupport_woocommerce_composite_products', 10, 2);
|
64 |
} // End if().
|
65 |
|
66 |
-
if (!function_exists('tinvwl_row_woocommerce_composite_products')) {
|
67 |
|
68 |
/**
|
69 |
* Add rows for sub product for WooCommerce Composite Products
|
@@ -71,132 +70,131 @@ if (!function_exists('tinvwl_row_woocommerce_composite_products')) {
|
|
71 |
* @param array $wl_product Wishlist Product.
|
72 |
* @param \WC_Product_Composite $product Woocommerce Product.
|
73 |
*/
|
74 |
-
function tinvwl_row_woocommerce_composite_products($wl_product, $product)
|
75 |
-
|
76 |
-
if (is_object($product) && $product->is_type('composite') && array_key_exists('wccp_component_selection', $wl_product['meta'])) {
|
77 |
$product_quantity = $product->is_sold_individually() ? 1 : $wl_product['quantity'];
|
78 |
|
79 |
$components = $product->get_components();
|
80 |
-
foreach ($components as $component_id => $component) {
|
81 |
-
$composited_product_id
|
82 |
-
$composited_product_quantity = isset($wl_product['meta']['wccp_component_quantity'][$component_id]) ? absint($wl_product['meta']['wccp_component_quantity'][$component_id]) : $component->get_quantity('min');
|
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);
|
91 |
|
92 |
-
if (
|
93 |
continue;
|
94 |
}
|
95 |
|
96 |
$composited_product = $composited_product_wrapper->get_product();
|
97 |
|
98 |
-
if ($composited_product->is_sold_individually() && $composited_product_quantity > 1) {
|
99 |
$composited_product_quantity = 1;
|
100 |
}
|
101 |
|
102 |
-
$product_url
|
103 |
$product_image = $composited_product->get_image();
|
104 |
-
$product_title = is_callable(array(
|
105 |
$composited_product,
|
106 |
'get_name'
|
107 |
-
)) ? $composited_product->get_name() : $composited_product->get_title();
|
108 |
$product_price = $composited_product->get_price();
|
109 |
|
110 |
-
$component_option = $product->get_component_option($component_id, $composited_product_id);
|
111 |
|
112 |
$discount = $component_option->get_discount();
|
113 |
|
114 |
-
if ($discount) {
|
115 |
-
$product_price = $product_price * (100 - $discount) / 100;
|
116 |
}
|
117 |
-
$product_price = wc_price($product_price);
|
118 |
|
119 |
-
if ($component_option) {
|
120 |
-
if (false === $component_option->is_priced_individually() && $
|
121 |
$product_price = '';
|
122 |
-
} elseif (false === $component_option->get_component()->is_subtotal_visible('cart')) {
|
123 |
$product_price = '';
|
124 |
-
} elseif (apply_filters('woocommerce_add_composited_cart_item_prices', true, false, false)) {
|
125 |
-
if ($product_price) {
|
126 |
$product_price = '<span class="component_table_item_price">' . $product_price . '</span>';
|
127 |
}
|
128 |
}
|
129 |
}
|
130 |
|
131 |
-
if ($composited_product->is_visible()) {
|
132 |
-
$product_image = sprintf('<a href="%s">%s</a>', esc_url($product_url), $product_image);
|
133 |
-
$product_title = sprintf('<a href="%s">%s</a>', esc_url($product_url), $product_title);
|
134 |
}
|
135 |
-
$product_title .= tinv_wishlist_get_item_data($composited_product, $wl_product);
|
136 |
|
137 |
-
$availability = (array)$composited_product->get_availability();
|
138 |
-
if (!array_key_exists('availability', $availability)) {
|
139 |
$availability['availability'] = '';
|
140 |
}
|
141 |
-
if (!array_key_exists('class', $availability)) {
|
142 |
$availability['class'] = '';
|
143 |
}
|
144 |
-
$availability_html = empty($availability['availability']) ? '<p class="stock ' . esc_attr($availability['class']) . '"><span><i class="ftinvwl ftinvwl-check"></i></span><span class="tinvwl-txt">' . esc_html__('In stock', 'ti-woocommerce-wishlist') . '</span></p>' : '<p class="stock ' . esc_attr($availability['class']) . '"><span><i class="ftinvwl ftinvwl-times"></i></span><span>' . esc_html($availability['availability']) . '</span></p>';
|
145 |
-
$row_string
|
146 |
-
$row_string
|
147 |
-
if (tinv_get_option('product_table', 'colm_price')) {
|
148 |
-
$row_string .= ($product_price &&
|
149 |
}
|
150 |
-
if (tinv_get_option('product_table', 'colm_date')) {
|
151 |
$row_string .= '<td class="product-date"> </td>';
|
152 |
}
|
153 |
-
if (tinv_get_option('product_table', 'colm_stock')) {
|
154 |
$row_string .= '<td class="product-stock">%5$s</td>';
|
155 |
}
|
156 |
-
if (tinv_get_option('product_table', 'colm_quantity')) {
|
157 |
$row_string .= '<td class="product-quantity"> </td>';
|
158 |
}
|
159 |
-
if (tinv_get_option('product_table', 'add_to_cart')) {
|
160 |
$row_string .= '<td class="product-action"> </td>';
|
161 |
}
|
162 |
$row_string .= '</tr>';
|
163 |
|
164 |
-
if ($composited_product->is_type('bundle')) {
|
165 |
$product_price = $availability_html = $product_title = '';
|
166 |
}
|
167 |
|
168 |
-
echo sprintf($row_string, is_callable(array(
|
169 |
$component,
|
170 |
'get_name'
|
171 |
-
)) ? $component->get_name() : $component->get_title(), $product_image, $product_title, $product_price, $availability_html, $composited_product_quantity * $product_quantity); // WPCS: xss ok.
|
172 |
|
173 |
-
if ($composited_product->is_type('bundle')) {
|
174 |
|
175 |
-
$wl_product_bundle
|
176 |
$wl_product_bundle['product_id'] = $composited_product->get_id();
|
177 |
|
178 |
$component_meta = array();
|
179 |
|
180 |
-
foreach ($wl_product['meta'] as $key => $value) {
|
181 |
-
if (substr($key, 0, strlen('component_' . $component_id)) === 'component_' . $component_id) {
|
182 |
|
183 |
-
$component_meta[substr($key, strlen('component_' . $component_id . '_'), strlen($key))] = $value;
|
184 |
}
|
185 |
}
|
186 |
|
187 |
$wl_product_bundle['meta'] = $component_meta;
|
188 |
|
189 |
-
tinvwl_row_woocommerce_product_bundles($wl_product_bundle, $composited_product, $composited_product_wrapper->get_discount());
|
190 |
}
|
191 |
} // End if().
|
192 |
} // End foreach().
|
193 |
} // End if().
|
194 |
}
|
195 |
|
196 |
-
add_action('tinvwl_wishlist_row_after', 'tinvwl_row_woocommerce_composite_products', 10, 2);
|
197 |
} // End if().
|
198 |
|
199 |
-
if (!function_exists('tinvwl_item_price_woocommerce_composite_products')) {
|
200 |
|
201 |
/**
|
202 |
* Modify price for WooCommerce Composite Products
|
@@ -207,74 +205,73 @@ if (!function_exists('tinvwl_item_price_woocommerce_composite_products')) {
|
|
207 |
*
|
208 |
* @return string
|
209 |
*/
|
210 |
-
function tinvwl_item_price_woocommerce_composite_products($price, $wl_product, $product)
|
211 |
-
|
212 |
-
|
213 |
-
$
|
214 |
-
$_price = $product->get_price();
|
215 |
$regular_price = $product->get_regular_price();
|
216 |
|
217 |
/**
|
218 |
* @var WC_CP_Component $component
|
219 |
*/
|
220 |
-
foreach ($components as $component_id => $component) {
|
221 |
-
$composited_product_id
|
222 |
-
$composited_product_quantity = isset($wl_product['meta']['wccp_component_quantity'][$component_id]) ? absint($wl_product['meta']['wccp_component_quantity'][$component_id]) : $component->get_quantity('min');
|
223 |
|
224 |
-
$composited_variation_id = isset($wl_product['meta']['wccp_variation_id'][$component_id]) ? wc_clean($wl_product['meta']['wccp_variation_id'][$component_id]) : '';
|
225 |
|
226 |
-
if ($composited_product_id) {
|
227 |
-
$composited_product_wrapper = $component->get_option($composited_variation_id ? $composited_variation_id : $composited_product_id);
|
228 |
-
if (
|
229 |
continue;
|
230 |
}
|
231 |
-
if ($component->is_priced_individually()) {
|
232 |
|
233 |
$composited_product = $composited_product_wrapper->get_product();
|
234 |
-
if ($composited_product->is_type('bundle')) {
|
235 |
|
236 |
-
$wl_product_bundle
|
237 |
$wl_product_bundle['product_id'] = $composited_product->get_id();
|
238 |
|
239 |
$component_meta = array();
|
240 |
|
241 |
-
foreach ($wl_product['meta'] as $key => $value) {
|
242 |
-
if (substr($key, 0, strlen('component_' . $component_id)) === 'component_' . $component_id) {
|
243 |
|
244 |
-
$component_meta[substr($key, strlen('component_' . $component_id . '_'), strlen($key))] = $value;
|
245 |
}
|
246 |
}
|
247 |
|
248 |
$wl_product_bundle['meta'] = $component_meta;
|
249 |
|
250 |
-
$bundle_price
|
251 |
$regular_price += $bundle_price;
|
252 |
|
253 |
-
if ($discount = $composited_product_wrapper->get_discount()) {
|
254 |
-
$bundle_price = empty($bundle_price) ? $bundle_price : round((double)$bundle_price * (100 - $discount) / 100, wc_cp_price_num_decimals());
|
255 |
}
|
256 |
$_price += $bundle_price;
|
257 |
|
258 |
continue;
|
259 |
}
|
260 |
|
261 |
-
$_price
|
262 |
$regular_price += $composited_product_wrapper->get_regular_price() * $composited_product_quantity;
|
263 |
}
|
264 |
}
|
265 |
}
|
266 |
|
267 |
-
$price = wc_price($_price) . $product->get_price_suffix();
|
268 |
|
269 |
}
|
270 |
|
271 |
return $price;
|
272 |
}
|
273 |
|
274 |
-
add_filter('tinvwl_wishlist_item_price', 'tinvwl_item_price_woocommerce_composite_products', 10, 3);
|
275 |
} // End if().
|
276 |
|
277 |
-
if (!function_exists('tinv_wishlist_metaprepare_woocommerce_composite_products')) {
|
278 |
|
279 |
/**
|
280 |
* Prepare save meta for WooCommerce Composite Products
|
@@ -283,26 +280,24 @@ if (!function_exists('tinv_wishlist_metaprepare_woocommerce_composite_products')
|
|
283 |
*
|
284 |
* @return array
|
285 |
*/
|
286 |
-
function tinv_wishlist_metaprepare_woocommerce_composite_products($meta)
|
287 |
-
{
|
288 |
|
289 |
-
foreach ($meta as $key => $value) {
|
290 |
-
if (strpos($key, 'wccp_') === 0 && !is_array($value)) {
|
291 |
|
292 |
-
$meta[$key] = json_decode($value);
|
293 |
}
|
294 |
}
|
295 |
|
296 |
return $meta;
|
297 |
}
|
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 =[];
|
@@ -331,7 +326,7 @@ function tinv_add_to_wishlist_woocommerce_composite_products()
|
|
331 |
}
|
332 |
});
|
333 |
});
|
334 |
-
");
|
335 |
}
|
336 |
|
337 |
-
add_action('wp_enqueue_scripts', 'tinv_add_to_wishlist_woocommerce_composite_products', 100, 1);
|
4 |
*
|
5 |
* @name WooCommerce Composite Products
|
6 |
*
|
7 |
+
* @version 8.3.7
|
8 |
*
|
9 |
* @slug woocommerce-composite-products
|
10 |
*
|
13 |
*/
|
14 |
|
15 |
// If this file is called directly, abort.
|
16 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
17 |
exit;
|
18 |
}
|
19 |
|
24 |
|
25 |
$name = "WooCommerce Composite Products";
|
26 |
|
27 |
+
$available = class_exists( 'WC_Composite_Products' );
|
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 |
+
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_composite_products' ) ) {
|
45 |
|
46 |
/**
|
47 |
* Set description for meta WooCommerce Composite Products
|
51 |
*
|
52 |
* @return array
|
53 |
*/
|
54 |
+
function tinv_wishlist_metasupport_woocommerce_composite_products( $meta, $product_id ) {
|
55 |
+
if ( array_key_exists( 'wccp_component_selection', $meta ) && is_array( $meta['wccp_component_selection'] ) ) {
|
|
|
56 |
$meta = array();
|
57 |
} // End if().
|
58 |
|
59 |
return $meta;
|
60 |
}
|
61 |
|
62 |
+
add_filter( 'tinvwl_wishlist_item_meta_post', 'tinv_wishlist_metasupport_woocommerce_composite_products', 10, 2 );
|
63 |
} // End if().
|
64 |
|
65 |
+
if ( ! function_exists( 'tinvwl_row_woocommerce_composite_products' ) ) {
|
66 |
|
67 |
/**
|
68 |
* Add rows for sub product for WooCommerce Composite Products
|
70 |
* @param array $wl_product Wishlist Product.
|
71 |
* @param \WC_Product_Composite $product Woocommerce Product.
|
72 |
*/
|
73 |
+
function tinvwl_row_woocommerce_composite_products( $wl_product, $product ) {
|
74 |
+
if ( is_object( $product ) && $product->is_type( 'composite' ) && array_key_exists( 'wccp_component_selection', $wl_product['meta'] ) ) {
|
|
|
75 |
$product_quantity = $product->is_sold_individually() ? 1 : $wl_product['quantity'];
|
76 |
|
77 |
$components = $product->get_components();
|
78 |
+
foreach ( $components as $component_id => $component ) {
|
79 |
+
$composited_product_id = ! empty( $wl_product['meta']['wccp_component_selection'][ $component_id ] ) ? absint( $wl_product['meta']['wccp_component_selection'][ $component_id ] ) : '';
|
80 |
+
$composited_product_quantity = isset( $wl_product['meta']['wccp_component_quantity'][ $component_id ] ) ? absint( $wl_product['meta']['wccp_component_quantity'][ $component_id ] ) : $component->get_quantity( 'min' );
|
81 |
|
82 |
+
$composited_variation_id = isset( $wl_product['meta']['wccp_variation_id'][ $component_id ] ) ? wc_clean( $wl_product['meta']['wccp_variation_id'][ $component_id ] ) : '';
|
83 |
|
84 |
+
$composited_product_id = isset( $wl_product['meta']['wccp_component_selection_nil'], $wl_product['meta']['wccp_component_selection_nil'][ $component_id ] ) ? '' : $composited_product_id;
|
85 |
|
86 |
+
if ( $composited_product_id ) {
|
87 |
|
88 |
+
$composited_product_wrapper = $component->get_option( $composited_variation_id ? $composited_variation_id : $composited_product_id );
|
89 |
|
90 |
+
if ( ! $composited_product_wrapper ) {
|
91 |
continue;
|
92 |
}
|
93 |
|
94 |
$composited_product = $composited_product_wrapper->get_product();
|
95 |
|
96 |
+
if ( $composited_product->is_sold_individually() && $composited_product_quantity > 1 ) {
|
97 |
$composited_product_quantity = 1;
|
98 |
}
|
99 |
|
100 |
+
$product_url = $composited_product->get_permalink();
|
101 |
$product_image = $composited_product->get_image();
|
102 |
+
$product_title = is_callable( array(
|
103 |
$composited_product,
|
104 |
'get_name'
|
105 |
+
) ) ? $composited_product->get_name() : $composited_product->get_title();
|
106 |
$product_price = $composited_product->get_price();
|
107 |
|
108 |
+
$component_option = $product->get_component_option( $component_id, $composited_product_id );
|
109 |
|
110 |
$discount = $component_option->get_discount();
|
111 |
|
112 |
+
if ( $discount ) {
|
113 |
+
$product_price = $product_price * ( 100 - $discount ) / 100;
|
114 |
}
|
115 |
+
$product_price = wc_price( $product_price );
|
116 |
|
117 |
+
if ( $component_option ) {
|
118 |
+
if ( false === $component_option->is_priced_individually() && false === $component_option->get_raw_price() > 0 ) {
|
119 |
$product_price = '';
|
120 |
+
} elseif ( false === $component_option->get_component()->is_subtotal_visible( 'cart' ) ) {
|
121 |
$product_price = '';
|
122 |
+
} elseif ( apply_filters( 'woocommerce_add_composited_cart_item_prices', true, false, false ) ) {
|
123 |
+
if ( $product_price ) {
|
124 |
$product_price = '<span class="component_table_item_price">' . $product_price . '</span>';
|
125 |
}
|
126 |
}
|
127 |
}
|
128 |
|
129 |
+
if ( $composited_product->is_visible() ) {
|
130 |
+
$product_image = sprintf( '<a href="%s">%s</a>', esc_url( $product_url ), $product_image );
|
131 |
+
$product_title = sprintf( '<a href="%s">%s</a>', esc_url( $product_url ), $product_title );
|
132 |
}
|
133 |
+
$product_title .= tinv_wishlist_get_item_data( $composited_product, $wl_product );
|
134 |
|
135 |
+
$availability = (array) $composited_product->get_availability();
|
136 |
+
if ( ! array_key_exists( 'availability', $availability ) ) {
|
137 |
$availability['availability'] = '';
|
138 |
}
|
139 |
+
if ( ! array_key_exists( 'class', $availability ) ) {
|
140 |
$availability['class'] = '';
|
141 |
}
|
142 |
+
$availability_html = empty( $availability['availability'] ) ? '<p class="stock ' . esc_attr( $availability['class'] ) . '"><span><i class="ftinvwl ftinvwl-check"></i></span><span class="tinvwl-txt">' . esc_html__( 'In stock', 'ti-woocommerce-wishlist' ) . '</span></p>' : '<p class="stock ' . esc_attr( $availability['class'] ) . '"><span><i class="ftinvwl ftinvwl-times"></i></span><span>' . esc_html( $availability['availability'] ) . '</span></p>';
|
143 |
+
$row_string = '<tr>';
|
144 |
+
$row_string .= ( ( ! is_user_logged_in() || get_current_user_id() !== $wl_product['author'] ) ? ( ( ! tinv_get_option( 'table', 'colm_checkbox' ) ) ? '' : '<td colspan="1"></td>' ) : '<td colspan="' . ( ( ! tinv_get_option( 'table', 'colm_checkbox' ) ) ? '1' : '2' ) . '"></td>' ) . ' <td class="product-thumbnail">%2$s</td><td class="product-name">%1$s:<br/>%3$s</td>';
|
145 |
+
if ( tinv_get_option( 'product_table', 'colm_price' ) ) {
|
146 |
+
$row_string .= ( $product_price && ! $composited_product->is_type( 'bundle' ) ) ? '<td class="product-price">%4$s × %6$s</td>' : '<td class="product-price">%4$s</td>';
|
147 |
}
|
148 |
+
if ( tinv_get_option( 'product_table', 'colm_date' ) ) {
|
149 |
$row_string .= '<td class="product-date"> </td>';
|
150 |
}
|
151 |
+
if ( tinv_get_option( 'product_table', 'colm_stock' ) ) {
|
152 |
$row_string .= '<td class="product-stock">%5$s</td>';
|
153 |
}
|
154 |
+
if ( tinv_get_option( 'product_table', 'colm_quantity' ) ) {
|
155 |
$row_string .= '<td class="product-quantity"> </td>';
|
156 |
}
|
157 |
+
if ( tinv_get_option( 'product_table', 'add_to_cart' ) ) {
|
158 |
$row_string .= '<td class="product-action"> </td>';
|
159 |
}
|
160 |
$row_string .= '</tr>';
|
161 |
|
162 |
+
if ( $composited_product->is_type( 'bundle' ) ) {
|
163 |
$product_price = $availability_html = $product_title = '';
|
164 |
}
|
165 |
|
166 |
+
echo sprintf( $row_string, is_callable( array(
|
167 |
$component,
|
168 |
'get_name'
|
169 |
+
) ) ? $component->get_name() : $component->get_title(), $product_image, $product_title, $product_price, $availability_html, $composited_product_quantity * $product_quantity ); // WPCS: xss ok.
|
170 |
|
171 |
+
if ( $composited_product->is_type( 'bundle' ) ) {
|
172 |
|
173 |
+
$wl_product_bundle = $wl_product;
|
174 |
$wl_product_bundle['product_id'] = $composited_product->get_id();
|
175 |
|
176 |
$component_meta = array();
|
177 |
|
178 |
+
foreach ( $wl_product['meta'] as $key => $value ) {
|
179 |
+
if ( substr( $key, 0, strlen( 'component_' . $component_id ) ) === 'component_' . $component_id ) {
|
180 |
|
181 |
+
$component_meta[ substr( $key, strlen( 'component_' . $component_id . '_' ), strlen( $key ) ) ] = $value;
|
182 |
}
|
183 |
}
|
184 |
|
185 |
$wl_product_bundle['meta'] = $component_meta;
|
186 |
|
187 |
+
tinvwl_row_woocommerce_product_bundles( $wl_product_bundle, $composited_product, $composited_product_wrapper->get_discount() );
|
188 |
}
|
189 |
} // End if().
|
190 |
} // End foreach().
|
191 |
} // End if().
|
192 |
}
|
193 |
|
194 |
+
add_action( 'tinvwl_wishlist_row_after', 'tinvwl_row_woocommerce_composite_products', 10, 2 );
|
195 |
} // End if().
|
196 |
|
197 |
+
if ( ! function_exists( 'tinvwl_item_price_woocommerce_composite_products' ) ) {
|
198 |
|
199 |
/**
|
200 |
* Modify price for WooCommerce Composite Products
|
205 |
*
|
206 |
* @return string
|
207 |
*/
|
208 |
+
function tinvwl_item_price_woocommerce_composite_products( $price, $wl_product, $product ) {
|
209 |
+
if ( is_object( $product ) && $product->is_type( 'composite' ) && array_key_exists( 'wccp_component_selection', $wl_product['meta'] ) ) {
|
210 |
+
$components = $product->get_components();
|
211 |
+
$_price = $product->get_price();
|
|
|
212 |
$regular_price = $product->get_regular_price();
|
213 |
|
214 |
/**
|
215 |
* @var WC_CP_Component $component
|
216 |
*/
|
217 |
+
foreach ( $components as $component_id => $component ) {
|
218 |
+
$composited_product_id = ! empty( $wl_product['meta']['wccp_component_selection'][ $component_id ] ) ? absint( $wl_product['meta']['wccp_component_selection'][ $component_id ] ) : '';
|
219 |
+
$composited_product_quantity = isset( $wl_product['meta']['wccp_component_quantity'][ $component_id ] ) ? absint( $wl_product['meta']['wccp_component_quantity'][ $component_id ] ) : $component->get_quantity( 'min' );
|
220 |
|
221 |
+
$composited_variation_id = isset( $wl_product['meta']['wccp_variation_id'][ $component_id ] ) ? wc_clean( $wl_product['meta']['wccp_variation_id'][ $component_id ] ) : '';
|
222 |
|
223 |
+
if ( $composited_product_id ) {
|
224 |
+
$composited_product_wrapper = $component->get_option( $composited_variation_id ? $composited_variation_id : $composited_product_id );
|
225 |
+
if ( ! $composited_product_wrapper ) {
|
226 |
continue;
|
227 |
}
|
228 |
+
if ( $component->is_priced_individually() ) {
|
229 |
|
230 |
$composited_product = $composited_product_wrapper->get_product();
|
231 |
+
if ( $composited_product->is_type( 'bundle' ) ) {
|
232 |
|
233 |
+
$wl_product_bundle = $wl_product;
|
234 |
$wl_product_bundle['product_id'] = $composited_product->get_id();
|
235 |
|
236 |
$component_meta = array();
|
237 |
|
238 |
+
foreach ( $wl_product['meta'] as $key => $value ) {
|
239 |
+
if ( substr( $key, 0, strlen( 'component_' . $component_id ) ) === 'component_' . $component_id ) {
|
240 |
|
241 |
+
$component_meta[ substr( $key, strlen( 'component_' . $component_id . '_' ), strlen( $key ) ) ] = $value;
|
242 |
}
|
243 |
}
|
244 |
|
245 |
$wl_product_bundle['meta'] = $component_meta;
|
246 |
|
247 |
+
$bundle_price = tinvwl_item_price_woocommerce_product_bundles( 0, $wl_product_bundle, $composited_product, true );
|
248 |
$regular_price += $bundle_price;
|
249 |
|
250 |
+
if ( $discount = $composited_product_wrapper->get_discount() ) {
|
251 |
+
$bundle_price = empty( $bundle_price ) ? $bundle_price : round( (double) $bundle_price * ( 100 - $discount ) / 100, wc_cp_price_num_decimals() );
|
252 |
}
|
253 |
$_price += $bundle_price;
|
254 |
|
255 |
continue;
|
256 |
}
|
257 |
|
258 |
+
$_price += $composited_product_wrapper->get_price() * $composited_product_quantity;
|
259 |
$regular_price += $composited_product_wrapper->get_regular_price() * $composited_product_quantity;
|
260 |
}
|
261 |
}
|
262 |
}
|
263 |
|
264 |
+
$price = wc_price( $_price ) . $product->get_price_suffix();
|
265 |
|
266 |
}
|
267 |
|
268 |
return $price;
|
269 |
}
|
270 |
|
271 |
+
add_filter( 'tinvwl_wishlist_item_price', 'tinvwl_item_price_woocommerce_composite_products', 10, 3 );
|
272 |
} // End if().
|
273 |
|
274 |
+
if ( ! function_exists( 'tinv_wishlist_metaprepare_woocommerce_composite_products' ) ) {
|
275 |
|
276 |
/**
|
277 |
* Prepare save meta for WooCommerce Composite Products
|
280 |
*
|
281 |
* @return array
|
282 |
*/
|
283 |
+
function tinv_wishlist_metaprepare_woocommerce_composite_products( $meta ) {
|
|
|
284 |
|
285 |
+
foreach ( $meta as $key => $value ) {
|
286 |
+
if ( strpos( $key, 'wccp_' ) === 0 && ! is_array( $value ) ) {
|
287 |
|
288 |
+
$meta[ $key ] = json_decode( $value );
|
289 |
}
|
290 |
}
|
291 |
|
292 |
return $meta;
|
293 |
}
|
294 |
|
295 |
+
add_filter( 'tinvwl_product_prepare_meta', 'tinv_wishlist_metaprepare_woocommerce_composite_products' );
|
296 |
}
|
297 |
|
298 |
+
function tinv_add_to_wishlist_woocommerce_composite_products() {
|
|
|
299 |
|
300 |
+
wp_add_inline_script( 'tinvwl', "
|
301 |
jQuery(document).ready(function($){
|
302 |
$(document).on('tinvwl_wishlist_button_clicked', function (e, el, data) {
|
303 |
var button = $(el), composite_form =[];
|
326 |
}
|
327 |
});
|
328 |
});
|
329 |
+
" );
|
330 |
}
|
331 |
|
332 |
+
add_action( 'wp_enqueue_scripts', 'tinv_add_to_wishlist_woocommerce_composite_products', 100, 1 );
|
languages/ti-woocommerce-wishlist.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
# Copyright (C) 2022 TI WooCommerce Wishlist Plugin - 1.
|
2 |
-
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -11,7 +11,7 @@ msgstr ""
|
|
11 |
"Language-Team: TemplateInvaders (https://templateinvaders.com/)\n"
|
12 |
"Last-Translator: TemplateInvaders (https://templateinvaders.com/)\n"
|
13 |
"MIME-Version: 1.0\n"
|
14 |
-
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.
|
15 |
"Report-Msgid-Bugs-To: https://templateinvaders.com/help/\n"
|
16 |
"X-Poedit-Basepath: ..\n"
|
17 |
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
|
@@ -1156,7 +1156,7 @@ msgstr ""
|
|
1156 |
msgid "Custom Title"
|
1157 |
msgstr ""
|
1158 |
|
1159 |
-
#: integrations/woo-product-bundle.php:115, integrations/woocommerce-composite-products.php:
|
1160 |
msgid "In stock"
|
1161 |
msgstr ""
|
1162 |
|
1 |
+
# Copyright (C) 2022 TI WooCommerce Wishlist Plugin - 1.42.0
|
2 |
+
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.42.0 package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.42.0\n"
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"Language-Team: TemplateInvaders (https://templateinvaders.com/)\n"
|
12 |
"Last-Translator: TemplateInvaders (https://templateinvaders.com/)\n"
|
13 |
"MIME-Version: 1.0\n"
|
14 |
+
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.42.0\n"
|
15 |
"Report-Msgid-Bugs-To: https://templateinvaders.com/help/\n"
|
16 |
"X-Poedit-Basepath: ..\n"
|
17 |
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
|
1156 |
msgid "Custom Title"
|
1157 |
msgstr ""
|
1158 |
|
1159 |
+
#: 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
|
1160 |
msgid "In stock"
|
1161 |
msgstr ""
|
1162 |
|
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.9
|
6 |
-
Stable tag: 1.
|
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,6 +163,13 @@ Yes, you can! Join in on our [GitHub repository](https://github.com/TemplateInva
|
|
163 |
|
164 |
|
165 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
= 1.41.1 =
|
167 |
*Release Date - 20 February 2022*
|
168 |
|
3 |
Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.9
|
6 |
+
Stable tag: 1.42.0
|
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.42.0 =
|
167 |
+
*Release Date - 09 March 2022*
|
168 |
+
|
169 |
+
* WooCommerce 6.3 support
|
170 |
+
* Added integration with [Anti-Spam by CleanTalk](https://wordpress.org/plugins/cleantalk-spam-protect/) plugin
|
171 |
+
* Updated integration with [WooCommerce Composite Products](https://woocommerce.com/products/composite-products/?aff=3955) plugin
|
172 |
+
|
173 |
= 1.41.1 =
|
174 |
*Release Date - 20 February 2022*
|
175 |
|
ti-woocommerce-wishlist.php
CHANGED
@@ -4,11 +4,11 @@
|
|
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.
|
8 |
* Requires at least: 4.7
|
9 |
* Tested up to: 5.9
|
10 |
* WC requires at least: 3.0
|
11 |
-
* WC tested up to: 6.
|
12 |
* Author: TemplateInvaders
|
13 |
* Author URI: https://templateinvaders.com/
|
14 |
* License: GPL-2.0+
|
@@ -41,7 +41,7 @@ if (!defined('TINVWL_DOMAIN')) {
|
|
41 |
}
|
42 |
|
43 |
if (!defined('TINVWL_FVERSION')) {
|
44 |
-
define('TINVWL_FVERSION', '1.
|
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.42.0
|
8 |
* Requires at least: 4.7
|
9 |
* Tested up to: 5.9
|
10 |
* WC requires at least: 3.0
|
11 |
+
* WC tested up to: 6.3
|
12 |
* Author: TemplateInvaders
|
13 |
* Author URI: https://templateinvaders.com/
|
14 |
* License: GPL-2.0+
|
41 |
}
|
42 |
|
43 |
if (!defined('TINVWL_FVERSION')) {
|
44 |
+
define('TINVWL_FVERSION', '1.42.0');
|
45 |
}
|
46 |
|
47 |
if (!defined('TINVWL_LOAD_FREE')) {
|