Version Description
Release Date - 22 March 2021
- Fixed conditional options of themes integration
- Fixed WPML issue for variations name
Download this release
Release Info
Developer | templateinvaders |
Plugin | WooCommerce Wishlist Plugin |
Version | 1.24.3 |
Comparing to | |
See all releases |
Code changes from version 1.24.2 to 1.24.3
- 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
- includes/product.helper.php +264 -247
- integrations/theme-divi.php +1 -1
- integrations/theme-flatsome.php +1 -1
- integrations/theme-kallyas.php +1 -1
- integrations/theme-oceanwp.php +1 -1
- languages/ti-woocommerce-wishlist.pot +3 -3
- readme.txt +7 -1
- ti-woocommerce-wishlist.php +2 -2
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.24.
|
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.24.3
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
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.24.
|
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.24.3
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
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.24.
|
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.24.3
|
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.24.
|
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.24.3
|
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.24.
|
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.24.3
|
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.24.
|
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.24.3
|
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.24.
|
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.24.3
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
|
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.24.
|
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.24.3
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
|
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.24.
|
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.24.3
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
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.24.
|
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.24.3
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
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.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';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.24.3
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';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.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';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.24.3
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';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.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){return"{0}{1}{2}".format(n=n||".",this.pf,t)},this._tm=function(t){var n=$("script#{0}[type='text/template']".format(t));return n.length?n.html():""},this.formElm=function(){if($(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker){var e=function(t){var n=t.substring(1),i=parseInt(n,16);return.2126*(i>>16&255)+.7152*(i>>8&255)+.0722*(i>>0&255)},n=this._csel("-form-color");$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){$(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)).iris("hide"):$(n).iris("hide")})}},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),e=t.parents("form").eq(0);i&&("-1"!==i.val()&&e.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){var i=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");i&&""===i.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t=this.n;if(this.ho){var n=new Date;t=t+n.getFullYear()+n.getMonth()+n.getDate()}window[t]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})}),function(o){var n=o.n,ho=o.ho,c="";for(var i in ho&&(c="t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),"),o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}(this)}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var n={onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},c=s.extend(!0,{},n,t);return s(this).each(function(){function t(){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),e=n.attr("tiwl-hide"),o=c.isChecked.call(n);return"string"==typeof i&&t(i,o),"string"==typeof e&&t(e,!o),n}var n=s(this);return n.is("input")&&"checkbox"==n.attr("type")?(s(this).on("change",t),t.call(n)):n})},s.fn.tiwl_byvalueblock=function(t){var n={onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},i=s.extend(!0,{},n,t);return s(this).each(function(){function t(e){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),o=n.attr("tiwl-hide"),c=e.onClick.call(n);return"string"==typeof i&&t(i,c),"string"==typeof o&&t(o,!c),n}var n=s(this);return n.is("input")||n.is("select")?(s(this).on("change",function(){t.call(this,i)}),t.call(n,i)):n})};var n=new TInvWL(s);s(document).ready(function(){if(n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover){var t=s(".tinvwl-help");t.popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})}s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})})}(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.24.3
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){return"{0}{1}{2}".format(n=n||".",this.pf,t)},this._tm=function(t){var n=$("script#{0}[type='text/template']".format(t));return n.length?n.html():""},this.formElm=function(){if($(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker){var e=function(t){var n=t.substring(1),i=parseInt(n,16);return.2126*(i>>16&255)+.7152*(i>>8&255)+.0722*(i>>0&255)},n=this._csel("-form-color");$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){$(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)).iris("hide"):$(n).iris("hide")})}},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),e=t.parents("form").eq(0);i&&("-1"!==i.val()&&e.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){var i=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");i&&""===i.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t=this.n;if(this.ho){var n=new Date;t=t+n.getFullYear()+n.getMonth()+n.getDate()}window[t]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})}),function(o){var n=o.n,ho=o.ho,c="";for(var i in ho&&(c="t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),"),o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}(this)}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var n={onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},c=s.extend(!0,{},n,t);return s(this).each(function(){function t(){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),e=n.attr("tiwl-hide"),o=c.isChecked.call(n);return"string"==typeof i&&t(i,o),"string"==typeof e&&t(e,!o),n}var n=s(this);return n.is("input")&&"checkbox"==n.attr("type")?(s(this).on("change",t),t.call(n)):n})},s.fn.tiwl_byvalueblock=function(t){var n={onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},i=s.extend(!0,{},n,t);return s(this).each(function(){function t(e){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),o=n.attr("tiwl-hide"),c=e.onClick.call(n);return"string"==typeof i&&t(i,c),"string"==typeof o&&t(o,!c),n}var n=s(this);return n.is("input")||n.is("select")?(s(this).on("change",function(){t.call(this,i)}),t.call(n,i)):n})};var n=new TInvWL(s);s(document).ready(function(){if(n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover){var t=s(".tinvwl-help");t.popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})}s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})})}(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.24.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(c){c.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href.split("?")[0],text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){c(this).append(c("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){c(t).addClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){c(t).removeClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(c(this).is(".disabled-add-wishlist"))return!1;c(this).is(".ftinvwl-animated")&&c(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):e.onActionProduct.call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var o={};return c("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val();("checkbox"!==i&&"radio"!==i||c(this).is(":checked"))&&(o["form"+t]=n)}),o=o.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof o)return t.in;var i=parseInt(o);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=e.onPrepareList.call(t)||t,t=e.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove();var n="";switch(t.length){case 0:break;default:n=c("<ul>");c.each(t,function(t,i){n.append(c("<li>").html(c("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}n.length&&c(this).closest(".tinv-modal-inner").find("img").after(c("<div>").addClass("already-in").html(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(){},msg:function(t){if(!t)return!1;var i=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(){},make_remove:function(){},wishlists_data:function(t){d(JSON.stringify(t))}}};i.onActionProduct=function(t,i){var r={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:c(this).attr("data-tinv-wl-producttype"),product_id:c(this).attr("data-tinv-wl-product")||0,product_variation:c(this).attr("data-tinv-wl-productvariation")||0,product_action:c(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},n=this,o=[],d=new FormData;tinvwl_add_to_wishlist.wpml&&(r.lang=tinvwl_add_to_wishlist.wpml),c('form.cart[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"], form.vtajaxform[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),o.length||(c(n).closest("form.cart[method=post], form.vtajaxform[method=post]").each(function(){o.push(c(this))}),o.length||o.push(c("form.cart[method=post]"))),c('.tinv-wraper[data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),c.each(o,function(t,i){c(i).find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){function e(t,i){if("object"!==_typeof(i))return i;for(var n in void 0===t&&(t={}),i)if(""===n){var o=-1;for(o in t)o=o;t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val(),o=10;if("button"!==i&&void 0!==t){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<o;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=n,n=l}t=a[1],o--}if("file"===i){var s=c(this)[0].files;s&&d.append(t,s[0])}"checkbox"===i||"radio"===i?c(this).is(":checked")&&(n.length||"object"===_typeof(n)||(n=!0),r.form[t]=e(r.form[t],n)):r.form[t]=e(r.form[t],n)}})}),r=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)})};var e=c.extend(!0,{},i,t);return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;if(e.dialogbox&&e.dialogbox.length&&(this.tinvwl_dialog=e.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=e.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=c(this).nextAll(e.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(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)});var o=this;c(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",".tinvwl_add_to_wishlist_button",function(t){if(c("body").trigger("tinvwl_add_to_wishlist_button_click",[this]),c(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);c(this).is(".inited-add-wishlist")||c(this).tinvwl_to_wishlist({onInited:function(t){c(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),c(document).on("hide_variation",".variations_form",function(t){var i=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(i.attr("data-tinv-wl-productvariation",0),i.length&&i.attr("data-tinv-wl-list")){var n=JSON.parse(i.attr("data-tinv-wl-list")),o=!1,e="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var a in n)n[a].hasOwnProperty("in")&&Array.isArray(n[a].in)&&-1<(n[a].in||[]).indexOf(0)&&(o=!0);i.toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&e).attr("data-tinv-wl-action",o&&e?"remove":"addto")}i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),c(document).on("show_variation",".variations_form",function(t,i,n){var o=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(o.attr("data-tinv-wl-productvariation",i.variation_id),o.length&&o.attr("data-tinv-wl-list")){var e=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in e)e[s].hasOwnProperty("in")&&Array.isArray(e[s].in)&&-1<(e[s].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){if(s===t.originalEvent.key&&localStorage.getItem(s)!==sessionStorage.getItem(s)&&localStorage.getItem(s)){var i=JSON.parse(localStorage.getItem(s));"object"===_typeof(i)&&null!==i&&(i.hasOwnProperty("products")||i.hasOwnProperty("counter"))&&d(localStorage.getItem(s))}});var n=[],i=!1;c("a.tinvwl_add_to_wishlist_button").each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))}),c(".wishlist_products_counter_number").each(function(){i=!0});function o(){if(n.length||i){var t={};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.plugin_url+"includes/api/ajax.php",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)}).fail(function(){!function(){if(n.length||i){var t={ids:n,counter:i,tinvwl_request:!0};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.rest_root+"wishlist/v1/products",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)})}}()})}}function e(){if(l&&(tinvwl_add_to_wishlist.update_wishlists_data&&localStorage.setItem(s,""),localStorage.getItem(s))){var t=JSON.parse(localStorage.getItem(s));if("object"===_typeof(t)&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter"))&&(!t.hasOwnProperty("lang")&&!tinvwl_add_to_wishlist.wpml||tinvwl_add_to_wishlist.wpml&&t.lang===tinvwl_add_to_wishlist.wpml))return void r(t)}tinvwl_add_to_wishlist.block_ajax_wishlists_data||o()}e();var t=new MutationObserver(function(t){n=[],t.forEach(function(t){var i=t.addedNodes;null!==i&&c(i).each(function(){var t=c(this).find(".tinvwl_add_to_wishlist_button");t.length&&t.each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))})})}),n.length&&e()}),a=document.body;t.observe(a,{childList:!0,subtree:!0})});var l=!0,s=tinvwl_add_to_wishlist.hash_key;try{l="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("ti","test"),window.sessionStorage.removeItem("ti"),window.localStorage.setItem("ti","test"),window.localStorage.removeItem("ti")}catch(t){l=!1}function r(t){var l="1"==window.tinvwl_add_to_wishlist.simple_flow;l&&c("a.tinvwl_add_to_wishlist_button").each(function(){c(this).removeClass("tinvwl-product-make-remove").removeClass("tinvwl-product-already-on-wishlist").removeClass("tinvwl-product-in-list").attr("data-tinv-wl-action","addto").attr("data-tinv-wl-list","[]")}),c("body").trigger("tinvwl_wishlist_mark_products",[t]),c.each(t.products,function(t,e){var a=t;c('a.tinvwl_add_to_wishlist_button[data-tinv-wl-product="'+a+'"]').each(function(){var t=parseInt(c(this).attr("data-tinv-wl-productvariation")),i=c(this).data("tinv-wl-productvariations")||[],n=!1;for(var o in e)e[o].hasOwnProperty("in")&&Array.isArray(e[o].in)&&(-1<(e[o].in||[]).indexOf(a)||-1<(e[o].in||[]).indexOf(t)||i.some(function(t){return 0<=(e[o].in||[]).indexOf(t)}))&&(n=!0);c("body").trigger("tinvwl_wishlist_product_marked",[this,n]),c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",n).toggleClass("tinvwl-product-make-remove",n&&l).attr("data-tinv-wl-action",n&&l?"remove":"addto")})}),function(t){"1"==window.tinvwl_add_to_wishlist.hide_zero_counter&&0===t&&(t="false");jQuery("i.wishlist-icon").addClass("added"),"false"!==t?(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html(t),jQuery("i.wishlist-icon").attr("data-icon-label",t)):(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html("").closest("span.wishlist-counter-with-products").removeClass("wishlist-counter-with-products"),jQuery("i.wishlist-icon").removeAttr("data-icon-label"));var i=!("0"==t||"false"==t);jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",i),setTimeout(function(){jQuery("i.wishlist-icon").removeClass("added")},500)}(t.counter)}function d(t){l&&(localStorage.setItem(s,t),sessionStorage.setItem(s,t),r(JSON.parse(t)))}}(jQuery),function(o){o(document).ready(function(){if(o("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),o(".tinv-lists-nav").each(function(){o(this).html().trim().length||o(this).remove()}),o("body").on("click",".social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)",function(t){var i=window.open(o(this).attr("href"),o(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}o("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),o("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),o(this).parents(".tinv-modal:first").removeClass("tinv-modal-open"),o("body").trigger("tinvwl_modal_closed",[this])}),o("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){o(this).data("url")&&(t.preventDefault(),window.location=o(this).data("url"))});var n=o(".tinv-wishlist .navigation-button");n.length&&n.each(function(){var t=o(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),o(".tinv-login .showlogin").off("click").on("click",function(t){t.preventDefault(),o(this).closest(".tinv-login").find(".login").toggle()}),o(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){o(this).toggle(!!o(this).children().not(".look_in").length||!!o(this).children(".look_in").children().length)})})}(jQuery),function(o){o.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return o(this).val()},rule:function(){var t=o(this).parents("form").eq(0).find(n.selector),i=n.invert;return 0===t.length?n.ifempty:(t.each(function(){i&&!n.invert||!i&&n.invert||(i=Boolean(n.validate.call(o(this))))}),i)}},n=o.extend(!0,{},i,t);return o(this).each(function(){o(this).on("click",function(t){n.rule.call(o(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},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.24.3
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(c){c.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href.split("?")[0],text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){c(this).append(c("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){c(t).addClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){c(t).removeClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(c(this).is(".disabled-add-wishlist"))return!1;c(this).is(".ftinvwl-animated")&&c(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):e.onActionProduct.call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var o={};return c("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val();("checkbox"!==i&&"radio"!==i||c(this).is(":checked"))&&(o["form"+t]=n)}),o=o.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof o)return t.in;var i=parseInt(o);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=e.onPrepareList.call(t)||t,t=e.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove();var n="";switch(t.length){case 0:break;default:n=c("<ul>");c.each(t,function(t,i){n.append(c("<li>").html(c("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}n.length&&c(this).closest(".tinv-modal-inner").find("img").after(c("<div>").addClass("already-in").html(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(){},msg:function(t){if(!t)return!1;var i=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(){},make_remove:function(){},wishlists_data:function(t){d(JSON.stringify(t))}}};i.onActionProduct=function(t,i){var r={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:c(this).attr("data-tinv-wl-producttype"),product_id:c(this).attr("data-tinv-wl-product")||0,product_variation:c(this).attr("data-tinv-wl-productvariation")||0,product_action:c(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},n=this,o=[],d=new FormData;tinvwl_add_to_wishlist.wpml&&(r.lang=tinvwl_add_to_wishlist.wpml),c('form.cart[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"], form.vtajaxform[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),o.length||(c(n).closest("form.cart[method=post], form.vtajaxform[method=post]").each(function(){o.push(c(this))}),o.length||o.push(c("form.cart[method=post]"))),c('.tinv-wraper[data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),c.each(o,function(t,i){c(i).find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){function e(t,i){if("object"!==_typeof(i))return i;for(var n in void 0===t&&(t={}),i)if(""===n){var o=-1;for(o in t)o=o;t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val(),o=10;if("button"!==i&&void 0!==t){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<o;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=n,n=l}t=a[1],o--}if("file"===i){var s=c(this)[0].files;s&&d.append(t,s[0])}"checkbox"===i||"radio"===i?c(this).is(":checked")&&(n.length||"object"===_typeof(n)||(n=!0),r.form[t]=e(r.form[t],n)):r.form[t]=e(r.form[t],n)}})}),r=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)})};var e=c.extend(!0,{},i,t);return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;if(e.dialogbox&&e.dialogbox.length&&(this.tinvwl_dialog=e.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=e.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=c(this).nextAll(e.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(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)});var o=this;c(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",".tinvwl_add_to_wishlist_button",function(t){if(c("body").trigger("tinvwl_add_to_wishlist_button_click",[this]),c(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);c(this).is(".inited-add-wishlist")||c(this).tinvwl_to_wishlist({onInited:function(t){c(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),c(document).on("hide_variation",".variations_form",function(t){var i=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(i.attr("data-tinv-wl-productvariation",0),i.length&&i.attr("data-tinv-wl-list")){var n=JSON.parse(i.attr("data-tinv-wl-list")),o=!1,e="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var a in n)n[a].hasOwnProperty("in")&&Array.isArray(n[a].in)&&-1<(n[a].in||[]).indexOf(0)&&(o=!0);i.toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&e).attr("data-tinv-wl-action",o&&e?"remove":"addto")}i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),c(document).on("show_variation",".variations_form",function(t,i,n){var o=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(o.attr("data-tinv-wl-productvariation",i.variation_id),o.length&&o.attr("data-tinv-wl-list")){var e=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in e)e[s].hasOwnProperty("in")&&Array.isArray(e[s].in)&&-1<(e[s].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){if(s===t.originalEvent.key&&localStorage.getItem(s)!==sessionStorage.getItem(s)&&localStorage.getItem(s)){var i=JSON.parse(localStorage.getItem(s));"object"===_typeof(i)&&null!==i&&(i.hasOwnProperty("products")||i.hasOwnProperty("counter"))&&d(localStorage.getItem(s))}});var n=[],i=!1;c("a.tinvwl_add_to_wishlist_button").each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))}),c(".wishlist_products_counter_number").each(function(){i=!0});function o(){if(n.length||i){var t={};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.plugin_url+"includes/api/ajax.php",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)}).fail(function(){!function(){if(n.length||i){var t={ids:n,counter:i,tinvwl_request:!0};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.rest_root+"wishlist/v1/products",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)})}}()})}}function e(){if(l&&(tinvwl_add_to_wishlist.update_wishlists_data&&localStorage.setItem(s,""),localStorage.getItem(s))){var t=JSON.parse(localStorage.getItem(s));if("object"===_typeof(t)&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter"))&&(!t.hasOwnProperty("lang")&&!tinvwl_add_to_wishlist.wpml||tinvwl_add_to_wishlist.wpml&&t.lang===tinvwl_add_to_wishlist.wpml))return void r(t)}tinvwl_add_to_wishlist.block_ajax_wishlists_data||o()}e();var t=new MutationObserver(function(t){n=[],t.forEach(function(t){var i=t.addedNodes;null!==i&&c(i).each(function(){var t=c(this).find(".tinvwl_add_to_wishlist_button");t.length&&t.each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))})})}),n.length&&e()}),a=document.body;t.observe(a,{childList:!0,subtree:!0})});var l=!0,s=tinvwl_add_to_wishlist.hash_key;try{l="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("ti","test"),window.sessionStorage.removeItem("ti"),window.localStorage.setItem("ti","test"),window.localStorage.removeItem("ti")}catch(t){l=!1}function r(t){var l="1"==window.tinvwl_add_to_wishlist.simple_flow;l&&c("a.tinvwl_add_to_wishlist_button").each(function(){c(this).removeClass("tinvwl-product-make-remove").removeClass("tinvwl-product-already-on-wishlist").removeClass("tinvwl-product-in-list").attr("data-tinv-wl-action","addto").attr("data-tinv-wl-list","[]")}),c("body").trigger("tinvwl_wishlist_mark_products",[t]),c.each(t.products,function(t,e){var a=t;c('a.tinvwl_add_to_wishlist_button[data-tinv-wl-product="'+a+'"]').each(function(){var t=parseInt(c(this).attr("data-tinv-wl-productvariation")),i=c(this).data("tinv-wl-productvariations")||[],n=!1;for(var o in e)e[o].hasOwnProperty("in")&&Array.isArray(e[o].in)&&(-1<(e[o].in||[]).indexOf(a)||-1<(e[o].in||[]).indexOf(t)||i.some(function(t){return 0<=(e[o].in||[]).indexOf(t)}))&&(n=!0);c("body").trigger("tinvwl_wishlist_product_marked",[this,n]),c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",n).toggleClass("tinvwl-product-make-remove",n&&l).attr("data-tinv-wl-action",n&&l?"remove":"addto")})}),function(t){"1"==window.tinvwl_add_to_wishlist.hide_zero_counter&&0===t&&(t="false");jQuery("i.wishlist-icon").addClass("added"),"false"!==t?(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html(t),jQuery("i.wishlist-icon").attr("data-icon-label",t)):(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html("").closest("span.wishlist-counter-with-products").removeClass("wishlist-counter-with-products"),jQuery("i.wishlist-icon").removeAttr("data-icon-label"));var i=!("0"==t||"false"==t);jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",i),setTimeout(function(){jQuery("i.wishlist-icon").removeClass("added")},500)}(t.counter)}function d(t){l&&(localStorage.setItem(s,t),sessionStorage.setItem(s,t),r(JSON.parse(t)))}}(jQuery),function(o){o(document).ready(function(){if(o("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),o(".tinv-lists-nav").each(function(){o(this).html().trim().length||o(this).remove()}),o("body").on("click",".social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)",function(t){var i=window.open(o(this).attr("href"),o(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}o("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),o("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),o(this).parents(".tinv-modal:first").removeClass("tinv-modal-open"),o("body").trigger("tinvwl_modal_closed",[this])}),o("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){o(this).data("url")&&(t.preventDefault(),window.location=o(this).data("url"))});var n=o(".tinv-wishlist .navigation-button");n.length&&n.each(function(){var t=o(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),o(".tinv-login .showlogin").off("click").on("click",function(t){t.preventDefault(),o(this).closest(".tinv-login").find(".login").toggle()}),o(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){o(this).toggle(!!o(this).children().not(".look_in").length||!!o(this).children(".look_in").children().length)})})}(jQuery),function(o){o.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return o(this).val()},rule:function(){var t=o(this).parents("form").eq(0).find(n.selector),i=n.invert;return 0===t.length?n.ifempty:(t.each(function(){i&&!n.invert||!i&&n.invert||(i=Boolean(n.validate.call(o(this))))}),i)}},n=o.extend(!0,{},i,t);return o(this).each(function(){o(this).on("click",function(t){n.rule.call(o(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},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);
|
includes/product.helper.php
CHANGED
@@ -7,14 +7,15 @@
|
|
7 |
*/
|
8 |
|
9 |
// If this file is called directly, abort.
|
10 |
-
if (
|
11 |
die;
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
* Product function class
|
16 |
*/
|
17 |
-
class TInvWL_Product
|
|
|
18 |
|
19 |
/**
|
20 |
* Table name
|
@@ -50,21 +51,22 @@ class TInvWL_Product {
|
|
50 |
* @global wpdb $wpdb
|
51 |
*
|
52 |
*/
|
53 |
-
function __construct(
|
|
|
54 |
global $wpdb;
|
55 |
|
56 |
-
$this->wishlist = (array)
|
57 |
-
$this->_name
|
58 |
-
$this->table
|
59 |
-
$this->user
|
60 |
-
if (
|
61 |
$user = wp_get_current_user();
|
62 |
-
if (
|
63 |
$this->user = $user->ID;
|
64 |
}
|
65 |
}
|
66 |
|
67 |
-
add_filter(
|
68 |
}
|
69 |
|
70 |
/**
|
@@ -72,8 +74,9 @@ class TInvWL_Product {
|
|
72 |
*
|
73 |
* @return int
|
74 |
*/
|
75 |
-
function wishlist_id()
|
76 |
-
|
|
|
77 |
return $this->wishlist['ID'];
|
78 |
}
|
79 |
|
@@ -85,8 +88,9 @@ class TInvWL_Product {
|
|
85 |
*
|
86 |
* @return int
|
87 |
*/
|
88 |
-
function wishlist_author()
|
89 |
-
|
|
|
90 |
return $this->wishlist['author'];
|
91 |
}
|
92 |
|
@@ -101,27 +105,28 @@ class TInvWL_Product {
|
|
101 |
*
|
102 |
* @return boolean
|
103 |
*/
|
104 |
-
function add_product(
|
105 |
-
|
106 |
-
|
|
|
107 |
'variation_id' => FILTER_VALIDATE_INT,
|
108 |
-
'wishlist_id'
|
109 |
-
'quantity'
|
110 |
-
)
|
111 |
-
if (
|
112 |
$_data['quantity'] = 1;
|
113 |
}
|
114 |
-
if (
|
115 |
$_data['wishlist_id'] = $this->wishlist_id();
|
116 |
}
|
117 |
-
$product_data = $this->check_product(
|
118 |
-
if (
|
119 |
return false;
|
120 |
}
|
121 |
-
if (
|
122 |
-
return $this->update(
|
123 |
} else {
|
124 |
-
return $this->add(
|
125 |
}
|
126 |
}
|
127 |
|
@@ -135,64 +140,65 @@ class TInvWL_Product {
|
|
135 |
* @global wpdb $wpdb
|
136 |
*
|
137 |
*/
|
138 |
-
function add(
|
|
|
139 |
|
140 |
$default = array(
|
141 |
-
'wishlist_id'
|
142 |
-
'product_id'
|
143 |
'variation_id' => 0,
|
144 |
-
'formdata'
|
145 |
-
'author'
|
146 |
-
'date'
|
147 |
-
'quantity'
|
148 |
-
'price'
|
149 |
-
'in_stock'
|
150 |
);
|
151 |
-
$data
|
152 |
-
'author'
|
153 |
-
'product_id'
|
154 |
-
'quantity'
|
155 |
'variation_id' => FILTER_VALIDATE_INT,
|
156 |
-
'wishlist_id'
|
157 |
-
)
|
158 |
-
$data
|
159 |
|
160 |
-
$data = tinv_array_merge(
|
161 |
|
162 |
-
if (
|
163 |
return false;
|
164 |
}
|
165 |
|
166 |
-
$product_data = $this->product_data(
|
167 |
|
168 |
-
if (
|
169 |
return false;
|
170 |
}
|
171 |
|
172 |
-
if (
|
173 |
$data['quantity'] = 1;
|
174 |
}
|
175 |
|
176 |
-
$data
|
177 |
$data['in_stock'] = $product_data->is_in_stock();
|
178 |
|
179 |
-
$data['formdata'] = $this->prepare_save_meta(
|
180 |
|
181 |
-
if (
|
182 |
-
$data['price'] = filter_var(
|
183 |
} else {
|
184 |
-
$data['price'] = filter_var(
|
185 |
}
|
186 |
|
187 |
global $wpdb;
|
188 |
-
if (
|
189 |
$id = $wpdb->insert_id;
|
190 |
|
191 |
/* Run a 3rd party code when product added to a wishlist.
|
192 |
*
|
193 |
* @param array $data product data including author and wishlist IDs.
|
194 |
* */
|
195 |
-
do_action(
|
196 |
|
197 |
return $id;
|
198 |
}
|
@@ -207,15 +213,16 @@ class TInvWL_Product {
|
|
207 |
*
|
208 |
* @return array
|
209 |
*/
|
210 |
-
function get_wishlist(
|
211 |
-
|
|
|
212 |
$data['wishlist_id'] = $this->wishlist_id();
|
213 |
}
|
214 |
-
if (
|
215 |
return array();
|
216 |
}
|
217 |
|
218 |
-
return $this->get(
|
219 |
}
|
220 |
|
221 |
/**
|
@@ -228,37 +235,38 @@ class TInvWL_Product {
|
|
228 |
*
|
229 |
* @return mixed
|
230 |
*/
|
231 |
-
function check_product(
|
232 |
-
|
233 |
-
$
|
234 |
-
$
|
|
|
235 |
|
236 |
-
if (
|
237 |
$wishlist_id = $this->wishlist_id();
|
238 |
}
|
239 |
-
if (
|
240 |
return false;
|
241 |
}
|
242 |
|
243 |
-
$product_data = $this->product_data(
|
244 |
|
245 |
-
if (
|
246 |
return false;
|
247 |
}
|
248 |
|
249 |
-
$product_id
|
250 |
-
$variation_id = $product_data->is_type(
|
251 |
|
252 |
-
$products = $this->get(
|
253 |
-
'product_id'
|
254 |
'variation_id' => $variation_id,
|
255 |
-
'wishlist_id'
|
256 |
-
'formdata'
|
257 |
-
'count'
|
258 |
-
'external'
|
259 |
-
)
|
260 |
|
261 |
-
return array_shift(
|
262 |
}
|
263 |
|
264 |
/**
|
@@ -271,160 +279,160 @@ class TInvWL_Product {
|
|
271 |
* @global wpdb $wpdb
|
272 |
*
|
273 |
*/
|
274 |
-
function get(
|
|
|
275 |
global $wpdb;
|
276 |
|
277 |
$default = array(
|
278 |
-
'count'
|
279 |
-
'field'
|
280 |
-
'offset'
|
281 |
-
'order'
|
282 |
'order_by' => 'date',
|
283 |
'external' => true,
|
284 |
-
'sql'
|
285 |
);
|
286 |
|
287 |
-
foreach (
|
288 |
-
if (
|
289 |
-
$default[
|
290 |
-
unset(
|
291 |
}
|
292 |
}
|
293 |
|
294 |
-
$default['offset'] = absint(
|
295 |
-
$default['count']
|
296 |
-
if (
|
297 |
-
$default['field'] = '`' . implode(
|
298 |
-
} elseif (
|
299 |
-
$default['field'] = array(
|
300 |
-
$default['field'] = '`' . implode(
|
301 |
} else {
|
302 |
$default['field'] = '*';
|
303 |
}
|
304 |
-
if (
|
305 |
$default['field'] = 'COUNT(`ID`) as `count`';
|
306 |
}
|
307 |
|
308 |
-
$sql
|
309 |
$where = '1';
|
310 |
-
if (
|
311 |
-
if (
|
312 |
$product_id = $variation_id = 0;
|
313 |
-
if (
|
314 |
$product_id = $data['product_id'];
|
315 |
}
|
316 |
-
if (
|
317 |
$variation_id = $data['variation_id'];
|
318 |
}
|
319 |
-
$data['formdata'] = trim(
|
320 |
-
unset(
|
321 |
}
|
322 |
-
foreach (
|
323 |
-
$s = is_array(
|
324 |
-
if (
|
325 |
-
foreach (
|
326 |
-
$v[
|
327 |
}
|
328 |
-
$v = implode(
|
329 |
$v = "($v)";
|
330 |
} else {
|
331 |
-
$v = $wpdb->prepare(
|
332 |
}
|
333 |
-
$data[
|
334 |
}
|
335 |
-
$where = implode(
|
336 |
-
$sql
|
337 |
}
|
338 |
|
339 |
-
$sql .= sprintf(
|
340 |
-
if (
|
341 |
-
$replacer
|
342 |
-
$replace[0]
|
343 |
$replacer[0] = $this->table;
|
344 |
-
$replace[1]
|
345 |
$replacer[1] = $where;
|
346 |
|
347 |
-
foreach (
|
348 |
-
$i = count(
|
349 |
|
350 |
-
$replace[
|
351 |
-
$replacer[
|
352 |
}
|
353 |
|
354 |
-
$sql = str_replace(
|
355 |
}
|
356 |
-
$products = $wpdb->get_results(
|
357 |
|
358 |
-
if (
|
359 |
return array();
|
360 |
}
|
361 |
|
362 |
-
if (
|
363 |
return $products[0]['count'];
|
364 |
}
|
365 |
$ids = array();
|
366 |
-
foreach (
|
367 |
-
if (
|
368 |
-
$product
|
369 |
-
'ID'
|
370 |
-
'wishlist_id'
|
371 |
-
'product_id'
|
372 |
'variation_id' => FILTER_VALIDATE_INT,
|
373 |
-
'author'
|
374 |
-
'date'
|
375 |
-
'formdata'
|
376 |
-
'quantity'
|
377 |
-
'price'
|
378 |
-
'in_stock'
|
379 |
-
)
|
380 |
$product['quantity'] = 1;
|
381 |
}
|
382 |
|
383 |
-
if (
|
384 |
-
if (
|
385 |
-
$ids[] = (
|
386 |
}
|
387 |
}
|
388 |
$product['meta'] = array();
|
389 |
-
if (
|
390 |
$meta = $product['formdata'];
|
391 |
-
unset(
|
392 |
|
393 |
-
$product['meta'] = $this->prepare_retrun_meta(
|
394 |
}
|
395 |
-
$products[
|
396 |
}
|
397 |
|
398 |
-
if (
|
399 |
-
$args
|
400 |
'include' => $ids,
|
401 |
-
'limit'
|
402 |
);
|
403 |
-
$_products = wc_get_products(
|
|
|
404 |
|
405 |
-
|
406 |
-
|
407 |
-
foreach ( $products as $key => $wlproduct ) {
|
408 |
-
if ( ! isset( $wlproduct['product_id'] ) ) {
|
409 |
continue;
|
410 |
}
|
411 |
|
412 |
-
if (
|
413 |
-
if (
|
414 |
-
$products[
|
415 |
} else {
|
416 |
-
$products[
|
417 |
}
|
418 |
}
|
419 |
}
|
420 |
}
|
421 |
|
422 |
// remove deleted products from database
|
423 |
-
if (
|
424 |
-
foreach (
|
425 |
-
if (
|
426 |
-
unset(
|
427 |
-
$this->remove(
|
428 |
}
|
429 |
}
|
430 |
}
|
@@ -441,17 +449,18 @@ class TInvWL_Product {
|
|
441 |
*
|
442 |
* @return mixed
|
443 |
*/
|
444 |
-
function product_data(
|
445 |
-
|
446 |
-
$
|
|
|
447 |
|
448 |
-
$product_data = apply_filters(
|
449 |
|
450 |
-
if (
|
451 |
return null;
|
452 |
}
|
453 |
|
454 |
-
$product_data->variation_id = absint(
|
455 |
|
456 |
return $product_data;
|
457 |
}
|
@@ -467,66 +476,67 @@ class TInvWL_Product {
|
|
467 |
* @global wpdb $wpdb
|
468 |
*
|
469 |
*/
|
470 |
-
function update(
|
471 |
-
|
|
|
472 |
$meta = $data['meta'];
|
473 |
}
|
474 |
|
475 |
-
$data = filter_var_array(
|
476 |
-
'product_id'
|
477 |
-
'quantity'
|
478 |
'variation_id' => FILTER_VALIDATE_INT,
|
479 |
-
'wishlist_id'
|
480 |
-
'author'
|
481 |
-
)
|
482 |
-
$data = array_filter(
|
483 |
|
484 |
-
if (
|
485 |
$data['wishlist_id'] = $this->wishlist_id();
|
486 |
}
|
487 |
-
if (
|
488 |
$data['variation_id'] = 0;
|
489 |
}
|
490 |
|
491 |
-
if (
|
492 |
return false;
|
493 |
}
|
494 |
-
$product_data = $this->product_data(
|
495 |
-
if (
|
496 |
return false;
|
497 |
}
|
498 |
|
499 |
-
if (
|
500 |
$data['quantity'] = 1;
|
501 |
}
|
502 |
|
503 |
-
$data
|
504 |
$data['in_stock'] = $product_data->is_in_stock();
|
505 |
|
506 |
-
if (
|
507 |
-
$data['price'] = filter_var(
|
508 |
} else {
|
509 |
-
$data['price'] = filter_var(
|
510 |
}
|
511 |
|
512 |
global $wpdb;
|
513 |
|
514 |
-
$res_update = $wpdb->update(
|
515 |
-
'product_id'
|
516 |
'variation_id' => $data['variation_id'],
|
517 |
-
'wishlist_id'
|
518 |
-
'formdata'
|
519 |
-
)
|
520 |
|
521 |
-
if (
|
522 |
|
523 |
/* Run a 3rd party code when product updated on a wishlist.
|
524 |
*
|
525 |
* @param array $data product data including author and wishlist IDs.
|
526 |
* */
|
527 |
-
do_action(
|
528 |
|
529 |
-
return (
|
530 |
}
|
531 |
|
532 |
return false;
|
@@ -544,29 +554,30 @@ class TInvWL_Product {
|
|
544 |
* @global wpdb $wpdb
|
545 |
*
|
546 |
*/
|
547 |
-
function remove_product_from_wl(
|
|
|
548 |
global $wpdb;
|
549 |
-
if (
|
550 |
$wishlist_id = $this->wishlist_id();
|
551 |
}
|
552 |
-
if (
|
553 |
return false;
|
554 |
}
|
555 |
-
if (
|
556 |
-
return false !== $wpdb->delete(
|
557 |
}
|
558 |
|
559 |
-
$data
|
560 |
-
'wishlist_id'
|
561 |
-
'product_id'
|
562 |
'variation_id' => $variation_id,
|
563 |
);
|
564 |
-
$data['formdata'] = $this->prepare_save_meta(
|
565 |
|
566 |
-
$result = false !== $wpdb->delete(
|
567 |
-
if (
|
568 |
-
do_action(
|
569 |
-
set_transient(
|
570 |
}
|
571 |
|
572 |
return $result;
|
@@ -581,16 +592,17 @@ class TInvWL_Product {
|
|
581 |
* @global wpdb $wpdb
|
582 |
*
|
583 |
*/
|
584 |
-
function remove_product(
|
585 |
-
|
|
|
586 |
return false;
|
587 |
}
|
588 |
|
589 |
global $wpdb;
|
590 |
-
$result = false !== $wpdb->delete(
|
591 |
-
if (
|
592 |
-
do_action(
|
593 |
-
set_transient(
|
594 |
}
|
595 |
|
596 |
return $result;
|
@@ -605,22 +617,23 @@ class TInvWL_Product {
|
|
605 |
* @global wpdb $wpdb
|
606 |
*
|
607 |
*/
|
608 |
-
function get_wishlist_by_product_id(
|
609 |
-
|
|
|
610 |
return false;
|
611 |
}
|
612 |
|
613 |
global $wpdb;
|
614 |
-
$sql
|
615 |
-
$result = $wpdb->get_results(
|
616 |
|
617 |
-
if (
|
618 |
return false;
|
619 |
}
|
620 |
|
621 |
$wl = new TInvWL_Wishlist();
|
622 |
|
623 |
-
$wishlist = $wl->get_by_id(
|
624 |
|
625 |
return $wishlist;
|
626 |
}
|
@@ -634,20 +647,21 @@ class TInvWL_Product {
|
|
634 |
* @global wpdb $wpdb
|
635 |
*
|
636 |
*/
|
637 |
-
function remove(
|
638 |
-
|
|
|
639 |
return false;
|
640 |
}
|
641 |
|
642 |
global $wpdb;
|
643 |
-
$result = false !== $wpdb->delete(
|
644 |
-
if (
|
645 |
/* Run a 3rd party code when product removed from a wishlist.
|
646 |
*
|
647 |
* @param array $data product data including author and wishlist IDs.
|
648 |
* */
|
649 |
-
do_action(
|
650 |
-
set_transient(
|
651 |
}
|
652 |
|
653 |
return $result;
|
@@ -660,7 +674,8 @@ class TInvWL_Product {
|
|
660 |
*
|
661 |
* @return array
|
662 |
*/
|
663 |
-
function clean_meta(
|
|
|
664 |
|
665 |
foreach (
|
666 |
array(
|
@@ -672,11 +687,11 @@ class TInvWL_Product {
|
|
672 |
'product_sku',
|
673 |
) as $field
|
674 |
) {
|
675 |
-
if (
|
676 |
-
unset(
|
677 |
}
|
678 |
}
|
679 |
-
$meta = array_filter(
|
680 |
|
681 |
return $meta;
|
682 |
}
|
@@ -690,11 +705,12 @@ class TInvWL_Product {
|
|
690 |
*
|
691 |
* @return string
|
692 |
*/
|
693 |
-
function prepare_save_meta(
|
694 |
-
|
|
|
695 |
$meta = array();
|
696 |
}
|
697 |
-
$meta = apply_filters(
|
698 |
foreach (
|
699 |
array(
|
700 |
'add-to-cart',
|
@@ -705,16 +721,16 @@ class TInvWL_Product {
|
|
705 |
'product_sku',
|
706 |
) as $field
|
707 |
) {
|
708 |
-
if (
|
709 |
-
unset(
|
710 |
}
|
711 |
}
|
712 |
-
$meta = array_filter(
|
713 |
-
if (
|
714 |
return '';
|
715 |
}
|
716 |
|
717 |
-
return json_encode(
|
718 |
}
|
719 |
|
720 |
/**
|
@@ -727,23 +743,24 @@ class TInvWL_Product {
|
|
727 |
*
|
728 |
* @return array
|
729 |
*/
|
730 |
-
function prepare_retrun_meta(
|
731 |
-
|
|
|
732 |
return array();
|
733 |
}
|
734 |
-
$meta = @json_decode(
|
735 |
-
if (
|
736 |
return array();
|
737 |
}
|
738 |
-
if (
|
739 |
$meta['add-to-cart'] = $product_id;
|
740 |
-
$meta['product_id']
|
741 |
-
$meta['quantity']
|
742 |
-
if (
|
743 |
$meta['variation_id'] = $variation_id;
|
744 |
}
|
745 |
}
|
746 |
|
747 |
-
return apply_filters(
|
748 |
}
|
749 |
}
|
7 |
*/
|
8 |
|
9 |
// If this file is called directly, abort.
|
10 |
+
if (!defined('ABSPATH')) {
|
11 |
die;
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
* Product function class
|
16 |
*/
|
17 |
+
class TInvWL_Product
|
18 |
+
{
|
19 |
|
20 |
/**
|
21 |
* Table name
|
51 |
* @global wpdb $wpdb
|
52 |
*
|
53 |
*/
|
54 |
+
function __construct($wishlist = array(), $plugin_name = TINVWL_PREFIX)
|
55 |
+
{
|
56 |
global $wpdb;
|
57 |
|
58 |
+
$this->wishlist = (array)$wishlist;
|
59 |
+
$this->_name = $plugin_name;
|
60 |
+
$this->table = sprintf('%s%s_%s', $wpdb->prefix, $this->_name, 'items');
|
61 |
+
$this->user = $this->wishlist_author();
|
62 |
+
if (empty($this->user)) {
|
63 |
$user = wp_get_current_user();
|
64 |
+
if ($user->exists()) {
|
65 |
$this->user = $user->ID;
|
66 |
}
|
67 |
}
|
68 |
|
69 |
+
add_filter('tinvwl_addtowishlist_add_form', array($this, 'clean_meta'), 10, 1);
|
70 |
}
|
71 |
|
72 |
/**
|
74 |
*
|
75 |
* @return int
|
76 |
*/
|
77 |
+
function wishlist_id()
|
78 |
+
{
|
79 |
+
if (is_array($this->wishlist) && array_key_exists('ID', $this->wishlist)) {
|
80 |
return $this->wishlist['ID'];
|
81 |
}
|
82 |
|
88 |
*
|
89 |
* @return int
|
90 |
*/
|
91 |
+
function wishlist_author()
|
92 |
+
{
|
93 |
+
if (is_array($this->wishlist) && array_key_exists('author', $this->wishlist)) {
|
94 |
return $this->wishlist['author'];
|
95 |
}
|
96 |
|
105 |
*
|
106 |
* @return boolean
|
107 |
*/
|
108 |
+
function add_product($data = array(), $meta = array())
|
109 |
+
{
|
110 |
+
$_data = filter_var_array($data, array(
|
111 |
+
'product_id' => FILTER_VALIDATE_INT,
|
112 |
'variation_id' => FILTER_VALIDATE_INT,
|
113 |
+
'wishlist_id' => FILTER_VALIDATE_INT,
|
114 |
+
'quantity' => FILTER_VALIDATE_INT,
|
115 |
+
));
|
116 |
+
if (empty($_data['quantity'])) {
|
117 |
$_data['quantity'] = 1;
|
118 |
}
|
119 |
+
if (empty($_data['wishlist_id'])) {
|
120 |
$_data['wishlist_id'] = $this->wishlist_id();
|
121 |
}
|
122 |
+
$product_data = $this->check_product($_data['product_id'], $_data['variation_id'], $_data['wishlist_id'], $meta);
|
123 |
+
if (false === $product_data) {
|
124 |
return false;
|
125 |
}
|
126 |
+
if ($product_data) {
|
127 |
+
return $this->update($data, $meta, $product_data['ID']);
|
128 |
} else {
|
129 |
+
return $this->add($data, $meta);
|
130 |
}
|
131 |
}
|
132 |
|
140 |
* @global wpdb $wpdb
|
141 |
*
|
142 |
*/
|
143 |
+
function add($data = array(), $meta = array())
|
144 |
+
{
|
145 |
|
146 |
$default = array(
|
147 |
+
'wishlist_id' => $this->wishlist_id(),
|
148 |
+
'product_id' => 0,
|
149 |
'variation_id' => 0,
|
150 |
+
'formdata' => '',
|
151 |
+
'author' => $this->user,
|
152 |
+
'date' => current_time('Y-m-d H:i:s'),
|
153 |
+
'quantity' => 1,
|
154 |
+
'price' => 0,
|
155 |
+
'in_stock' => 1,
|
156 |
);
|
157 |
+
$data = filter_var_array($data, apply_filters('tinvwl_wishlist_product_add_field', array(
|
158 |
+
'author' => FILTER_VALIDATE_INT,
|
159 |
+
'product_id' => FILTER_VALIDATE_INT,
|
160 |
+
'quantity' => FILTER_VALIDATE_INT,
|
161 |
'variation_id' => FILTER_VALIDATE_INT,
|
162 |
+
'wishlist_id' => FILTER_VALIDATE_INT,
|
163 |
+
)));
|
164 |
+
$data = array_filter($data);
|
165 |
|
166 |
+
$data = tinv_array_merge($default, $data);
|
167 |
|
168 |
+
if (empty($data['wishlist_id']) || empty($data['product_id'])) {
|
169 |
return false;
|
170 |
}
|
171 |
|
172 |
+
$product_data = $this->product_data($data['product_id'], $data['variation_id']);
|
173 |
|
174 |
+
if ($data['quantity'] <= 0 || !$product_data) {
|
175 |
return false;
|
176 |
}
|
177 |
|
178 |
+
if ($product_data->is_sold_individually()) {
|
179 |
$data['quantity'] = 1;
|
180 |
}
|
181 |
|
182 |
+
$data = apply_filters('tinvwl_wishlist_product_add', $data);
|
183 |
$data['in_stock'] = $product_data->is_in_stock();
|
184 |
|
185 |
+
$data['formdata'] = $this->prepare_save_meta($meta, $data['product_id'], $data['variation_id']);
|
186 |
|
187 |
+
if ($product_data->is_type('variable')) {
|
188 |
+
$data['price'] = filter_var($product_data->get_variation_price('max', false), FILTER_VALIDATE_FLOAT);
|
189 |
} else {
|
190 |
+
$data['price'] = filter_var(($product_data->get_price()), FILTER_VALIDATE_FLOAT);
|
191 |
}
|
192 |
|
193 |
global $wpdb;
|
194 |
+
if ($wpdb->insert($this->table, $data)) { // @codingStandardsIgnoreLine WordPress.VIP.DirectDatabaseQuery.DirectQuery
|
195 |
$id = $wpdb->insert_id;
|
196 |
|
197 |
/* Run a 3rd party code when product added to a wishlist.
|
198 |
*
|
199 |
* @param array $data product data including author and wishlist IDs.
|
200 |
* */
|
201 |
+
do_action('tinvwl_product_added', $data);
|
202 |
|
203 |
return $id;
|
204 |
}
|
213 |
*
|
214 |
* @return array
|
215 |
*/
|
216 |
+
function get_wishlist($data = array(), $count = false)
|
217 |
+
{
|
218 |
+
if (!array_key_exists('wishlist_id', $data)) {
|
219 |
$data['wishlist_id'] = $this->wishlist_id();
|
220 |
}
|
221 |
+
if (empty($data['wishlist_id'])) {
|
222 |
return array();
|
223 |
}
|
224 |
|
225 |
+
return $this->get($data, $count);
|
226 |
}
|
227 |
|
228 |
/**
|
235 |
*
|
236 |
* @return mixed
|
237 |
*/
|
238 |
+
function check_product($product_id, $variation_id = 0, $wishlist_id = 0, $meta = array())
|
239 |
+
{
|
240 |
+
$product_id = absint($product_id);
|
241 |
+
$variation_id = absint($variation_id);
|
242 |
+
$wishlist_id = absint($wishlist_id);
|
243 |
|
244 |
+
if (empty($wishlist_id)) {
|
245 |
$wishlist_id = $this->wishlist_id();
|
246 |
}
|
247 |
+
if (empty($wishlist_id) || empty($product_id)) {
|
248 |
return false;
|
249 |
}
|
250 |
|
251 |
+
$product_data = $this->product_data($product_id, $variation_id);
|
252 |
|
253 |
+
if (!$product_data) {
|
254 |
return false;
|
255 |
}
|
256 |
|
257 |
+
$product_id = $product_data->is_type('variation') ? $product_data->get_parent_id() : $product_data->get_id();
|
258 |
+
$variation_id = $product_data->is_type('variation') ? $product_data->get_id() : 0;
|
259 |
|
260 |
+
$products = $this->get(array(
|
261 |
+
'product_id' => $product_id,
|
262 |
'variation_id' => $variation_id,
|
263 |
+
'wishlist_id' => $wishlist_id,
|
264 |
+
'formdata' => $this->prepare_save_meta($meta, $product_id, $variation_id),
|
265 |
+
'count' => 1,
|
266 |
+
'external' => false,
|
267 |
+
));
|
268 |
|
269 |
+
return array_shift($products);
|
270 |
}
|
271 |
|
272 |
/**
|
279 |
* @global wpdb $wpdb
|
280 |
*
|
281 |
*/
|
282 |
+
function get($data = array(), $count = false)
|
283 |
+
{
|
284 |
global $wpdb;
|
285 |
|
286 |
$default = array(
|
287 |
+
'count' => 10,
|
288 |
+
'field' => null,
|
289 |
+
'offset' => 0,
|
290 |
+
'order' => 'DESC',
|
291 |
'order_by' => 'date',
|
292 |
'external' => true,
|
293 |
+
'sql' => '',
|
294 |
);
|
295 |
|
296 |
+
foreach ($default as $_k => $_v) {
|
297 |
+
if (array_key_exists($_k, $data)) {
|
298 |
+
$default[$_k] = $data[$_k];
|
299 |
+
unset($data[$_k]);
|
300 |
}
|
301 |
}
|
302 |
|
303 |
+
$default['offset'] = absint($default['offset']);
|
304 |
+
$default['count'] = absint($default['count']);
|
305 |
+
if (is_array($default['field'])) {
|
306 |
+
$default['field'] = '`' . implode('`,`', $default['field']) . '`';
|
307 |
+
} elseif (is_string($default['field'])) {
|
308 |
+
$default['field'] = array('ID', $default['field']);
|
309 |
+
$default['field'] = '`' . implode('`,`', $default['field']) . '`';
|
310 |
} else {
|
311 |
$default['field'] = '*';
|
312 |
}
|
313 |
+
if ($count) {
|
314 |
$default['field'] = 'COUNT(`ID`) as `count`';
|
315 |
}
|
316 |
|
317 |
+
$sql = "SELECT {$default[ 'field' ]} FROM `{$this->table}`";
|
318 |
$where = '1';
|
319 |
+
if (!empty($data) && is_array($data)) {
|
320 |
+
if (array_key_exists('meta', $data)) {
|
321 |
$product_id = $variation_id = 0;
|
322 |
+
if (array_key_exists('product_id', $data)) {
|
323 |
$product_id = $data['product_id'];
|
324 |
}
|
325 |
+
if (array_key_exists('variation_id', $data)) {
|
326 |
$variation_id = $data['variation_id'];
|
327 |
}
|
328 |
+
$data['formdata'] = trim($this->prepare_save_meta($data['meta'], $product_id, $variation_id), "'");
|
329 |
+
unset($data['meta']);
|
330 |
}
|
331 |
+
foreach ($data as $f => $v) {
|
332 |
+
$s = is_array($v) ? ' IN ' : '=';
|
333 |
+
if (is_array($v)) {
|
334 |
+
foreach ($v as $_f => $_v) {
|
335 |
+
$v[$_f] = $wpdb->prepare('%s', $_v);
|
336 |
}
|
337 |
+
$v = implode(',', $v);
|
338 |
$v = "($v)";
|
339 |
} else {
|
340 |
+
$v = $wpdb->prepare('%s', $v);
|
341 |
}
|
342 |
+
$data[$f] = sprintf('`%s`%s%s', $f, $s, $v);
|
343 |
}
|
344 |
+
$where = implode(' AND ', $data);
|
345 |
+
$sql .= ' WHERE ' . $where;
|
346 |
}
|
347 |
|
348 |
+
$sql .= sprintf(' ORDER BY `%s` %s LIMIT %d,%d;', $default['order_by'], $default['order'], $default['offset'], $default['count']);
|
349 |
+
if (!empty($default['sql'])) {
|
350 |
+
$replacer = $replace = array();
|
351 |
+
$replace[0] = '{table}';
|
352 |
$replacer[0] = $this->table;
|
353 |
+
$replace[1] = '{where}';
|
354 |
$replacer[1] = $where;
|
355 |
|
356 |
+
foreach ($default as $key => $value) {
|
357 |
+
$i = count($replace);
|
358 |
|
359 |
+
$replace[$i] = '{' . $key . '}';
|
360 |
+
$replacer[$i] = $value;
|
361 |
}
|
362 |
|
363 |
+
$sql = str_replace($replace, $replacer, $default['sql']);
|
364 |
}
|
365 |
+
$products = $wpdb->get_results($sql, ARRAY_A); // WPCS: db call ok; no-cache ok; unprepared SQL ok.
|
366 |
|
367 |
+
if (empty($products) || is_wp_error($products)) {
|
368 |
return array();
|
369 |
}
|
370 |
|
371 |
+
if ($count) {
|
372 |
return $products[0]['count'];
|
373 |
}
|
374 |
$ids = array();
|
375 |
+
foreach ($products as $k => $product) {
|
376 |
+
if (empty($default['sql'])) {
|
377 |
+
$product = filter_var_array($product, array(
|
378 |
+
'ID' => FILTER_VALIDATE_INT,
|
379 |
+
'wishlist_id' => FILTER_VALIDATE_INT,
|
380 |
+
'product_id' => FILTER_VALIDATE_INT,
|
381 |
'variation_id' => FILTER_VALIDATE_INT,
|
382 |
+
'author' => FILTER_VALIDATE_INT,
|
383 |
+
'date' => FILTER_DEFAULT,
|
384 |
+
'formdata' => FILTER_DEFAULT,
|
385 |
+
'quantity' => FILTER_VALIDATE_INT,
|
386 |
+
'price' => FILTER_SANITIZE_NUMBER_FLOAT,
|
387 |
+
'in_stock' => FILTER_VALIDATE_BOOLEAN,
|
388 |
+
));
|
389 |
$product['quantity'] = 1;
|
390 |
}
|
391 |
|
392 |
+
if ($default['external']) {
|
393 |
+
if (isset($product['product_id'])) {
|
394 |
+
$ids[] = (apply_filters('wpml_object_id', $product['product_id'], 'product', false)) ? apply_filters('wpml_object_id', $product['product_id'], 'product', false) : $product['product_id'];
|
395 |
}
|
396 |
}
|
397 |
$product['meta'] = array();
|
398 |
+
if (array_key_exists('formdata', $product)) {
|
399 |
$meta = $product['formdata'];
|
400 |
+
unset($product['formdata']);
|
401 |
|
402 |
+
$product['meta'] = $this->prepare_retrun_meta($meta, $product['product_id'], $product['variation_id'], $product['quantity']);
|
403 |
}
|
404 |
+
$products[$k] = apply_filters('tinvwl_wishlist_product_get', $product);
|
405 |
}
|
406 |
|
407 |
+
if (!empty($ids)) {
|
408 |
+
$args = array(
|
409 |
'include' => $ids,
|
410 |
+
'limit' => count($ids),
|
411 |
);
|
412 |
+
$_products = wc_get_products($args);
|
413 |
+
foreach ($_products as $_product) {
|
414 |
|
415 |
+
foreach ($products as $key => $wlproduct) {
|
416 |
+
if (!isset($wlproduct['product_id'])) {
|
|
|
|
|
417 |
continue;
|
418 |
}
|
419 |
|
420 |
+
if ($_product->get_id() === absint((apply_filters('wpml_object_id', $wlproduct['product_id'], 'product', false)) ? apply_filters('wpml_object_id', $wlproduct['product_id'], 'product', false) : $wlproduct['product_id'])) {
|
421 |
+
if (in_array($_product->get_type(), array('variable', 'grouped'))) {
|
422 |
+
$products[$key]['data'] = $wlproduct['variation_id'] ? wc_get_product(apply_filters('wpml_object_id', $wlproduct['variation_id'], 'product_variation', false)) : $_product;
|
423 |
} else {
|
424 |
+
$products[$key]['data'] = $_product;
|
425 |
}
|
426 |
}
|
427 |
}
|
428 |
}
|
429 |
|
430 |
// remove deleted products from database
|
431 |
+
if ($default['external']) {
|
432 |
+
foreach ($products as $key => $product) {
|
433 |
+
if (empty($product['data'])) {
|
434 |
+
unset($products[$key]);
|
435 |
+
$this->remove($product);
|
436 |
}
|
437 |
}
|
438 |
}
|
449 |
*
|
450 |
* @return mixed
|
451 |
*/
|
452 |
+
function product_data($product_id, $variation_id = 0)
|
453 |
+
{
|
454 |
+
$product_id = absint($product_id);
|
455 |
+
$variation_id = absint($variation_id);
|
456 |
|
457 |
+
$product_data = apply_filters('tinvwl_product_data', wc_get_product($variation_id ? $variation_id : $product_id), $product_id, $variation_id);
|
458 |
|
459 |
+
if (!$product_data || 'trash' === get_post($product_data->get_id())->post_status) {
|
460 |
return null;
|
461 |
}
|
462 |
|
463 |
+
$product_data->variation_id = absint(($product_data->is_type('variation') ? $product_data->get_id() : 0));
|
464 |
|
465 |
return $product_data;
|
466 |
}
|
476 |
* @global wpdb $wpdb
|
477 |
*
|
478 |
*/
|
479 |
+
function update($data = array(), $meta = array(), $id = 0)
|
480 |
+
{
|
481 |
+
if (empty($meta) && array_key_exists('meta', $data) && !empty($data['meta'])) {
|
482 |
$meta = $data['meta'];
|
483 |
}
|
484 |
|
485 |
+
$data = filter_var_array($data, apply_filters('tinvwl_wishlist_product_update_field', array(
|
486 |
+
'product_id' => FILTER_VALIDATE_INT,
|
487 |
+
'quantity' => FILTER_VALIDATE_INT,
|
488 |
'variation_id' => FILTER_VALIDATE_INT,
|
489 |
+
'wishlist_id' => FILTER_VALIDATE_INT,
|
490 |
+
'author' => FILTER_VALIDATE_INT,
|
491 |
+
)));
|
492 |
+
$data = array_filter($data);
|
493 |
|
494 |
+
if (!array_key_exists('wishlist_id', $data)) {
|
495 |
$data['wishlist_id'] = $this->wishlist_id();
|
496 |
}
|
497 |
+
if (!array_key_exists('variation_id', $data)) {
|
498 |
$data['variation_id'] = 0;
|
499 |
}
|
500 |
|
501 |
+
if (empty($data['wishlist_id']) || empty($data['product_id'])) {
|
502 |
return false;
|
503 |
}
|
504 |
+
$product_data = $this->product_data($data['product_id'], $data['variation_id']);
|
505 |
+
if (!$product_data) {
|
506 |
return false;
|
507 |
}
|
508 |
|
509 |
+
if ($product_data->is_sold_individually()) {
|
510 |
$data['quantity'] = 1;
|
511 |
}
|
512 |
|
513 |
+
$data = apply_filters('tinvwl_wishlist_product_update', $data);
|
514 |
$data['in_stock'] = $product_data->is_in_stock();
|
515 |
|
516 |
+
if ($product_data->is_type('variable')) {
|
517 |
+
$data['price'] = filter_var($product_data->get_variation_price('max', false), FILTER_VALIDATE_FLOAT);
|
518 |
} else {
|
519 |
+
$data['price'] = filter_var($product_data->get_price(), FILTER_VALIDATE_FLOAT);
|
520 |
}
|
521 |
|
522 |
global $wpdb;
|
523 |
|
524 |
+
$res_update = $wpdb->update($this->table, $data, array(
|
525 |
+
'product_id' => $data['product_id'],
|
526 |
'variation_id' => $data['variation_id'],
|
527 |
+
'wishlist_id' => $data['wishlist_id'],
|
528 |
+
'formdata' => $this->prepare_save_meta($meta, $data['product_id'], $data['variation_id']),
|
529 |
+
));
|
530 |
|
531 |
+
if ($res_update !== false) { // @codingStandardsIgnoreLine WordPress.VIP.DirectDatabaseQuery.DirectQuery
|
532 |
|
533 |
/* Run a 3rd party code when product updated on a wishlist.
|
534 |
*
|
535 |
* @param array $data product data including author and wishlist IDs.
|
536 |
* */
|
537 |
+
do_action('tinvwl_product_updated', $data);
|
538 |
|
539 |
+
return ($id) ? $id : true;
|
540 |
}
|
541 |
|
542 |
return false;
|
554 |
* @global wpdb $wpdb
|
555 |
*
|
556 |
*/
|
557 |
+
function remove_product_from_wl($wishlist_id = 0, $product_id = 0, $variation_id = 0, $meta = array())
|
558 |
+
{
|
559 |
global $wpdb;
|
560 |
+
if (empty($wishlist_id)) {
|
561 |
$wishlist_id = $this->wishlist_id();
|
562 |
}
|
563 |
+
if (empty($wishlist_id)) {
|
564 |
return false;
|
565 |
}
|
566 |
+
if (empty($product_id)) {
|
567 |
+
return false !== $wpdb->delete($this->table, array('wishlist_id' => $wishlist_id)); // WPCS: db call ok; no-cache ok; unprepared SQL ok.
|
568 |
}
|
569 |
|
570 |
+
$data = array(
|
571 |
+
'wishlist_id' => $wishlist_id,
|
572 |
+
'product_id' => $product_id,
|
573 |
'variation_id' => $variation_id,
|
574 |
);
|
575 |
+
$data['formdata'] = $this->prepare_save_meta($meta, $data['product_id'], $data['variation_id']);
|
576 |
|
577 |
+
$result = false !== $wpdb->delete($this->table, $data); // WPCS: db call ok; no-cache ok; unprepared SQL ok.
|
578 |
+
if ($result) {
|
579 |
+
do_action('tinvwl_wishlist_product_removed_from_wishlist', $wishlist_id, $product_id, $variation_id);
|
580 |
+
set_transient('_tinvwl_update_wishlists_data', '1');
|
581 |
}
|
582 |
|
583 |
return $result;
|
592 |
* @global wpdb $wpdb
|
593 |
*
|
594 |
*/
|
595 |
+
function remove_product($product_id = 0)
|
596 |
+
{
|
597 |
+
if (empty($product_id)) {
|
598 |
return false;
|
599 |
}
|
600 |
|
601 |
global $wpdb;
|
602 |
+
$result = false !== $wpdb->delete($this->table, array('product_id' => $product_id)); // WPCS: db call ok; no-cache ok; unprepared SQL ok.
|
603 |
+
if ($result) {
|
604 |
+
do_action('tinvwl_wishlist_product_removed_by_product', $product_id);
|
605 |
+
set_transient('_tinvwl_update_wishlists_data', '1');
|
606 |
}
|
607 |
|
608 |
return $result;
|
617 |
* @global wpdb $wpdb
|
618 |
*
|
619 |
*/
|
620 |
+
function get_wishlist_by_product_id($product_id = 0)
|
621 |
+
{
|
622 |
+
if (empty($product_id)) {
|
623 |
return false;
|
624 |
}
|
625 |
|
626 |
global $wpdb;
|
627 |
+
$sql = "SELECT `wishlist_id` FROM `{$this->table}` WHERE `ID`={$product_id}";
|
628 |
+
$result = $wpdb->get_results($sql, ARRAY_A);
|
629 |
|
630 |
+
if (!$result) {
|
631 |
return false;
|
632 |
}
|
633 |
|
634 |
$wl = new TInvWL_Wishlist();
|
635 |
|
636 |
+
$wishlist = $wl->get_by_id($result[0]['wishlist_id']);
|
637 |
|
638 |
return $wishlist;
|
639 |
}
|
647 |
* @global wpdb $wpdb
|
648 |
*
|
649 |
*/
|
650 |
+
function remove($data)
|
651 |
+
{
|
652 |
+
if (!isset($data['ID']) || empty($data['ID'])) {
|
653 |
return false;
|
654 |
}
|
655 |
|
656 |
global $wpdb;
|
657 |
+
$result = false !== $wpdb->delete($this->table, array('ID' => $data['ID'])); // WPCS: db call ok; no-cache ok; unprepared SQL ok.
|
658 |
+
if ($result) {
|
659 |
/* Run a 3rd party code when product removed from a wishlist.
|
660 |
*
|
661 |
* @param array $data product data including author and wishlist IDs.
|
662 |
* */
|
663 |
+
do_action('tinvwl_product_removed', $data);
|
664 |
+
set_transient('_tinvwl_update_wishlists_data', '1');
|
665 |
}
|
666 |
|
667 |
return $result;
|
674 |
*
|
675 |
* @return array
|
676 |
*/
|
677 |
+
function clean_meta($meta)
|
678 |
+
{
|
679 |
|
680 |
foreach (
|
681 |
array(
|
687 |
'product_sku',
|
688 |
) as $field
|
689 |
) {
|
690 |
+
if (array_key_exists($field, $meta)) {
|
691 |
+
unset($meta[$field]);
|
692 |
}
|
693 |
}
|
694 |
+
$meta = array_filter($meta);
|
695 |
|
696 |
return $meta;
|
697 |
}
|
705 |
*
|
706 |
* @return string
|
707 |
*/
|
708 |
+
function prepare_save_meta($meta = array(), $product_id = 0, $variation_id = 0)
|
709 |
+
{
|
710 |
+
if (!is_array($meta)) {
|
711 |
$meta = array();
|
712 |
}
|
713 |
+
$meta = apply_filters('tinvwl_product_prepare_meta', $meta, $product_id, $variation_id);
|
714 |
foreach (
|
715 |
array(
|
716 |
'add-to-cart',
|
721 |
'product_sku',
|
722 |
) as $field
|
723 |
) {
|
724 |
+
if (array_key_exists($field, $meta)) {
|
725 |
+
unset($meta[$field]);
|
726 |
}
|
727 |
}
|
728 |
+
$meta = array_filter($meta);
|
729 |
+
if (empty($meta)) {
|
730 |
return '';
|
731 |
}
|
732 |
|
733 |
+
return json_encode($meta);
|
734 |
}
|
735 |
|
736 |
/**
|
743 |
*
|
744 |
* @return array
|
745 |
*/
|
746 |
+
function prepare_retrun_meta($meta = '', $product_id = 0, $variation_id = 0, $quantity = 1)
|
747 |
+
{
|
748 |
+
if (empty($meta)) {
|
749 |
return array();
|
750 |
}
|
751 |
+
$meta = @json_decode($meta, true);
|
752 |
+
if (empty($meta) || !is_array($meta)) {
|
753 |
return array();
|
754 |
}
|
755 |
+
if (!empty($product_id)) {
|
756 |
$meta['add-to-cart'] = $product_id;
|
757 |
+
$meta['product_id'] = $product_id;
|
758 |
+
$meta['quantity'] = $quantity;
|
759 |
+
if (!empty($variation_id)) {
|
760 |
$meta['variation_id'] = $variation_id;
|
761 |
}
|
762 |
}
|
763 |
|
764 |
+
return apply_filters('tinvwl_wishlist_product_unprepare_meta', $meta);
|
765 |
}
|
766 |
}
|
integrations/theme-divi.php
CHANGED
@@ -24,7 +24,7 @@ $slug = "divi";
|
|
24 |
|
25 |
$name = "Divi Theme";
|
26 |
|
27 |
-
$available =
|
28 |
|
29 |
$tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : [];
|
30 |
|
24 |
|
25 |
$name = "Divi Theme";
|
26 |
|
27 |
+
$available = true;
|
28 |
|
29 |
$tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : [];
|
30 |
|
integrations/theme-flatsome.php
CHANGED
@@ -24,7 +24,7 @@ $slug = "flatsome";
|
|
24 |
|
25 |
$name = "Flatsome Theme";
|
26 |
|
27 |
-
$available =
|
28 |
|
29 |
$tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : [];
|
30 |
|
24 |
|
25 |
$name = "Flatsome Theme";
|
26 |
|
27 |
+
$available = true;
|
28 |
|
29 |
$tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : [];
|
30 |
|
integrations/theme-kallyas.php
CHANGED
@@ -24,7 +24,7 @@ $slug = "kallyas";
|
|
24 |
|
25 |
$name = "Kallyas Theme";
|
26 |
|
27 |
-
$available =
|
28 |
|
29 |
$tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : [];
|
30 |
|
24 |
|
25 |
$name = "Kallyas Theme";
|
26 |
|
27 |
+
$available = true;
|
28 |
|
29 |
$tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : [];
|
30 |
|
integrations/theme-oceanwp.php
CHANGED
@@ -24,7 +24,7 @@ $slug = "oceanwp";
|
|
24 |
|
25 |
$name = "OceanWP Theme";
|
26 |
|
27 |
-
$available =
|
28 |
|
29 |
$tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : [];
|
30 |
|
24 |
|
25 |
$name = "OceanWP Theme";
|
26 |
|
27 |
+
$available = true;
|
28 |
|
29 |
$tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : [];
|
30 |
|
languages/ti-woocommerce-wishlist.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
# Copyright (C) 2021 TI WooCommerce Wishlist Plugin - 1.24.
|
2 |
-
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.24.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.24.
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
1 |
+
# Copyright (C) 2021 TI WooCommerce Wishlist Plugin - 1.24.3
|
2 |
+
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.24.3 package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.24.3\n"
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
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.7
|
6 |
-
Stable tag: 1.24.
|
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,12 @@ Yes, you can! Join in on our [GitHub repository](https://github.com/TemplateInva
|
|
163 |
|
164 |
|
165 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
= 1.24.2 =
|
167 |
*Release Date - 19 March 2021*
|
168 |
|
3 |
Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.7
|
6 |
+
Stable tag: 1.24.3
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
163 |
|
164 |
|
165 |
== Changelog ==
|
166 |
+
= 1.24.3 =
|
167 |
+
*Release Date - 22 March 2021*
|
168 |
+
|
169 |
+
* Fixed conditional options of themes integration
|
170 |
+
* Fixed WPML issue for variations name
|
171 |
+
|
172 |
= 1.24.2 =
|
173 |
*Release Date - 19 March 2021*
|
174 |
|
ti-woocommerce-wishlist.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: TI WooCommerce Wishlist
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
-
* Version: 1.24.
|
8 |
* Requires at least: 4.7
|
9 |
* Tested up to: 5.7
|
10 |
* WC requires at least: 3.0
|
@@ -41,7 +41,7 @@ if (!defined('TINVWL_DOMAIN')) {
|
|
41 |
}
|
42 |
|
43 |
if (!defined('TINVWL_FVERSION')) {
|
44 |
-
define('TINVWL_FVERSION', '1.24.
|
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.24.3
|
8 |
* Requires at least: 4.7
|
9 |
* Tested up to: 5.7
|
10 |
* WC requires at least: 3.0
|
41 |
}
|
42 |
|
43 |
if (!defined('TINVWL_FVERSION')) {
|
44 |
+
define('TINVWL_FVERSION', '1.24.3');
|
45 |
}
|
46 |
|
47 |
if (!defined('TINVWL_LOAD_FREE')) {
|