Version Description
Release Date - 24 April 2022
- WooCommerce 6.4 support
- Added filters for share links
- Updated integration with WooCommerce Gravity Forms Product Add-Ons plugin
- Added tinvwl_get_wishlist_data() as jQuery public function
Download this release
Release Info
Developer | templateinvaders |
Plugin | WooCommerce Wishlist Plugin |
Version | 1.43.0 |
Comparing to | |
See all releases |
Code changes from version 1.42.1 to 1.43.0
- assets/css/admin-form-rtl.min.css +1 -1
- assets/css/admin-form.min.css +1 -1
- assets/css/admin-rtl.min.css +1 -1
- assets/css/admin-setup-rtl.min.css +1 -1
- assets/css/admin-setup.min.css +1 -1
- assets/css/admin.min.css +1 -1
- assets/css/public-rtl.min.css +1 -1
- assets/css/public.min.css +1 -1
- assets/css/theme-rtl.min.css +1 -1
- assets/css/theme.min.css +1 -1
- assets/css/webfont-rtl.min.css +1 -1
- assets/css/webfont.min.css +1 -1
- assets/js/admin.min.js +1 -1
- assets/js/public.js +3 -3
- assets/js/public.min.js +2 -2
- integrations/woocommerce-gravityforms-product-addons.php +200 -168
- integrations/woocommerce-product-bundles.php +76 -79
- languages/ti-woocommerce-wishlist.pot +10 -10
- public/wishlist/social.class.php +10 -0
- readme.txt +9 -1
- ti-woocommerce-wishlist.php +3 -3
assets/css/admin-form-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
assets/css/admin-form.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
assets/css/admin-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
*{-webkit-box-sizing:border-box;box-sizing:border-box}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
*{-webkit-box-sizing:border-box;box-sizing:border-box}
|
assets/css/admin-setup-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
assets/css/admin-setup.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
assets/css/admin.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
*{-webkit-box-sizing:border-box;box-sizing:border-box}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
*{-webkit-box-sizing:border-box;box-sizing:border-box}
|
assets/css/public-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
|
assets/css/public.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist form,.tinv-wishlist p:last-child,.tinv-wishlist table{margin-bottom:0}
|
assets/css/theme-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type=button],.tinv-wishlist input[type=reset],.tinv-wishlist input[type=submit]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type=button],.tinv-wishlist input[type=reset],.tinv-wishlist input[type=submit]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
assets/css/theme.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type=button],.tinv-wishlist input[type=reset],.tinv-wishlist input[type=submit]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type=button],.tinv-wishlist input[type=reset],.tinv-wishlist input[type=submit]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
assets/css/webfont-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:"tinvwl-webfont";font-display:block;src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:"tinvwl-webfont";font-display:block;src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
assets/css/webfont.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:"tinvwl-webfont";font-display:block;src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:"tinvwl-webfont";font-display:block;src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi");src:url("../fonts/tinvwl-webfont.eot?ver=xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.woff2?ver=xu2uyi") format("woff2"),url("../fonts/tinvwl-webfont.woff?ver=xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.ttf?ver=xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.svg?ver=xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
assets/js/admin.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){n=n||".";return"{0}{1}{2}".format(n,this.pf,t)},this._tm=function(t){t=$("script#{0}[type='text/template']".format(t));return t.length?t.html():""},this.formElm=function(){var e,n;$(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker&&(e=function(t){t=t.substring(1),t=parseInt(t,16);return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(t>>0&255)},n=this._csel("-form-color"),$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){($(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)):$(n)).iris("hide")}))},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),t=t.parents("form").eq(0);i&&("-1"!==i.val()&&t.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){t=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");t&&""===t.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t,n=this.n;this.ho&&(n=n+(t=new Date).getFullYear()+t.getMonth()+t.getDate()),window[n]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})});var o=this,n=o.n,ho=o.ho,c=ho?"t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),":"",i;for(i in o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var c=s.extend(!0,{},{onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},t);return s(this).each(function(){function t(){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),e=n.attr("tiwl-hide"),o=c.isChecked.call(n);return"string"==typeof i&&t(i,o),"string"==typeof e&&t(e,!o),n}var n=s(this);return n.is("input")&&"checkbox"==n.attr("type")?(s(this).on("change",t),t.call(n)):n})},s.fn.tiwl_byvalueblock=function(t){var i=s.extend(!0,{},{onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},t);return s(this).each(function(){function t(e){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),o=n.attr("tiwl-hide"),c=e.onClick.call(n);return"string"==typeof i&&t(i,c),"string"==typeof o&&t(o,!c),n}var n=s(this);return n.is("input")||n.is("select")?(s(this).on("change",function(){t.call(this,i)}),t.call(n,i)):n})};var n=new TInvWL(s);s(document).ready(function(){var t;n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover&&((t=s(".tinvwl-help")).popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})),s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})}),s(document).on("click",".tinvwl-chat-notice .notice-dismiss",function(t){s.post(tinvwl_comfirm.ajax_url,{action:"tinvwl_admin_chat_notice"})})}(jQuery);
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){n=n||".";return"{0}{1}{2}".format(n,this.pf,t)},this._tm=function(t){t=$("script#{0}[type='text/template']".format(t));return t.length?t.html():""},this.formElm=function(){var e,n;$(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker&&(e=function(t){t=t.substring(1),t=parseInt(t,16);return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(t>>0&255)},n=this._csel("-form-color"),$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){($(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)):$(n)).iris("hide")}))},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),t=t.parents("form").eq(0);i&&("-1"!==i.val()&&t.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){t=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");t&&""===t.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t,n=this.n;this.ho&&(n=n+(t=new Date).getFullYear()+t.getMonth()+t.getDate()),window[n]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})});var o=this,n=o.n,ho=o.ho,c=ho?"t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),":"",i;for(i in o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var c=s.extend(!0,{},{onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},t);return s(this).each(function(){function t(){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),e=n.attr("tiwl-hide"),o=c.isChecked.call(n);return"string"==typeof i&&t(i,o),"string"==typeof e&&t(e,!o),n}var n=s(this);return n.is("input")&&"checkbox"==n.attr("type")?(s(this).on("change",t),t.call(n)):n})},s.fn.tiwl_byvalueblock=function(t){var i=s.extend(!0,{},{onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},t);return s(this).each(function(){function t(e){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),o=n.attr("tiwl-hide"),c=e.onClick.call(n);return"string"==typeof i&&t(i,c),"string"==typeof o&&t(o,!c),n}var n=s(this);return n.is("input")||n.is("select")?(s(this).on("change",function(){t.call(this,i)}),t.call(n,i)):n})};var n=new TInvWL(s);s(document).ready(function(){var t;n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover&&((t=s(".tinvwl-help")).popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})),s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})}),s(document).on("click",".tinvwl-chat-notice .notice-dismiss",function(t){s.post(tinvwl_comfirm.ajax_url,{action:"tinvwl_admin_chat_notice"})})}(jQuery);
|
assets/js/public.js
CHANGED
@@ -565,7 +565,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
565 |
}
|
566 |
};
|
567 |
|
568 |
-
|
569 |
if ($supports_html5_storage) {
|
570 |
if (tinvwl_add_to_wishlist.update_wishlists_data) {
|
571 |
localStorage.setItem(hash_key, '');
|
@@ -590,7 +590,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
590 |
custom_ajax();
|
591 |
};
|
592 |
|
593 |
-
|
594 |
/* Dynamic buttons */
|
595 |
// Create an observer instance
|
596 |
|
@@ -617,7 +617,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
617 |
});
|
618 |
|
619 |
if (tinvwl_products.length) {
|
620 |
-
|
621 |
}
|
622 |
}); // Configuration of the observer:
|
623 |
|
565 |
}
|
566 |
};
|
567 |
|
568 |
+
$.fn.tinvwl_get_wishlist_data = function () {
|
569 |
if ($supports_html5_storage) {
|
570 |
if (tinvwl_add_to_wishlist.update_wishlists_data) {
|
571 |
localStorage.setItem(hash_key, '');
|
590 |
custom_ajax();
|
591 |
};
|
592 |
|
593 |
+
$.fn.tinvwl_get_wishlist_data();
|
594 |
/* Dynamic buttons */
|
595 |
// Create an observer instance
|
596 |
|
617 |
});
|
618 |
|
619 |
if (tinvwl_products.length) {
|
620 |
+
$.fn.tinvwl_get_wishlist_data();
|
621 |
}
|
622 |
}); // Configuration of the observer:
|
623 |
|
assets/js/public.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
-
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(c){c.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href.split("?")[0],text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){c(this).append(c("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){c(t).addClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){c(t).removeClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(c(this).is(".disabled-add-wishlist"))return!1;c(this).is(".ftinvwl-animated")&&c(this).addClass("ftinvwl-pulse"),(this.tinvwl_dialog?this.tinvwl_dialog.show_list:e.onActionProduct).call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){var t=t||[],o={};return c("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val();("checkbox"!==i&&"radio"!==i||c(this).is(":checked"))&&(o["form"+t]=n)}),o=o.formvariation_id,t.filter(function(t){var i;return"object"===_typeof(t.in)&&"string"==typeof o?(i=parseInt(o),0<=t.in.indexOf(i)):t.in})},onMultiProductAlreadyIn:function(t){var t=t||[],n=(t=e.onPrepareList.call(t)||t,t=e.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove(),"");0===t.length||(n=c("<ul>"),c.each(t,function(t,i){n.append(c("<li>").html(c("<a>").html(i.title).attr({href:i.url})).val(i.ID))})),n.length&&c(this).closest(".tinv-modal-inner").find("img").after(c("<div>").addClass("already-in").html(e.text_already_in+" ").append(n))},onAction:{redirect:function(t){e.redirectTimer&&clearTimeout(e.redirectTimer),e.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(t){},msg:function(t){if(!t)return!1;var i,n,o=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(o),t=c(t="body > .tinv-wishlist").find("select, input, textarea, button, a").filter(":visible"),i=t.first(),n=t.last(),i.focus().blur(),n.on("keydown",function(t){9!==t.which||t.shiftKey||(t.preventDefault(),i.focus())}),i.on("keydown",function(t){9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}),e.redirectTimer||(e.removeTimer=window.setTimeout(function(){o.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer)},6e3)),o.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),o.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer),e.removeTimer&&clearTimeout(e.removeTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(t){},make_remove:function(t){},wishlists_data:function(t){d(JSON.stringify(t))}}},e=(i.onActionProduct=function(t,i){var r={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:c(this).attr("data-tinv-wl-producttype"),product_id:c(this).attr("data-tinv-wl-product")||0,product_variation:c(this).attr("data-tinv-wl-productvariation")||0,product_action:c(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},n=this,o=[],d=new FormData;tinvwl_add_to_wishlist.wpml&&(r.lang=tinvwl_add_to_wishlist.wpml),tinvwl_add_to_wishlist.wpml_default&&(r.lang_default=tinvwl_add_to_wishlist.wpml_default),c('form.cart[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"], form.vtajaxform[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),o.length||(c(n).closest("form.cart[method=post], form.vtajaxform[method=post]").each(function(){o.push(c(this))}),o.length||o.push(c("form.cart[method=post]"))),c('.tinv-wraper[data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),c.each(o,function(t,i){c(i).find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){function e(t,i){if("object"!==_typeof(i))return i;for(var n in void 0===t&&(t={}),i)if(""===n){var o=-1;for(o in t);t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t,i=c(this).attr("name"),n=c(this).attr("type"),o=c(this).val(),l=10;if("button"!==n&&void 0!==i){for(;/^(.+)\[([^\[\]]*?)\]$/.test(i)&&0<l;){var a,s=i.match(/^(.+)\[([^\[\]]*?)\]$/);3===s.length&&((a={})[s[2]]=o,o=a),i=s[1],l--}"file"!==n||(t=c(this)[0].files)&&d.append(i,t[0]),"checkbox"===n||"radio"===n?c(this).is(":checked")&&(o.length||"object"===_typeof(o)||(o=!0),r.form[i]=e(r.form[i],o)):r.form[i]=e(r.form[i],o)}})}),r=e.onPrepareDataAction.call(n,n,r)||r,c.each(r,function(n,t){"form"===n?c.each(t,function(t,i){"object"===_typeof(i)&&(i=JSON.stringify(i)),d.append(n+"["+t+"]",i)}):d.append(n,t)}),c.ajax({url:e.api_url,method:"POST",contentType:!1,processData:!1,data:d}).done(function(t){if(e.onDialogHide.call(n.tinvwl_dialog,n),"object"===_typeof(t))for(var i in t)"function"==typeof e.onAction[i]&&e.onAction[i].call(n,t[i]);else"function"==typeof e.onAction.msg&&e.onAction.msg.call(n,t)})},c.extend(!0,{},i,t));return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;var t,o;e.dialogbox&&e.dialogbox.length&&(this.tinvwl_dialog=e.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=e.onGetDialogBox.call(this)),this.tinvwl_dialog||(t=c(this).nextAll(e.class.dialogbox).eq(0)).length&&(this.tinvwl_dialog=t),this.tinvwl_dialog&&(e.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var n=c(this).find(e.class.select).eq(0);c(this).find(e.class.newtitle).hide().val(""),n.html(""),c.each(t,function(t,i){e.onCreateWishList.call(n,i)}),e.text_create&&e.onCreateWishList.call(n,{ID:"",title:e.text_create,in:!1}),e.onMultiProductAlreadyIn.call(n,t),e.onSelectWishList.call(n,t),c(this).find(e.class.newtitle).toggle(""===n.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=JSON.parse(c(this).attr("data-tinv-wl-list"))||[];t.length?(t=e.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),e.onDialogShow.call(this.tinvwl_dialog,this)):e.onActionProduct.call(this)}),c((o=this).tinvwl_dialog).find(e.class.dialogbutton).off("click").on("click",function(){var t,i=c(o.tinvwl_dialog).find(e.class.select),n=c(o.tinvwl_dialog).find(e.class.newtitle);i.val()||n.val()?e.onActionProduct.call(o,i.val(),n.val()):((t=n.is(":visible")?n:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})),c(this).off("click").on("click",e.onClick),e.onInited.call(this,e)})},c(document).ready(function(){c("body").on("click keydown",".tinvwl_add_to_wishlist_button",function(t){if("keydown"===t.type){var i=void 0!==t.key?t.key:t.keyCode;if(!("Enter"===i||13===i||0<=["Spacebar"," "].indexOf(i)||32===i))return;t.preventDefault()}if(c("body").trigger("tinvwl_add_to_wishlist_button_click",[this]),c(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);c(this).is(".inited-add-wishlist")||c(this).tinvwl_to_wishlist({onInited:function(t){c(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),c(document).on("hide_variation",".variations_form",function(t){var i=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(i.attr("data-tinv-wl-productvariation",0),i.length&&i.attr("data-tinv-wl-list")){var n,o=JSON.parse(i.attr("data-tinv-wl-list")),e=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(n in o)o[n].hasOwnProperty("in")&&Array.isArray(o[n].in)&&-1<(o[n].in||[]).indexOf(0)&&(e=!0);i.toggleClass("tinvwl-product-in-list",e).toggleClass("tinvwl-product-make-remove",e&&l).attr("data-tinv-wl-action",e&&l?"remove":"addto")}i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),c(document).on("show_variation",".variations_form",function(t,i,n){var o=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(o.attr("data-tinv-wl-productvariation",i.variation_id),o.length&&o.attr("data-tinv-wl-list")){var e,l=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,s="1"==window.tinvwl_add_to_wishlist.simple_flow;for(e in l)l[e].hasOwnProperty("in")&&Array.isArray(l[e].in)&&-1<(l[e].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&s).attr("data-tinv-wl-action",a&&s?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){s===t.originalEvent.key&&localStorage.getItem(s)!==sessionStorage.getItem(s)&&(!localStorage.getItem(s)||"object"===_typeof(t=JSON.parse(localStorage.getItem(s)))&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter"))&&d(localStorage.getItem(s)))});function i(){if(a&&(tinvwl_add_to_wishlist.update_wishlists_data&&localStorage.setItem(s,""),localStorage.getItem(s))){var t=JSON.parse(localStorage.getItem(s));if("object"===_typeof(t)&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter"))&&(!t.hasOwnProperty("lang")&&!tinvwl_add_to_wishlist.wpml||tinvwl_add_to_wishlist.wpml&&t.lang===tinvwl_add_to_wishlist.wpml))return r(t),0}tinvwl_add_to_wishlist.block_ajax_wishlists_data||(n.length||o)&&(t={},tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),tinvwl_add_to_wishlist.wpml_default&&(t.lang_default=tinvwl_add_to_wishlist.wpml_default),c.ajax({url:tinvwl_add_to_wishlist.plugin_url+"includes/api/ajax.php",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)}).fail(function(){e()}))}var n=[],o=!1,e=(c("a.tinvwl_add_to_wishlist_button").each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))}),c(".wishlist_products_counter_number").each(function(){o=!0}),function(){var t;(n.length||o)&&(t={ids:n,counter:o,tinvwl_request:!0},tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),tinvwl_add_to_wishlist.wpml_default&&(t.lang_default=tinvwl_add_to_wishlist.wpml_default),c.ajax({url:tinvwl_add_to_wishlist.rest_root+"wishlist/v1/products",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)}))}),t=(i(),new MutationObserver(function(t){n=[],t.forEach(function(t){t=t.addedNodes;null!==t&&c(t).each(function(){var t=c(this).find(".tinvwl_add_to_wishlist_button");t.length&&t.each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))})})}),n.length&&i()})),l=document.body;t.observe(l,{childList:!0,subtree:!0})});var a=!0,s=tinvwl_add_to_wishlist.hash_key;try{a="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("ti","test"),window.sessionStorage.removeItem("ti"),window.localStorage.setItem("ti","test"),window.localStorage.removeItem("ti")}catch(t){a=!1}function r(t){var a="1"==window.tinvwl_add_to_wishlist.simple_flow,t=(a&&c("a.tinvwl_add_to_wishlist_button").each(function(){c(this).removeClass("tinvwl-product-make-remove").removeClass("tinvwl-product-already-on-wishlist").removeClass("tinvwl-product-in-list").attr("data-tinv-wl-action","addto").attr("data-tinv-wl-list","[]")}),c("body").trigger("tinvwl_wishlist_mark_products",[t]),c.each(t.products,function(t,e){var l=t;c('a.tinvwl_add_to_wishlist_button[data-tinv-wl-product="'+l+'"]').each(function(){var i,t=parseInt(c(this).attr("data-tinv-wl-productvariation")),n=c(this).data("tinv-wl-productvariations")||[],o=!1;for(i in e)e[i].hasOwnProperty("in")&&Array.isArray(e[i].in)&&(-1<(e[i].in||[]).indexOf(l)||-1<(e[i].in||[]).indexOf(t)||n.some(function(t){return 0<=(e[i].in||[]).indexOf(t)}))&&(o=!0);c("body").trigger("tinvwl_wishlist_product_marked",[this,o]),c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&a).attr("data-tinv-wl-action",o&&a?"remove":"addto")})}),t.counter);"1"==window.tinvwl_add_to_wishlist.hide_zero_counter&&0===t&&(t="false"),jQuery("i.wishlist-icon").addClass("added"),"false"!==t?(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html(t),jQuery("i.wishlist-icon").attr("data-icon-label",t)):(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html("").closest("span.wishlist-counter-with-products").removeClass("wishlist-counter-with-products"),jQuery("i.wishlist-icon").removeAttr("data-icon-label")),t=!("0"==t||"false"==t),jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",t),setTimeout(function(){jQuery("i.wishlist-icon").removeClass("added")},500)}function d(t){a&&(localStorage.setItem(s,t),sessionStorage.setItem(s,t),r(JSON.parse(t)))}}(jQuery),function(o){o(document).ready(function(){if(o("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),o(".tinv-lists-nav").each(function(){o(this).html().trim().length||o(this).remove()}),o("body").on("click",".social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)",function(t){var i=window.open(o(this).attr("href"),o(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}o("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),o("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),o(this).parents(".tinv-modal:first").removeClass("tinv-modal-open"),o("body").trigger("tinvwl_modal_closed",[this])}),o("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){o(this).data("url")&&(t.preventDefault(),window.location=o(this).data("url"))});var n=o(".tinv-wishlist .navigation-button");n.length&&n.each(function(){var t=o(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),o(".tinv-login .showlogin").off("click").on("click",function(t){t.preventDefault(),o(this).closest(".tinv-login").find(".login").toggle()}),o(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){o(this).toggle(!!o(this).children().not(".look_in").length||!!o(this).children(".look_in").children().length)})})}(jQuery),function(o){o.fn.tinvwl_break_submit=function(t){var n=o.extend(!0,{},{selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return o(this).val()},rule:function(){var t=o(this).parents("form").eq(0).find(n.selector),i=n.invert;return 0===t.length?n.ifempty:(t.each(function(){i&&!n.invert||!i&&n.invert||(i=Boolean(n.validate.call(o(this))))}),i)}},t);return o(this).each(function(){o(this).on("click",function(t){var i=[];void 0!==o(this).attr("tinvwl_break_submit")&&(i=o(this).attr("tinvwl_break_submit").split(",")),-1!==jQuery.inArray(n.selector,i)&&(i=[]),n.rule.call(o(this))||0!==i.length||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault()),i.push(n.selector),o(this).attr("tinvwl_break_submit",i),n.rule.call(o(this))&&o(this).removeAttr("tinvwl_break_submit")})})},o(document).ready(function(){o(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),o(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return o(this).is(":checked")}}),o(".global-cb").on("click",function(){o(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",o(this).is(":checked"))})})}(jQuery);
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.43.0
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
+
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(c){c.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href.split("?")[0],text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){c(this).append(c("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){c(t).addClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){c(t).removeClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(c(this).is(".disabled-add-wishlist"))return!1;c(this).is(".ftinvwl-animated")&&c(this).addClass("ftinvwl-pulse"),(this.tinvwl_dialog?this.tinvwl_dialog.show_list:e.onActionProduct).call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){var t=t||[],o={};return c("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val();("checkbox"!==i&&"radio"!==i||c(this).is(":checked"))&&(o["form"+t]=n)}),o=o.formvariation_id,t.filter(function(t){var i;return"object"===_typeof(t.in)&&"string"==typeof o?(i=parseInt(o),0<=t.in.indexOf(i)):t.in})},onMultiProductAlreadyIn:function(t){var t=t||[],n=(t=e.onPrepareList.call(t)||t,t=e.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove(),"");0===t.length||(n=c("<ul>"),c.each(t,function(t,i){n.append(c("<li>").html(c("<a>").html(i.title).attr({href:i.url})).val(i.ID))})),n.length&&c(this).closest(".tinv-modal-inner").find("img").after(c("<div>").addClass("already-in").html(e.text_already_in+" ").append(n))},onAction:{redirect:function(t){e.redirectTimer&&clearTimeout(e.redirectTimer),e.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(t){},msg:function(t){if(!t)return!1;var i,n,o=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(o),t=c(t="body > .tinv-wishlist").find("select, input, textarea, button, a").filter(":visible"),i=t.first(),n=t.last(),i.focus().blur(),n.on("keydown",function(t){9!==t.which||t.shiftKey||(t.preventDefault(),i.focus())}),i.on("keydown",function(t){9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}),e.redirectTimer||(e.removeTimer=window.setTimeout(function(){o.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer)},6e3)),o.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),o.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer),e.removeTimer&&clearTimeout(e.removeTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(t){},make_remove:function(t){},wishlists_data:function(t){r(JSON.stringify(t))}}},e=(i.onActionProduct=function(t,i){var r={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:c(this).attr("data-tinv-wl-producttype"),product_id:c(this).attr("data-tinv-wl-product")||0,product_variation:c(this).attr("data-tinv-wl-productvariation")||0,product_action:c(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},n=this,o=[],d=new FormData;tinvwl_add_to_wishlist.wpml&&(r.lang=tinvwl_add_to_wishlist.wpml),tinvwl_add_to_wishlist.wpml_default&&(r.lang_default=tinvwl_add_to_wishlist.wpml_default),c('form.cart[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"], form.vtajaxform[method=post][data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),o.length||(c(n).closest("form.cart[method=post], form.vtajaxform[method=post]").each(function(){o.push(c(this))}),o.length||o.push(c("form.cart[method=post]"))),c('.tinv-wraper[data-product_id="'+c(this).attr("data-tinv-wl-product")+'"]').each(function(){o.push(c(this))}),c.each(o,function(t,i){c(i).find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){function e(t,i){if("object"!==_typeof(i))return i;for(var n in void 0===t&&(t={}),i)if(""===n){var o=-1;for(o in t);t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t,i=c(this).attr("name"),n=c(this).attr("type"),o=c(this).val(),l=10;if("button"!==n&&void 0!==i){for(;/^(.+)\[([^\[\]]*?)\]$/.test(i)&&0<l;){var a,s=i.match(/^(.+)\[([^\[\]]*?)\]$/);3===s.length&&((a={})[s[2]]=o,o=a),i=s[1],l--}"file"!==n||(t=c(this)[0].files)&&d.append(i,t[0]),"checkbox"===n||"radio"===n?c(this).is(":checked")&&(o.length||"object"===_typeof(o)||(o=!0),r.form[i]=e(r.form[i],o)):r.form[i]=e(r.form[i],o)}})}),r=e.onPrepareDataAction.call(n,n,r)||r,c.each(r,function(n,t){"form"===n?c.each(t,function(t,i){"object"===_typeof(i)&&(i=JSON.stringify(i)),d.append(n+"["+t+"]",i)}):d.append(n,t)}),c.ajax({url:e.api_url,method:"POST",contentType:!1,processData:!1,data:d}).done(function(t){if(e.onDialogHide.call(n.tinvwl_dialog,n),"object"===_typeof(t))for(var i in t)"function"==typeof e.onAction[i]&&e.onAction[i].call(n,t[i]);else"function"==typeof e.onAction.msg&&e.onAction.msg.call(n,t)})},c.extend(!0,{},i,t));return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;var t,o;e.dialogbox&&e.dialogbox.length&&(this.tinvwl_dialog=e.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=e.onGetDialogBox.call(this)),this.tinvwl_dialog||(t=c(this).nextAll(e.class.dialogbox).eq(0)).length&&(this.tinvwl_dialog=t),this.tinvwl_dialog&&(e.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var n=c(this).find(e.class.select).eq(0);c(this).find(e.class.newtitle).hide().val(""),n.html(""),c.each(t,function(t,i){e.onCreateWishList.call(n,i)}),e.text_create&&e.onCreateWishList.call(n,{ID:"",title:e.text_create,in:!1}),e.onMultiProductAlreadyIn.call(n,t),e.onSelectWishList.call(n,t),c(this).find(e.class.newtitle).toggle(""===n.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=JSON.parse(c(this).attr("data-tinv-wl-list"))||[];t.length?(t=e.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),e.onDialogShow.call(this.tinvwl_dialog,this)):e.onActionProduct.call(this)}),c((o=this).tinvwl_dialog).find(e.class.dialogbutton).off("click").on("click",function(){var t,i=c(o.tinvwl_dialog).find(e.class.select),n=c(o.tinvwl_dialog).find(e.class.newtitle);i.val()||n.val()?e.onActionProduct.call(o,i.val(),n.val()):((t=n.is(":visible")?n:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})),c(this).off("click").on("click",e.onClick),e.onInited.call(this,e)})},c(document).ready(function(){c("body").on("click keydown",".tinvwl_add_to_wishlist_button",function(t){if("keydown"===t.type){var i=void 0!==t.key?t.key:t.keyCode;if(!("Enter"===i||13===i||0<=["Spacebar"," "].indexOf(i)||32===i))return;t.preventDefault()}if(c("body").trigger("tinvwl_add_to_wishlist_button_click",[this]),c(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);c(this).is(".inited-add-wishlist")||c(this).tinvwl_to_wishlist({onInited:function(t){c(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),c(document).on("hide_variation",".variations_form",function(t){var i=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(i.attr("data-tinv-wl-productvariation",0),i.length&&i.attr("data-tinv-wl-list")){var n,o=JSON.parse(i.attr("data-tinv-wl-list")),e=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(n in o)o[n].hasOwnProperty("in")&&Array.isArray(o[n].in)&&-1<(o[n].in||[]).indexOf(0)&&(e=!0);i.toggleClass("tinvwl-product-in-list",e).toggleClass("tinvwl-product-make-remove",e&&l).attr("data-tinv-wl-action",e&&l?"remove":"addto")}i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),c(document).on("show_variation",".variations_form",function(t,i,n){var o=c('.tinvwl_add_to_wishlist_button:not(.tinvwl-loop)[data-tinv-wl-product="'+c(this).data("product_id")+'"]');if(o.attr("data-tinv-wl-productvariation",i.variation_id),o.length&&o.attr("data-tinv-wl-list")){var e,l=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,s="1"==window.tinvwl_add_to_wishlist.simple_flow;for(e in l)l[e].hasOwnProperty("in")&&Array.isArray(l[e].in)&&-1<(l[e].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&s).attr("data-tinv-wl-action",a&&s?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){a===t.originalEvent.key&&localStorage.getItem(a)!==sessionStorage.getItem(a)&&(!localStorage.getItem(a)||"object"===_typeof(t=JSON.parse(localStorage.getItem(a)))&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter"))&&r(localStorage.getItem(a)))});function i(){var t;(n.length||o)&&(t={},tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),tinvwl_add_to_wishlist.wpml_default&&(t.lang_default=tinvwl_add_to_wishlist.wpml_default),c.ajax({url:tinvwl_add_to_wishlist.plugin_url+"includes/api/ajax.php",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){r(JSON.stringify(t)),s(t)}).fail(function(){var t;(n.length||o)&&(t={ids:n,counter:o,tinvwl_request:!0},tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),tinvwl_add_to_wishlist.wpml_default&&(t.lang_default=tinvwl_add_to_wishlist.wpml_default),c.ajax({url:tinvwl_add_to_wishlist.rest_root+"wishlist/v1/products",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){r(JSON.stringify(t)),s(t)}))}))}var n=[],o=!1,t=(c("a.tinvwl_add_to_wishlist_button").each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))}),c(".wishlist_products_counter_number").each(function(){o=!0}),c.fn.tinvwl_get_wishlist_data=function(){if(l&&(tinvwl_add_to_wishlist.update_wishlists_data&&localStorage.setItem(a,""),localStorage.getItem(a))){var t=JSON.parse(localStorage.getItem(a));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 s(t)}tinvwl_add_to_wishlist.block_ajax_wishlists_data||i()},c.fn.tinvwl_get_wishlist_data(),new MutationObserver(function(t){n=[],t.forEach(function(t){t=t.addedNodes;null!==t&&c(t).each(function(){var t=c(this).find(".tinvwl_add_to_wishlist_button");t.length&&t.each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))})})}),n.length&&c.fn.tinvwl_get_wishlist_data()})),e=document.body;t.observe(e,{childList:!0,subtree:!0})});var l=!0,a=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 s(t){var a="1"==window.tinvwl_add_to_wishlist.simple_flow,t=(a&&c("a.tinvwl_add_to_wishlist_button").each(function(){c(this).removeClass("tinvwl-product-make-remove").removeClass("tinvwl-product-already-on-wishlist").removeClass("tinvwl-product-in-list").attr("data-tinv-wl-action","addto").attr("data-tinv-wl-list","[]")}),c("body").trigger("tinvwl_wishlist_mark_products",[t]),c.each(t.products,function(t,e){var l=t;c('a.tinvwl_add_to_wishlist_button[data-tinv-wl-product="'+l+'"]').each(function(){var i,t=parseInt(c(this).attr("data-tinv-wl-productvariation")),n=c(this).data("tinv-wl-productvariations")||[],o=!1;for(i in e)e[i].hasOwnProperty("in")&&Array.isArray(e[i].in)&&(-1<(e[i].in||[]).indexOf(l)||-1<(e[i].in||[]).indexOf(t)||n.some(function(t){return 0<=(e[i].in||[]).indexOf(t)}))&&(o=!0);c("body").trigger("tinvwl_wishlist_product_marked",[this,o]),c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&a).attr("data-tinv-wl-action",o&&a?"remove":"addto")})}),t.counter);"1"==window.tinvwl_add_to_wishlist.hide_zero_counter&&0===t&&(t="false"),jQuery("i.wishlist-icon").addClass("added"),"false"!==t?(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html(t),jQuery("i.wishlist-icon").attr("data-icon-label",t)):(jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html("").closest("span.wishlist-counter-with-products").removeClass("wishlist-counter-with-products"),jQuery("i.wishlist-icon").removeAttr("data-icon-label")),t=!("0"==t||"false"==t),jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",t),setTimeout(function(){jQuery("i.wishlist-icon").removeClass("added")},500)}function r(t){l&&(localStorage.setItem(a,t),sessionStorage.setItem(a,t),s(JSON.parse(t)))}}(jQuery),function(o){o(document).ready(function(){if(o("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),o(".tinv-lists-nav").each(function(){o(this).html().trim().length||o(this).remove()}),o("body").on("click",".social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)",function(t){var i=window.open(o(this).attr("href"),o(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}o("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),o("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),o(this).parents(".tinv-modal:first").removeClass("tinv-modal-open"),o("body").trigger("tinvwl_modal_closed",[this])}),o("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){o(this).data("url")&&(t.preventDefault(),window.location=o(this).data("url"))});var n=o(".tinv-wishlist .navigation-button");n.length&&n.each(function(){var t=o(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),o(".tinv-login .showlogin").off("click").on("click",function(t){t.preventDefault(),o(this).closest(".tinv-login").find(".login").toggle()}),o(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){o(this).toggle(!!o(this).children().not(".look_in").length||!!o(this).children(".look_in").children().length)})})}(jQuery),function(o){o.fn.tinvwl_break_submit=function(t){var n=o.extend(!0,{},{selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return o(this).val()},rule:function(){var t=o(this).parents("form").eq(0).find(n.selector),i=n.invert;return 0===t.length?n.ifempty:(t.each(function(){i&&!n.invert||!i&&n.invert||(i=Boolean(n.validate.call(o(this))))}),i)}},t);return o(this).each(function(){o(this).on("click",function(t){var i=[];void 0!==o(this).attr("tinvwl_break_submit")&&(i=o(this).attr("tinvwl_break_submit").split(",")),-1!==jQuery.inArray(n.selector,i)&&(i=[]),n.rule.call(o(this))||0!==i.length||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault()),i.push(n.selector),o(this).attr("tinvwl_break_submit",i),n.rule.call(o(this))&&o(this).removeAttr("tinvwl_break_submit")})})},o(document).ready(function(){o(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),o(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return o(this).is(":checked")}}),o(".global-cb").on("click",function(){o(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",o(this).is(":checked"))})})}(jQuery);
|
integrations/woocommerce-gravityforms-product-addons.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @name WooCommerce Gravity Forms Product Add-Ons
|
6 |
*
|
7 |
-
* @version 3.3.
|
8 |
*
|
9 |
* @slug woocommerce-gravityforms-product-addons
|
10 |
*
|
@@ -13,7 +13,7 @@
|
|
13 |
*/
|
14 |
|
15 |
// If this file is called directly, abort.
|
16 |
-
if (!defined('ABSPATH')) {
|
17 |
exit;
|
18 |
}
|
19 |
|
@@ -24,24 +24,24 @@ $slug = "woocommerce-gravityforms-product-addons";
|
|
24 |
|
25 |
$name = "WooCommerce Gravity Forms Product Add-Ons";
|
26 |
|
27 |
-
$available = class_exists('WC_GFPA_Main');
|
28 |
|
29 |
-
$tinvwl_integrations = is_array($tinvwl_integrations) ? $tinvwl_integrations : [];
|
30 |
|
31 |
-
$tinvwl_integrations[$slug] = array(
|
32 |
-
'name'
|
33 |
'available' => $available,
|
34 |
);
|
35 |
|
36 |
-
if (!tinv_get_option('integrations', $slug)) {
|
37 |
return;
|
38 |
}
|
39 |
|
40 |
-
if (
|
41 |
return;
|
42 |
}
|
43 |
|
44 |
-
if (!function_exists('tinv_wishlist_metasupport_wc_gf_addons')) {
|
45 |
|
46 |
/**
|
47 |
* Set description for meta WooCommerce - Gravity Forms Product Add-Ons
|
@@ -50,43 +50,42 @@ if (!function_exists('tinv_wishlist_metasupport_wc_gf_addons')) {
|
|
50 |
*
|
51 |
* @return array
|
52 |
*/
|
53 |
-
function tinv_wishlist_metasupport_wc_gf_addons($meta)
|
54 |
-
|
55 |
-
|
56 |
-
$form_meta = RGFormsModel::get_form_meta($meta['wc_gforms_form_id']['display']);
|
57 |
|
58 |
-
if (array_key_exists('fields', $form_meta)) {
|
59 |
$_meta = array();
|
60 |
-
foreach ($form_meta['fields'] as $field) {
|
61 |
|
62 |
-
if (isset($field['displayOnly']) && $field['displayOnly']) {
|
63 |
continue;
|
64 |
}
|
65 |
|
66 |
-
$field_name = $field->get_first_input_id(array('id' => 0));
|
67 |
|
68 |
-
if (array_key_exists($field_name, $meta)) {
|
69 |
|
70 |
-
if ($field['type'] == 'product') {
|
71 |
-
$inputs = $field instanceof GF_Field ? $field->get_entry_inputs() : rgar($field, 'inputs');
|
72 |
-
if (is_array($inputs)) {
|
73 |
$value = array();
|
74 |
-
foreach ($inputs as $input) {
|
75 |
-
$full_name = 'input_' . str_replace('.', '_', $input['id']);
|
76 |
-
if ($field_name == $full_name) {
|
77 |
continue;
|
78 |
}
|
79 |
-
if (array_key_exists($full_name, $meta)) {
|
80 |
-
$value[] = $field->inputs[array_search($input['id'], array_column($field->inputs, 'id'))]['label'] . ': ' . $meta[$full_name]['display'];
|
81 |
}
|
82 |
}
|
83 |
|
84 |
-
$meta[$field_name]['display'] = (is_array($value)) ? implode(', ', $value) : '-';
|
85 |
}
|
86 |
}
|
87 |
|
88 |
-
$meta[$field_name]['key'] = $field->label;
|
89 |
-
$_meta[$field_name]
|
90 |
|
91 |
}
|
92 |
}
|
@@ -97,27 +96,26 @@ if (!function_exists('tinv_wishlist_metasupport_wc_gf_addons')) {
|
|
97 |
return $meta;
|
98 |
}
|
99 |
|
100 |
-
add_filter('tinvwl_wishlist_item_meta_post', 'tinv_wishlist_metasupport_wc_gf_addons');
|
101 |
}
|
102 |
|
103 |
-
if (!function_exists('tinvwl_wishlist_item_url_wc_gf_addons')) {
|
104 |
|
105 |
-
function tinvwl_wishlist_item_url_wc_gf_addons($url, $wl_product, $product)
|
106 |
-
{
|
107 |
|
108 |
-
$gravity_form_data = wc_gfpa()->get_gravity_form_data($product->get_id());
|
109 |
|
110 |
-
if (isset($gravity_form_data['enable_cart_edit']) && $gravity_form_data['enable_cart_edit'] !== 'no') {
|
111 |
-
$url = add_query_arg(array('wc_gforms_wishlist_product_id' => $wl_product['ID']), $product->get_permalink());
|
112 |
}
|
113 |
|
114 |
return $url;
|
115 |
}
|
116 |
|
117 |
-
add_filter('tinvwl_wishlist_item_url', 'tinvwl_wishlist_item_url_wc_gf_addons', 10, 3);
|
118 |
}
|
119 |
|
120 |
-
if (!function_exists('tinvwl_item_price_wc_gf_addons')) {
|
121 |
|
122 |
/**
|
123 |
* Modify price for WooCommerce - Gravity Forms Product Add-Ons
|
@@ -128,103 +126,102 @@ if (!function_exists('tinvwl_item_price_wc_gf_addons')) {
|
|
128 |
*
|
129 |
* @return string
|
130 |
*/
|
131 |
-
function tinvwl_item_price_wc_gf_addons($price, $wl_product, $product)
|
132 |
-
|
133 |
-
|
134 |
-
$form = RGFormsModel::get_form_meta($wl_product['meta']['wc_gforms_form_id']);
|
135 |
|
136 |
-
if (empty($form)) {
|
137 |
return $price;
|
138 |
}
|
139 |
|
140 |
-
$lead
|
141 |
'form_id' => $wl_product['meta']['wc_gforms_form_id']
|
142 |
);
|
143 |
$lead['id'] = uniqid() . time() . rand();
|
144 |
|
145 |
-
foreach ($wl_product['meta'] as $key => $meta) {
|
146 |
-
if (strpos($key, 'input_') === 0) {
|
147 |
-
$lead[str_replace('_', '.', substr($key, strlen('input_')))] = $meta;
|
148 |
}
|
149 |
}
|
150 |
|
151 |
$use_choice_text = false;
|
152 |
$use_admin_label = false;
|
153 |
-
$products
|
154 |
-
$total
|
155 |
|
156 |
-
foreach ($form["fields"] as $field) {
|
157 |
-
$id
|
158 |
-
$lead_value = RGFormsModel::get_lead_field_value($lead, $field);
|
159 |
|
160 |
-
$quantity_field = GFCommon::get_product_fields_by_type($form, array("quantity"), $id);
|
161 |
-
$quantity
|
162 |
|
163 |
-
switch ($field["type"]) {
|
164 |
|
165 |
case "product" :
|
166 |
|
167 |
//if single product, get values from the multiple inputs
|
168 |
-
if (is_array($lead_value)) {
|
169 |
-
$product_quantity = sizeof($quantity_field) == 0 && !rgar($field, "disableQuantity") ? rgget($id . ".3", $lead_value) : $quantity;
|
170 |
-
if (empty($product_quantity)) {
|
171 |
break;
|
172 |
}
|
173 |
|
174 |
-
if (!rgget($id, $products)) {
|
175 |
-
$products[$id] = array();
|
176 |
}
|
177 |
|
178 |
-
$products[$id]["name"]
|
179 |
-
$products[$id]["price"]
|
180 |
-
$products[$id]["quantity"] = $product_quantity;
|
181 |
-
} else if (!empty($lead_value)) {
|
182 |
|
183 |
-
if (empty($quantity)) {
|
184 |
break;
|
185 |
}
|
186 |
|
187 |
-
if (!rgar($products, $id)) {
|
188 |
-
$products[$id] = array();
|
189 |
}
|
190 |
|
191 |
-
if ($field["inputType"] == "price") {
|
192 |
-
$name
|
193 |
$price = $lead_value;
|
194 |
} else {
|
195 |
-
list($name, $price) = explode("|", $lead_value);
|
196 |
}
|
197 |
|
198 |
-
$products[$id]["name"]
|
199 |
-
$products[$id]["price"]
|
200 |
-
$products[$id]["quantity"] = $quantity;
|
201 |
-
$products[$id]["options"]
|
202 |
}
|
203 |
|
204 |
-
if (isset($products[$id])) {
|
205 |
-
$options = GFCommon::get_product_fields_by_type($form, array("option"), $id);
|
206 |
-
foreach ($options as $option) {
|
207 |
-
$option_value = RGFormsModel::get_lead_field_value($lead, $option);
|
208 |
-
$option_label = empty($option["adminLabel"]) ? $option["label"] : $option["adminLabel"];
|
209 |
-
if (is_array($option_value)) {
|
210 |
-
foreach ($option_value as $value) {
|
211 |
-
$option_info = GFCommon::get_option_info($value, $option, $use_choice_text);
|
212 |
-
if (!empty($option_info)) {
|
213 |
-
$products[$id]["options"][] = array(
|
214 |
-
"field_label"
|
215 |
-
"option_name"
|
216 |
-
"option_label" => $option_label . ": " . rgar($option_info, "name"),
|
217 |
-
"price"
|
218 |
);
|
219 |
}
|
220 |
}
|
221 |
-
} else if (!empty($option_value)) {
|
222 |
-
$option_info
|
223 |
-
$products[$id]["options"][] = array(
|
224 |
-
"field_label"
|
225 |
-
"option_name"
|
226 |
-
"option_label" => $option_label . ": " . rgar($option_info, "name"),
|
227 |
-
"price"
|
228 |
);
|
229 |
}
|
230 |
}
|
@@ -233,137 +230,137 @@ if (!function_exists('tinvwl_item_price_wc_gf_addons')) {
|
|
233 |
}
|
234 |
}
|
235 |
|
236 |
-
$shipping_field = GFCommon::get_fields_by_type($form, array("shipping"));
|
237 |
$shipping_price = $shipping_name = "";
|
238 |
|
239 |
-
if (!empty($shipping_field) && !RGFormsModel::is_field_hidden($form, $shipping_field[0], array(), $lead)) {
|
240 |
-
$shipping_price = RGFormsModel::get_lead_field_value($lead, $shipping_field[0]);
|
241 |
-
$shipping_name
|
242 |
-
if ($shipping_field[0]["inputType"] != "singleshipping") {
|
243 |
-
list($shipping_method, $shipping_price) = explode("|", $shipping_price);
|
244 |
$shipping_name = $shipping_field[0]["label"] . " ($shipping_method)";
|
245 |
}
|
246 |
}
|
247 |
|
248 |
-
$shipping_price = GFCommon::to_number($shipping_price);
|
249 |
|
250 |
$product_info = array(
|
251 |
"products" => $products,
|
252 |
-
"shipping" => array("name" => $shipping_name, "price" => $shipping_price)
|
253 |
);
|
254 |
|
255 |
-
$products = apply_filters("gform_product_info_{$form["id"]}", apply_filters("gform_product_info", $product_info, $form, $lead), $form, $lead);
|
256 |
|
257 |
-
if (!empty($products["products"])) {
|
258 |
|
259 |
-
foreach ($products["products"] as $_product) {
|
260 |
-
$price = GFCommon::to_number($_product["price"]);
|
261 |
-
if (is_array(rgar($_product, "options"))) {
|
262 |
$index = 1;
|
263 |
-
foreach ($_product["options"] as $option) {
|
264 |
-
$price += GFCommon::to_number($option["price"]);
|
265 |
-
$index++;
|
266 |
}
|
267 |
}
|
268 |
-
$subtotal = floatval($_product["quantity"]) * $price;
|
269 |
-
$total
|
270 |
}
|
271 |
|
272 |
-
$total += floatval($products["shipping"]["price"]);
|
273 |
}
|
274 |
-
$price = $product->get_price('edit');
|
275 |
-
$price += (float)$total;
|
276 |
|
277 |
-
return wc_price($price);
|
278 |
}
|
|
|
279 |
return $price;
|
280 |
}
|
281 |
|
282 |
-
add_filter('tinvwl_wishlist_item_price', 'tinvwl_item_price_wc_gf_addons', 10, 3);
|
283 |
} // End if().
|
284 |
|
285 |
-
if (!function_exists('tinvwl_wc_gf_addons_edit_link')) {
|
286 |
-
function tinvwl_wc_gf_addons_edit_link($form)
|
287 |
-
{
|
288 |
|
289 |
-
if (isset($_GET['wc_gforms_wishlist_product_id']) && empty($_POST)) {
|
290 |
|
291 |
$wl_product_id = $_GET['wc_gforms_wishlist_product_id'];
|
292 |
-
$wlp
|
293 |
-
$wl_product
|
294 |
-
$wl_product
|
295 |
|
296 |
-
if (empty($wl_product)) {
|
297 |
return $form;
|
298 |
}
|
299 |
-
if (array_key_exists('wc_gforms_form_id', $wl_product['meta'])) {
|
300 |
|
301 |
-
$entry
|
302 |
'form_id' => $wl_product['meta']['wc_gforms_form_id']
|
303 |
);
|
304 |
$entry['id'] = uniqid() . time() . rand();
|
305 |
|
306 |
-
foreach ($wl_product['meta'] as $key => $meta) {
|
307 |
-
if (strpos($key, 'input_') === 0) {
|
308 |
-
$entry[str_replace('_', '.', substr($key, strlen('input_')))] = $meta;
|
309 |
}
|
310 |
}
|
311 |
|
312 |
$exclude_fields = array();
|
313 |
-
foreach ($form['fields'] as &$field) {
|
314 |
-
if (in_array($field['id'], $exclude_fields)) {
|
315 |
-
$field['cssClass']
|
316 |
$field['isRequired'] = false;
|
317 |
} else {
|
318 |
$value = null;
|
319 |
-
if ($field['type'] == 'checkbox' || ($field['type'] == 'option' && $field['inputType'] == 'checkbox')) { // handle checkbox fields
|
320 |
// only pull the field values from the entry that match the form field we are evaluating
|
321 |
$field_values = array();
|
322 |
|
323 |
-
foreach ($entry as $key => $value) {
|
324 |
-
$entry_key = explode('.', $key);
|
325 |
-
if ($entry_key[0] == $field['id']) {
|
326 |
-
$v
|
327 |
$field_values[] = $v[0];
|
328 |
}
|
329 |
}
|
330 |
-
foreach ($field->choices as &$choice) {
|
331 |
-
$choice['isSelected'] = (in_array($choice['value'], $field_values, true)) ? true : '';
|
332 |
}
|
333 |
-
} elseif (is_array($field->inputs)) { // handle other multi-input fields (address, name, time, etc.)
|
334 |
|
335 |
// for time field, parse entry string to get individual parts of time string
|
336 |
-
if ($field['type'] == 'time') {
|
337 |
// separate time string from entry into individual parts
|
338 |
-
list($HH, $time_end_part) = explode(':', $entry[strval($field['id'])]);
|
339 |
-
list($MM, $AMPM) = explode(' ', $time_end_part);
|
340 |
// save the time parts into individual array elements within the entry for our loop
|
341 |
-
$entry[$field['id'] . '.1'] = $HH;
|
342 |
-
$entry[$field['id'] . '.2'] = $MM;
|
343 |
-
$entry[$field['id'] . '.3'] = $AMPM;
|
344 |
}
|
345 |
|
346 |
// loop each field input and set the default value from the entry
|
347 |
-
foreach ($field->inputs as $key => &$input) {
|
348 |
$value = '';
|
349 |
-
if (isset($entry[strval($input['id'])])) {
|
350 |
-
$value = $entry[strval($input['id'])];
|
351 |
-
} elseif (isset($entry[$field['id']])) {
|
352 |
-
$value = $entry[$field['id']];
|
353 |
-
} elseif (isset($entry[$field['id'] . '1'])) {
|
354 |
-
$value = $entry[$field['id']] . '.1';
|
355 |
}
|
356 |
|
357 |
$input['defaultValue'] = $value;
|
358 |
}
|
359 |
} else { // handle remaining single input fields
|
360 |
-
if (isset($entry[$field['id']])) {
|
361 |
-
$value = $entry[$field['id']];
|
362 |
}
|
363 |
}
|
364 |
|
365 |
// if we have a value for the field from the provided entry, set the default value for the field
|
366 |
-
if (!empty($value)) {
|
367 |
$field['defaultValue'] = $value;
|
368 |
}
|
369 |
}
|
@@ -377,10 +374,10 @@ if (!function_exists('tinvwl_wc_gf_addons_edit_link')) {
|
|
377 |
|
378 |
}
|
379 |
|
380 |
-
add_filter('gform_pre_render', 'tinvwl_wc_gf_addons_edit_link', 99, 1);
|
381 |
}
|
382 |
|
383 |
-
if (!function_exists('tinv_wishlist_metaprepare_wc_gf_addons')) {
|
384 |
|
385 |
/**
|
386 |
* Prepare save meta for WooCommerce - Gravity Forms Product Add-Ons
|
@@ -389,18 +386,53 @@ if (!function_exists('tinv_wishlist_metaprepare_wc_gf_addons')) {
|
|
389 |
*
|
390 |
* @return array
|
391 |
*/
|
392 |
-
function tinv_wishlist_metaprepare_wc_gf_addons($meta)
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
$meta['input_' . str_replace('.', '_', substr($key, strlen('input_')))] = $value;
|
399 |
}
|
400 |
}
|
401 |
}
|
|
|
402 |
return $meta;
|
403 |
}
|
404 |
|
405 |
-
add_filter('tinvwl_product_prepare_meta', 'tinv_wishlist_metaprepare_wc_gf_addons');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
}
|
|
|
|
4 |
*
|
5 |
* @name WooCommerce Gravity Forms Product Add-Ons
|
6 |
*
|
7 |
+
* @version 3.3.26
|
8 |
*
|
9 |
* @slug woocommerce-gravityforms-product-addons
|
10 |
*
|
13 |
*/
|
14 |
|
15 |
// If this file is called directly, abort.
|
16 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
17 |
exit;
|
18 |
}
|
19 |
|
24 |
|
25 |
$name = "WooCommerce Gravity Forms Product Add-Ons";
|
26 |
|
27 |
+
$available = class_exists( 'WC_GFPA_Main' );
|
28 |
|
29 |
+
$tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : [];
|
30 |
|
31 |
+
$tinvwl_integrations[ $slug ] = array(
|
32 |
+
'name' => $name,
|
33 |
'available' => $available,
|
34 |
);
|
35 |
|
36 |
+
if ( ! tinv_get_option( 'integrations', $slug ) ) {
|
37 |
return;
|
38 |
}
|
39 |
|
40 |
+
if ( ! $available ) {
|
41 |
return;
|
42 |
}
|
43 |
|
44 |
+
if ( ! function_exists( 'tinv_wishlist_metasupport_wc_gf_addons' ) ) {
|
45 |
|
46 |
/**
|
47 |
* Set description for meta WooCommerce - Gravity Forms Product Add-Ons
|
50 |
*
|
51 |
* @return array
|
52 |
*/
|
53 |
+
function tinv_wishlist_metasupport_wc_gf_addons( $meta ) {
|
54 |
+
if ( array_key_exists( 'wc_gforms_form_id', $meta ) && class_exists( 'RGFormsModel' ) ) {
|
55 |
+
$form_meta = RGFormsModel::get_form_meta( $meta['wc_gforms_form_id']['display'] );
|
|
|
56 |
|
57 |
+
if ( array_key_exists( 'fields', $form_meta ) ) {
|
58 |
$_meta = array();
|
59 |
+
foreach ( $form_meta['fields'] as $field ) {
|
60 |
|
61 |
+
if ( isset( $field['displayOnly'] ) && $field['displayOnly'] ) {
|
62 |
continue;
|
63 |
}
|
64 |
|
65 |
+
$field_name = $field->get_first_input_id( array( 'id' => 0 ) );
|
66 |
|
67 |
+
if ( array_key_exists( $field_name, $meta ) ) {
|
68 |
|
69 |
+
if ( $field['type'] == 'product' ) {
|
70 |
+
$inputs = $field instanceof GF_Field ? $field->get_entry_inputs() : rgar( $field, 'inputs' );
|
71 |
+
if ( is_array( $inputs ) ) {
|
72 |
$value = array();
|
73 |
+
foreach ( $inputs as $input ) {
|
74 |
+
$full_name = 'input_' . str_replace( '.', '_', $input['id'] );
|
75 |
+
if ( $field_name == $full_name ) {
|
76 |
continue;
|
77 |
}
|
78 |
+
if ( array_key_exists( $full_name, $meta ) ) {
|
79 |
+
$value[] = $field->inputs[ array_search( $input['id'], array_column( $field->inputs, 'id' ) ) ]['label'] . ': ' . $meta[ $full_name ]['display'];
|
80 |
}
|
81 |
}
|
82 |
|
83 |
+
$meta[ $field_name ]['display'] = ( is_array( $value ) ) ? implode( ', ', $value ) : '-';
|
84 |
}
|
85 |
}
|
86 |
|
87 |
+
$meta[ $field_name ]['key'] = $field->label;
|
88 |
+
$_meta[ $field_name ] = $meta[ $field_name ];
|
89 |
|
90 |
}
|
91 |
}
|
96 |
return $meta;
|
97 |
}
|
98 |
|
99 |
+
add_filter( 'tinvwl_wishlist_item_meta_post', 'tinv_wishlist_metasupport_wc_gf_addons' );
|
100 |
}
|
101 |
|
102 |
+
if ( ! function_exists( 'tinvwl_wishlist_item_url_wc_gf_addons' ) ) {
|
103 |
|
104 |
+
function tinvwl_wishlist_item_url_wc_gf_addons( $url, $wl_product, $product ) {
|
|
|
105 |
|
106 |
+
$gravity_form_data = wc_gfpa()->get_gravity_form_data( $product->get_id() );
|
107 |
|
108 |
+
if ( isset( $gravity_form_data['enable_cart_edit'] ) && $gravity_form_data['enable_cart_edit'] !== 'no' ) {
|
109 |
+
$url = add_query_arg( array( 'wc_gforms_wishlist_product_id' => $wl_product['ID'] ), $product->get_permalink() );
|
110 |
}
|
111 |
|
112 |
return $url;
|
113 |
}
|
114 |
|
115 |
+
add_filter( 'tinvwl_wishlist_item_url', 'tinvwl_wishlist_item_url_wc_gf_addons', 10, 3 );
|
116 |
}
|
117 |
|
118 |
+
if ( ! function_exists( 'tinvwl_item_price_wc_gf_addons' ) ) {
|
119 |
|
120 |
/**
|
121 |
* Modify price for WooCommerce - Gravity Forms Product Add-Ons
|
126 |
*
|
127 |
* @return string
|
128 |
*/
|
129 |
+
function tinvwl_item_price_wc_gf_addons( $price, $wl_product, $product ) {
|
130 |
+
if ( array_key_exists( 'wc_gforms_form_id', $wl_product['meta'] ) && class_exists( 'RGFormsModel' ) ) {
|
131 |
+
$form = RGFormsModel::get_form_meta( $wl_product['meta']['wc_gforms_form_id'] );
|
|
|
132 |
|
133 |
+
if ( empty( $form ) ) {
|
134 |
return $price;
|
135 |
}
|
136 |
|
137 |
+
$lead = array(
|
138 |
'form_id' => $wl_product['meta']['wc_gforms_form_id']
|
139 |
);
|
140 |
$lead['id'] = uniqid() . time() . rand();
|
141 |
|
142 |
+
foreach ( $wl_product['meta'] as $key => $meta ) {
|
143 |
+
if ( strpos( $key, 'input_' ) === 0 ) {
|
144 |
+
$lead[ str_replace( '_', '.', substr( $key, strlen( 'input_' ) ) ) ] = $meta;
|
145 |
}
|
146 |
}
|
147 |
|
148 |
$use_choice_text = false;
|
149 |
$use_admin_label = false;
|
150 |
+
$products = array();
|
151 |
+
$total = 0;
|
152 |
|
153 |
+
foreach ( $form["fields"] as $field ) {
|
154 |
+
$id = $field["id"];
|
155 |
+
$lead_value = RGFormsModel::get_lead_field_value( $lead, $field );
|
156 |
|
157 |
+
$quantity_field = GFCommon::get_product_fields_by_type( $form, array( "quantity" ), $id );
|
158 |
+
$quantity = sizeof( $quantity_field ) > 0 ? RGFormsModel::get_lead_field_value( $lead, $quantity_field[0] ) : 1;
|
159 |
|
160 |
+
switch ( $field["type"] ) {
|
161 |
|
162 |
case "product" :
|
163 |
|
164 |
//if single product, get values from the multiple inputs
|
165 |
+
if ( is_array( $lead_value ) ) {
|
166 |
+
$product_quantity = sizeof( $quantity_field ) == 0 && ! rgar( $field, "disableQuantity" ) ? rgget( $id . ".3", $lead_value ) : $quantity;
|
167 |
+
if ( empty( $product_quantity ) ) {
|
168 |
break;
|
169 |
}
|
170 |
|
171 |
+
if ( ! rgget( $id, $products ) ) {
|
172 |
+
$products[ $id ] = array();
|
173 |
}
|
174 |
|
175 |
+
$products[ $id ]["name"] = $use_admin_label && ! rgempty( "adminLabel", $field ) ? $field["adminLabel"] : $lead_value[ $id . ".1" ];
|
176 |
+
$products[ $id ]["price"] = rgar( $lead_value, $id . ".2" );
|
177 |
+
$products[ $id ]["quantity"] = $product_quantity;
|
178 |
+
} else if ( ! empty( $lead_value ) ) {
|
179 |
|
180 |
+
if ( empty( $quantity ) ) {
|
181 |
break;
|
182 |
}
|
183 |
|
184 |
+
if ( ! rgar( $products, $id ) ) {
|
185 |
+
$products[ $id ] = array();
|
186 |
}
|
187 |
|
188 |
+
if ( $field["inputType"] == "price" ) {
|
189 |
+
$name = $field["label"];
|
190 |
$price = $lead_value;
|
191 |
} else {
|
192 |
+
list( $name, $price ) = explode( "|", $lead_value );
|
193 |
}
|
194 |
|
195 |
+
$products[ $id ]["name"] = ! $use_choice_text ? $name : RGFormsModel::get_choice_text( $field, $name );
|
196 |
+
$products[ $id ]["price"] = $price;
|
197 |
+
$products[ $id ]["quantity"] = $quantity;
|
198 |
+
$products[ $id ]["options"] = array();
|
199 |
}
|
200 |
|
201 |
+
if ( isset( $products[ $id ] ) ) {
|
202 |
+
$options = GFCommon::get_product_fields_by_type( $form, array( "option" ), $id );
|
203 |
+
foreach ( $options as $option ) {
|
204 |
+
$option_value = RGFormsModel::get_lead_field_value( $lead, $option );
|
205 |
+
$option_label = empty( $option["adminLabel"] ) ? $option["label"] : $option["adminLabel"];
|
206 |
+
if ( is_array( $option_value ) ) {
|
207 |
+
foreach ( $option_value as $value ) {
|
208 |
+
$option_info = GFCommon::get_option_info( $value, $option, $use_choice_text );
|
209 |
+
if ( ! empty( $option_info ) ) {
|
210 |
+
$products[ $id ]["options"][] = array(
|
211 |
+
"field_label" => rgar( $option, "label" ),
|
212 |
+
"option_name" => rgar( $option_info, "name" ),
|
213 |
+
"option_label" => $option_label . ": " . rgar( $option_info, "name" ),
|
214 |
+
"price" => rgar( $option_info, "price" )
|
215 |
);
|
216 |
}
|
217 |
}
|
218 |
+
} else if ( ! empty( $option_value ) ) {
|
219 |
+
$option_info = GFCommon::get_option_info( $option_value, $option, $use_choice_text );
|
220 |
+
$products[ $id ]["options"][] = array(
|
221 |
+
"field_label" => rgar( $option, "label" ),
|
222 |
+
"option_name" => rgar( $option_info, "name" ),
|
223 |
+
"option_label" => $option_label . ": " . rgar( $option_info, "name" ),
|
224 |
+
"price" => rgar( $option_info, "price" )
|
225 |
);
|
226 |
}
|
227 |
}
|
230 |
}
|
231 |
}
|
232 |
|
233 |
+
$shipping_field = GFCommon::get_fields_by_type( $form, array( "shipping" ) );
|
234 |
$shipping_price = $shipping_name = "";
|
235 |
|
236 |
+
if ( ! empty( $shipping_field ) && ! RGFormsModel::is_field_hidden( $form, $shipping_field[0], array(), $lead ) ) {
|
237 |
+
$shipping_price = RGFormsModel::get_lead_field_value( $lead, $shipping_field[0] );
|
238 |
+
$shipping_name = $shipping_field[0]["label"];
|
239 |
+
if ( $shipping_field[0]["inputType"] != "singleshipping" ) {
|
240 |
+
list( $shipping_method, $shipping_price ) = explode( "|", $shipping_price );
|
241 |
$shipping_name = $shipping_field[0]["label"] . " ($shipping_method)";
|
242 |
}
|
243 |
}
|
244 |
|
245 |
+
$shipping_price = GFCommon::to_number( $shipping_price );
|
246 |
|
247 |
$product_info = array(
|
248 |
"products" => $products,
|
249 |
+
"shipping" => array( "name" => $shipping_name, "price" => $shipping_price )
|
250 |
);
|
251 |
|
252 |
+
$products = apply_filters( "gform_product_info_{$form["id"]}", apply_filters( "gform_product_info", $product_info, $form, $lead ), $form, $lead );
|
253 |
|
254 |
+
if ( ! empty( $products["products"] ) ) {
|
255 |
|
256 |
+
foreach ( $products["products"] as $_product ) {
|
257 |
+
$price = GFCommon::to_number( $_product["price"] );
|
258 |
+
if ( is_array( rgar( $_product, "options" ) ) ) {
|
259 |
$index = 1;
|
260 |
+
foreach ( $_product["options"] as $option ) {
|
261 |
+
$price += GFCommon::to_number( $option["price"] );
|
262 |
+
$index ++;
|
263 |
}
|
264 |
}
|
265 |
+
$subtotal = floatval( $_product["quantity"] ) * $price;
|
266 |
+
$total += $subtotal;
|
267 |
}
|
268 |
|
269 |
+
$total += floatval( $products["shipping"]["price"] );
|
270 |
}
|
271 |
+
$price = $product->get_price( 'edit' );
|
272 |
+
$price += (float) $total;
|
273 |
|
274 |
+
return wc_price( $price );
|
275 |
}
|
276 |
+
|
277 |
return $price;
|
278 |
}
|
279 |
|
280 |
+
add_filter( 'tinvwl_wishlist_item_price', 'tinvwl_item_price_wc_gf_addons', 10, 3 );
|
281 |
} // End if().
|
282 |
|
283 |
+
if ( ! function_exists( 'tinvwl_wc_gf_addons_edit_link' ) ) {
|
284 |
+
function tinvwl_wc_gf_addons_edit_link( $form ) {
|
|
|
285 |
|
286 |
+
if ( isset( $_GET['wc_gforms_wishlist_product_id'] ) && empty( $_POST ) ) {
|
287 |
|
288 |
$wl_product_id = $_GET['wc_gforms_wishlist_product_id'];
|
289 |
+
$wlp = new TInvWL_Product();
|
290 |
+
$wl_product = $wlp->get( array( 'ID' => $wl_product_id ) );
|
291 |
+
$wl_product = array_shift( $wl_product );
|
292 |
|
293 |
+
if ( empty( $wl_product ) ) {
|
294 |
return $form;
|
295 |
}
|
296 |
+
if ( array_key_exists( 'wc_gforms_form_id', $wl_product['meta'] ) ) {
|
297 |
|
298 |
+
$entry = array(
|
299 |
'form_id' => $wl_product['meta']['wc_gforms_form_id']
|
300 |
);
|
301 |
$entry['id'] = uniqid() . time() . rand();
|
302 |
|
303 |
+
foreach ( $wl_product['meta'] as $key => $meta ) {
|
304 |
+
if ( strpos( $key, 'input_' ) === 0 ) {
|
305 |
+
$entry[ str_replace( '_', '.', substr( $key, strlen( 'input_' ) ) ) ] = $meta;
|
306 |
}
|
307 |
}
|
308 |
|
309 |
$exclude_fields = array();
|
310 |
+
foreach ( $form['fields'] as &$field ) {
|
311 |
+
if ( in_array( $field['id'], $exclude_fields ) ) {
|
312 |
+
$field['cssClass'] = 'gform_hidden';
|
313 |
$field['isRequired'] = false;
|
314 |
} else {
|
315 |
$value = null;
|
316 |
+
if ( $field['type'] == 'checkbox' || ( $field['type'] == 'option' && $field['inputType'] == 'checkbox' ) ) { // handle checkbox fields
|
317 |
// only pull the field values from the entry that match the form field we are evaluating
|
318 |
$field_values = array();
|
319 |
|
320 |
+
foreach ( $entry as $key => $value ) {
|
321 |
+
$entry_key = explode( '.', $key );
|
322 |
+
if ( $entry_key[0] == $field['id'] ) {
|
323 |
+
$v = explode( '|', $value );
|
324 |
$field_values[] = $v[0];
|
325 |
}
|
326 |
}
|
327 |
+
foreach ( $field->choices as &$choice ) {
|
328 |
+
$choice['isSelected'] = ( in_array( $choice['value'], $field_values, true ) ) ? true : '';
|
329 |
}
|
330 |
+
} elseif ( is_array( $field->inputs ) ) { // handle other multi-input fields (address, name, time, etc.)
|
331 |
|
332 |
// for time field, parse entry string to get individual parts of time string
|
333 |
+
if ( $field['type'] == 'time' ) {
|
334 |
// separate time string from entry into individual parts
|
335 |
+
list( $HH, $time_end_part ) = explode( ':', $entry[ strval( $field['id'] ) ] );
|
336 |
+
list( $MM, $AMPM ) = explode( ' ', $time_end_part );
|
337 |
// save the time parts into individual array elements within the entry for our loop
|
338 |
+
$entry[ $field['id'] . '.1' ] = $HH;
|
339 |
+
$entry[ $field['id'] . '.2' ] = $MM;
|
340 |
+
$entry[ $field['id'] . '.3' ] = $AMPM;
|
341 |
}
|
342 |
|
343 |
// loop each field input and set the default value from the entry
|
344 |
+
foreach ( $field->inputs as $key => &$input ) {
|
345 |
$value = '';
|
346 |
+
if ( isset( $entry[ strval( $input['id'] ) ] ) ) {
|
347 |
+
$value = $entry[ strval( $input['id'] ) ];
|
348 |
+
} elseif ( isset( $entry[ $field['id'] ] ) ) {
|
349 |
+
$value = $entry[ $field['id'] ];
|
350 |
+
} elseif ( isset( $entry[ $field['id'] . '1' ] ) ) {
|
351 |
+
$value = $entry[ $field['id'] ] . '.1';
|
352 |
}
|
353 |
|
354 |
$input['defaultValue'] = $value;
|
355 |
}
|
356 |
} else { // handle remaining single input fields
|
357 |
+
if ( isset( $entry[ $field['id'] ] ) ) {
|
358 |
+
$value = $entry[ $field['id'] ];
|
359 |
}
|
360 |
}
|
361 |
|
362 |
// if we have a value for the field from the provided entry, set the default value for the field
|
363 |
+
if ( ! empty( $value ) ) {
|
364 |
$field['defaultValue'] = $value;
|
365 |
}
|
366 |
}
|
374 |
|
375 |
}
|
376 |
|
377 |
+
add_filter( 'gform_pre_render', 'tinvwl_wc_gf_addons_edit_link', 99, 1 );
|
378 |
}
|
379 |
|
380 |
+
if ( ! function_exists( 'tinv_wishlist_metaprepare_wc_gf_addons' ) ) {
|
381 |
|
382 |
/**
|
383 |
* Prepare save meta for WooCommerce - Gravity Forms Product Add-Ons
|
386 |
*
|
387 |
* @return array
|
388 |
*/
|
389 |
+
function tinv_wishlist_metaprepare_wc_gf_addons( $meta ) {
|
390 |
+
if ( array_key_exists( 'wc_gforms_form_id', $meta ) && class_exists( 'RGFormsModel' ) ) {
|
391 |
+
foreach ( $meta as $key => $value ) {
|
392 |
+
if ( strpos( $key, 'input_' ) === 0 ) {
|
393 |
+
unset( $meta[ $key ] );
|
394 |
+
$meta[ 'input_' . str_replace( '.', '_', substr( $key, strlen( 'input_' ) ) ) ] = $value;
|
|
|
395 |
}
|
396 |
}
|
397 |
}
|
398 |
+
|
399 |
return $meta;
|
400 |
}
|
401 |
|
402 |
+
add_filter( 'tinvwl_product_prepare_meta', 'tinv_wishlist_metaprepare_wc_gf_addons' );
|
403 |
+
}
|
404 |
+
|
405 |
+
function tinv_add_to_wishlist_wc_gf_addons() {
|
406 |
+
wp_add_inline_script( 'tinvwl', "
|
407 |
+
jQuery('body').on('tinvwl_add_to_wishlist_button_click', function(e, el){
|
408 |
+
jQuery(el).closest('form.cart').each(function(){
|
409 |
+
if (jQuery(this).find('.gform_variation_wrapper').length) {
|
410 |
+
|
411 |
+
jQuery(this).on('change input', function(){
|
412 |
+
tinv_add_to_wishlist_wc_gf_addons(jQuery(this), jQuery(el));
|
413 |
+
});
|
414 |
+
|
415 |
+
tinv_add_to_wishlist_wc_gf_addons(jQuery(this), jQuery(el));
|
416 |
+
|
417 |
+
}
|
418 |
+
});
|
419 |
+
});
|
420 |
+
|
421 |
+
function tinv_add_to_wishlist_wc_gf_addons(form, el){
|
422 |
+
|
423 |
+
form.find('*[aria-required]').attr('required', true);
|
424 |
+
|
425 |
+
if (!form[0].checkValidity()){
|
426 |
+
el.addClass('disabled-add-wishlist');
|
427 |
+
form[0].reportValidity();
|
428 |
+
} else {
|
429 |
+
el.removeClass('disabled-add-wishlist');
|
430 |
+
}
|
431 |
+
|
432 |
+
form.find('*[aria-required]').removeAttr('required');
|
433 |
+
|
434 |
+
}
|
435 |
+
" );
|
436 |
}
|
437 |
+
|
438 |
+
add_action( 'wp_enqueue_scripts', 'tinv_add_to_wishlist_wc_gf_addons', 100, 1 );
|
integrations/woocommerce-product-bundles.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
*/
|
14 |
|
15 |
// If this file is called directly, abort.
|
16 |
-
if (!defined('ABSPATH')) {
|
17 |
exit;
|
18 |
}
|
19 |
|
@@ -24,24 +24,24 @@ $slug = "woocommerce-product-bundles";
|
|
24 |
|
25 |
$name = "WooCommerce Product Bundles";
|
26 |
|
27 |
-
$available = class_exists('WC_Bundles');
|
28 |
|
29 |
$tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : [];
|
30 |
|
31 |
-
$tinvwl_integrations[$slug] = array(
|
32 |
-
'name'
|
33 |
'available' => $available,
|
34 |
);
|
35 |
|
36 |
-
if (!tinv_get_option('integrations', $slug)) {
|
37 |
return;
|
38 |
}
|
39 |
|
40 |
-
if (
|
41 |
return;
|
42 |
}
|
43 |
|
44 |
-
if (!function_exists('tinv_wishlist_metasupport_woocommerce_product_bundles')) {
|
45 |
|
46 |
/**
|
47 |
* Set description for meta WooCommerce Product Bundles
|
@@ -51,21 +51,20 @@ if (!function_exists('tinv_wishlist_metasupport_woocommerce_product_bundles')) {
|
|
51 |
*
|
52 |
* @return array
|
53 |
*/
|
54 |
-
function tinv_wishlist_metasupport_woocommerce_product_bundles($meta, $product_id)
|
55 |
-
|
56 |
-
$product = wc_get_product($product_id);
|
57 |
|
58 |
-
if (is_object($product) && $product->is_type('bundle') && empty($meta['bkap_price_charged'])) {
|
59 |
$meta = array();
|
60 |
}
|
61 |
|
62 |
return $meta;
|
63 |
}
|
64 |
|
65 |
-
add_filter('tinvwl_wishlist_item_meta_post', 'tinv_wishlist_metasupport_woocommerce_product_bundles', 10, 2);
|
66 |
} // End if().
|
67 |
|
68 |
-
if (!function_exists('tinvwl_row_woocommerce_product_bundles')) {
|
69 |
|
70 |
/**
|
71 |
* Add rows for sub product for WooCommerce Product Bundles
|
@@ -74,95 +73,94 @@ if (!function_exists('tinvwl_row_woocommerce_product_bundles')) {
|
|
74 |
* @param \WC_Product $product Woocommerce Product.
|
75 |
* @param int $discount_extra possible discount on bundle row.
|
76 |
*/
|
77 |
-
function tinvwl_row_woocommerce_product_bundles($wl_product, $product, $discount_extra = 0)
|
78 |
-
|
79 |
-
if (is_object($product) && $product->is_type('bundle')) {
|
80 |
|
81 |
-
$product_id
|
82 |
$bundled_items = $product->get_bundled_items();
|
83 |
-
if (!empty($bundled_items)) {
|
84 |
-
foreach ($bundled_items as $bundled_item_id => $bundled_item) {
|
85 |
|
86 |
-
$bundled_item_variation_id_request_key = apply_filters('woocommerce_product_bundle_field_prefix', '', $product_id) . 'bundle_variation_id_' . $bundled_item_id;
|
87 |
-
$bundled_variation_id
|
88 |
-
if (!empty($bundled_variation_id)) {
|
89 |
-
$bundled_item->product = wc_get_product($bundled_variation_id);
|
90 |
}
|
91 |
|
92 |
$is_optional = $bundled_item->is_optional();
|
93 |
|
94 |
-
$bundled_item_quantity_request_key = apply_filters('woocommerce_product_bundle_field_prefix', '', $product_id) . 'bundle_quantity_' . $bundled_item_id;
|
95 |
-
$bundled_product_qty
|
96 |
|
97 |
-
if ($is_optional) {
|
98 |
|
99 |
/** Documented in method 'get_posted_bundle_configuration'. */
|
100 |
-
$bundled_item_selected_request_key = apply_filters('woocommerce_product_bundle_field_prefix', '', $product_id) . 'bundle_selected_optional_' . $bundled_item_id;
|
101 |
|
102 |
-
if (!array_key_exists($bundled_item_selected_request_key, $wl_product['meta'])) {
|
103 |
$bundled_product_qty = 0;
|
104 |
}
|
105 |
}
|
106 |
-
if (0 === $bundled_product_qty || 'visible' != $bundled_item->cart_visibility) {
|
107 |
continue;
|
108 |
}
|
109 |
|
110 |
-
$product_url
|
111 |
$product_image = $bundled_item->product->get_image();
|
112 |
-
$product_title = $bundled_item->has_title_override() ? is_callable(array(
|
113 |
$bundled_item,
|
114 |
'get_name'
|
115 |
-
)) ? $bundled_item->get_name() : $bundled_item->get_title() : $bundled_item->get_raw_title();
|
116 |
|
117 |
-
$product_price
|
118 |
$product_price_raw = $bundled_item->product->get_regular_price();
|
119 |
-
$discount
|
120 |
-
$discount
|
121 |
-
$product_price
|
122 |
|
123 |
-
if ($bundled_item->product->is_visible()) {
|
124 |
-
$product_image = sprintf('<a href="%s">%s</a>', esc_url($product_url), $product_image);
|
125 |
-
$product_title = sprintf('<a href="%s">%s</a>', esc_url($product_url), $product_title);
|
126 |
}
|
127 |
-
$product_title .= tinv_wishlist_get_item_data($bundled_item->product, $wl_product);
|
128 |
|
129 |
-
$availability = (array)$bundled_item->product->get_availability();
|
130 |
-
if (!array_key_exists('availability', $availability)) {
|
131 |
$availability['availability'] = '';
|
132 |
}
|
133 |
-
if (!array_key_exists('class', $availability)) {
|
134 |
$availability['class'] = '';
|
135 |
}
|
136 |
-
$availability_html = empty($availability['availability']) ? '<p class="stock ' . esc_attr($availability['class']) . '"><span><i class="ftinvwl ftinvwl-check"></i></span><span class="tinvwl-txt">' . esc_html__('In stock', 'ti-woocommerce-wishlist') . '</span></p>' : '<p class="stock ' . esc_attr($availability['class']) . '"><span><i class="ftinvwl ftinvwl-times"></i></span><span>' . esc_html($availability['availability']) . '</span></p>';
|
137 |
-
$row_string
|
138 |
-
$row_string
|
139 |
-
if (tinv_get_option('product_table', 'colm_price') && $bundled_item->is_priced_individually()) {
|
140 |
$row_string .= '<td class="product-price">%3$s × %5$s</td>';
|
141 |
-
} elseif (
|
142 |
$row_string .= '<td class="product-price"></td>';
|
143 |
}
|
144 |
-
if (tinv_get_option('product_table', 'colm_date')) {
|
145 |
$row_string .= '<td class="product-date"> </td>';
|
146 |
}
|
147 |
-
if (tinv_get_option('product_table', 'colm_stock')) {
|
148 |
$row_string .= '<td class="product-stock">%4$s</td>';
|
149 |
}
|
150 |
|
151 |
-
if (tinv_get_option('product_table', 'add_to_cart')) {
|
152 |
$row_string .= '<td class="product-action"> </td>';
|
153 |
}
|
154 |
$row_string .= '</tr>';
|
155 |
|
156 |
-
echo sprintf($row_string, $product_image, $product_title, $product_price, $availability_html, $bundled_product_qty); // WPCS: xss ok.
|
157 |
} // End foreach().
|
158 |
} // End if().
|
159 |
} // End if().
|
160 |
}
|
161 |
|
162 |
-
add_action('tinvwl_wishlist_row_after', 'tinvwl_row_woocommerce_product_bundles', 10, 2);
|
163 |
} // End if().
|
164 |
|
165 |
-
if (!function_exists('tinvwl_item_price_woocommerce_product_bundles')) {
|
166 |
|
167 |
/**
|
168 |
* Modify price for WooCommerce Product Bundles
|
@@ -173,58 +171,57 @@ if (!function_exists('tinvwl_item_price_woocommerce_product_bundles')) {
|
|
173 |
*
|
174 |
* @return string
|
175 |
*/
|
176 |
-
function tinvwl_item_price_woocommerce_product_bundles($price, $wl_product, $product, $raw = false)
|
177 |
-
|
178 |
-
if (is_object($product) && $product->is_type('bundle')) {
|
179 |
|
180 |
-
$bundle_price
|
181 |
-
$product_id
|
182 |
$bundled_items = $product->get_bundled_items();
|
183 |
|
184 |
-
if (!empty($bundled_items)) {
|
185 |
|
186 |
$bundled_items_price = 0.0;
|
187 |
|
188 |
-
foreach ($bundled_items as $bundled_item_id => $bundled_item) {
|
189 |
|
190 |
-
$bundled_item_variation_id_request_key = apply_filters('woocommerce_product_bundle_field_prefix', '', $product_id) . 'bundle_variation_id_' . $bundled_item_id;
|
191 |
-
$bundled_variation_id
|
192 |
-
if (!empty($bundled_variation_id)) {
|
193 |
-
$_bundled_product = wc_get_product($bundled_variation_id);
|
194 |
} else {
|
195 |
$_bundled_product = $bundled_item->product;
|
196 |
}
|
197 |
|
198 |
$is_optional = $bundled_item->is_optional();
|
199 |
|
200 |
-
$bundled_item_quantity_request_key = apply_filters('woocommerce_product_bundle_field_prefix', '', $product_id) . 'bundle_quantity_' . $bundled_item_id;
|
201 |
-
$bundled_product_qty
|
202 |
|
203 |
-
if ($is_optional) {
|
204 |
|
205 |
/** Documented in method 'get_posted_bundle_configuration'. */
|
206 |
-
$bundled_item_selected_request_key = apply_filters('woocommerce_product_bundle_field_prefix', '', $product_id) . 'bundle_selected_optional_' . $bundled_item_id;
|
207 |
|
208 |
-
if (!array_key_exists($bundled_item_selected_request_key, $wl_product['meta'])) {
|
209 |
$bundled_product_qty = 0;
|
210 |
}
|
211 |
}
|
212 |
|
213 |
-
if ($bundled_item->is_priced_individually()) {
|
214 |
$product_price = $_bundled_product->get_price();
|
215 |
|
216 |
-
$discount
|
217 |
-
$product_price = empty($discount) ? $product_price : WC_PB_Product_Prices::get_discounted_price($product_price, $discount);
|
218 |
|
219 |
-
$bundled_item_price = (double)$product_price * (int)$bundled_product_qty;
|
220 |
|
221 |
-
$bundled_items_price += (double)$bundled_item_price;
|
222 |
}
|
223 |
|
224 |
} // End foreach().
|
225 |
-
$price = (double)$bundle_price + $bundled_items_price;
|
226 |
-
if (
|
227 |
-
$price = apply_filters('woocommerce_get_price_html', wc_price($price), $product);
|
228 |
}
|
229 |
} // End if().
|
230 |
} // End if().
|
@@ -232,5 +229,5 @@ if (!function_exists('tinvwl_item_price_woocommerce_product_bundles')) {
|
|
232 |
return $price;
|
233 |
}
|
234 |
|
235 |
-
add_filter('tinvwl_wishlist_item_price', 'tinvwl_item_price_woocommerce_product_bundles', 10, 3);
|
236 |
} // End if().
|
13 |
*/
|
14 |
|
15 |
// If this file is called directly, abort.
|
16 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
17 |
exit;
|
18 |
}
|
19 |
|
24 |
|
25 |
$name = "WooCommerce Product Bundles";
|
26 |
|
27 |
+
$available = class_exists( 'WC_Bundles' );
|
28 |
|
29 |
$tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : [];
|
30 |
|
31 |
+
$tinvwl_integrations[ $slug ] = array(
|
32 |
+
'name' => $name,
|
33 |
'available' => $available,
|
34 |
);
|
35 |
|
36 |
+
if ( ! tinv_get_option( 'integrations', $slug ) ) {
|
37 |
return;
|
38 |
}
|
39 |
|
40 |
+
if ( ! $available ) {
|
41 |
return;
|
42 |
}
|
43 |
|
44 |
+
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_product_bundles' ) ) {
|
45 |
|
46 |
/**
|
47 |
* Set description for meta WooCommerce Product Bundles
|
51 |
*
|
52 |
* @return array
|
53 |
*/
|
54 |
+
function tinv_wishlist_metasupport_woocommerce_product_bundles( $meta, $product_id ) {
|
55 |
+
$product = wc_get_product( $product_id );
|
|
|
56 |
|
57 |
+
if ( is_object( $product ) && $product->is_type( 'bundle' ) && empty( $meta['bkap_price_charged'] ) ) {
|
58 |
$meta = array();
|
59 |
}
|
60 |
|
61 |
return $meta;
|
62 |
}
|
63 |
|
64 |
+
add_filter( 'tinvwl_wishlist_item_meta_post', 'tinv_wishlist_metasupport_woocommerce_product_bundles', 10, 2 );
|
65 |
} // End if().
|
66 |
|
67 |
+
if ( ! function_exists( 'tinvwl_row_woocommerce_product_bundles' ) ) {
|
68 |
|
69 |
/**
|
70 |
* Add rows for sub product for WooCommerce Product Bundles
|
73 |
* @param \WC_Product $product Woocommerce Product.
|
74 |
* @param int $discount_extra possible discount on bundle row.
|
75 |
*/
|
76 |
+
function tinvwl_row_woocommerce_product_bundles( $wl_product, $product, $discount_extra = 0 ) {
|
77 |
+
if ( is_object( $product ) && $product->is_type( 'bundle' ) ) {
|
|
|
78 |
|
79 |
+
$product_id = WC_PB_Core_Compatibility::get_id( $product );
|
80 |
$bundled_items = $product->get_bundled_items();
|
81 |
+
if ( ! empty( $bundled_items ) ) {
|
82 |
+
foreach ( $bundled_items as $bundled_item_id => $bundled_item ) {
|
83 |
|
84 |
+
$bundled_item_variation_id_request_key = apply_filters( 'woocommerce_product_bundle_field_prefix', '', $product_id ) . 'bundle_variation_id_' . $bundled_item_id;
|
85 |
+
$bundled_variation_id = absint( isset( $wl_product['meta'][ $bundled_item_variation_id_request_key ] ) ? $wl_product['meta'][ $bundled_item_variation_id_request_key ] : 0 );
|
86 |
+
if ( ! empty( $bundled_variation_id ) ) {
|
87 |
+
$bundled_item->product = wc_get_product( $bundled_variation_id );
|
88 |
}
|
89 |
|
90 |
$is_optional = $bundled_item->is_optional();
|
91 |
|
92 |
+
$bundled_item_quantity_request_key = apply_filters( 'woocommerce_product_bundle_field_prefix', '', $product_id ) . 'bundle_quantity_' . $bundled_item_id;
|
93 |
+
$bundled_product_qty = isset( $wl_product['meta'][ $bundled_item_quantity_request_key ] ) ? absint( $wl_product['meta'][ $bundled_item_quantity_request_key ] ) : $bundled_item->get_quantity();
|
94 |
|
95 |
+
if ( $is_optional ) {
|
96 |
|
97 |
/** Documented in method 'get_posted_bundle_configuration'. */
|
98 |
+
$bundled_item_selected_request_key = apply_filters( 'woocommerce_product_bundle_field_prefix', '', $product_id ) . 'bundle_selected_optional_' . $bundled_item_id;
|
99 |
|
100 |
+
if ( ! array_key_exists( $bundled_item_selected_request_key, $wl_product['meta'] ) ) {
|
101 |
$bundled_product_qty = 0;
|
102 |
}
|
103 |
}
|
104 |
+
if ( 0 === $bundled_product_qty || 'visible' != $bundled_item->cart_visibility ) {
|
105 |
continue;
|
106 |
}
|
107 |
|
108 |
+
$product_url = $bundled_item->product->get_permalink();
|
109 |
$product_image = $bundled_item->product->get_image();
|
110 |
+
$product_title = $bundled_item->has_title_override() ? is_callable( array(
|
111 |
$bundled_item,
|
112 |
'get_name'
|
113 |
+
) ) ? $bundled_item->get_name() : $bundled_item->get_title() : $bundled_item->get_raw_title();
|
114 |
|
115 |
+
$product_price = $bundled_item->product->get_price_html();
|
116 |
$product_price_raw = $bundled_item->product->get_regular_price();
|
117 |
+
$discount = $bundled_item->get_discount();
|
118 |
+
$discount = empty( $discount ) ? $discount_extra : ( 100 - $discount ) / $discount_extra + $discount;
|
119 |
+
$product_price = empty( $discount ) ? $product_price : wc_price( WC_PB_Product_Prices::get_discounted_price( $product_price_raw, $discount ) );
|
120 |
|
121 |
+
if ( $bundled_item->product->is_visible() ) {
|
122 |
+
$product_image = sprintf( '<a href="%s">%s</a>', esc_url( $product_url ), $product_image );
|
123 |
+
$product_title = sprintf( '<a href="%s">%s</a>', esc_url( $product_url ), $product_title );
|
124 |
}
|
125 |
+
$product_title .= tinv_wishlist_get_item_data( $bundled_item->product, $wl_product );
|
126 |
|
127 |
+
$availability = (array) $bundled_item->product->get_availability();
|
128 |
+
if ( ! array_key_exists( 'availability', $availability ) ) {
|
129 |
$availability['availability'] = '';
|
130 |
}
|
131 |
+
if ( ! array_key_exists( 'class', $availability ) ) {
|
132 |
$availability['class'] = '';
|
133 |
}
|
134 |
+
$availability_html = empty( $availability['availability'] ) ? '<p class="stock ' . esc_attr( $availability['class'] ) . '"><span><i class="ftinvwl ftinvwl-check"></i></span><span class="tinvwl-txt">' . esc_html__( 'In stock', 'ti-woocommerce-wishlist' ) . '</span></p>' : '<p class="stock ' . esc_attr( $availability['class'] ) . '"><span><i class="ftinvwl ftinvwl-times"></i></span><span>' . esc_html( $availability['availability'] ) . '</span></p>';
|
135 |
+
$row_string = '<tr>';
|
136 |
+
$row_string .= '<td colspan="2"> </td><td class="product-thumbnail">%1$s</td><td class="product-name">%2$s</td>';
|
137 |
+
if ( tinv_get_option( 'product_table', 'colm_price' ) && $bundled_item->is_priced_individually() ) {
|
138 |
$row_string .= '<td class="product-price">%3$s × %5$s</td>';
|
139 |
+
} elseif ( ! $bundled_item->is_priced_individually() ) {
|
140 |
$row_string .= '<td class="product-price"></td>';
|
141 |
}
|
142 |
+
if ( tinv_get_option( 'product_table', 'colm_date' ) ) {
|
143 |
$row_string .= '<td class="product-date"> </td>';
|
144 |
}
|
145 |
+
if ( tinv_get_option( 'product_table', 'colm_stock' ) ) {
|
146 |
$row_string .= '<td class="product-stock">%4$s</td>';
|
147 |
}
|
148 |
|
149 |
+
if ( tinv_get_option( 'product_table', 'add_to_cart' ) ) {
|
150 |
$row_string .= '<td class="product-action"> </td>';
|
151 |
}
|
152 |
$row_string .= '</tr>';
|
153 |
|
154 |
+
echo sprintf( $row_string, $product_image, $product_title, $product_price, $availability_html, $bundled_product_qty ); // WPCS: xss ok.
|
155 |
} // End foreach().
|
156 |
} // End if().
|
157 |
} // End if().
|
158 |
}
|
159 |
|
160 |
+
add_action( 'tinvwl_wishlist_row_after', 'tinvwl_row_woocommerce_product_bundles', 10, 2 );
|
161 |
} // End if().
|
162 |
|
163 |
+
if ( ! function_exists( 'tinvwl_item_price_woocommerce_product_bundles' ) ) {
|
164 |
|
165 |
/**
|
166 |
* Modify price for WooCommerce Product Bundles
|
171 |
*
|
172 |
* @return string
|
173 |
*/
|
174 |
+
function tinvwl_item_price_woocommerce_product_bundles( $price, $wl_product, $product, $raw = false ) {
|
175 |
+
if ( is_object( $product ) && $product->is_type( 'bundle' ) ) {
|
|
|
176 |
|
177 |
+
$bundle_price = $product->get_price();
|
178 |
+
$product_id = WC_PB_Core_Compatibility::get_id( $product );
|
179 |
$bundled_items = $product->get_bundled_items();
|
180 |
|
181 |
+
if ( ! empty( $bundled_items ) ) {
|
182 |
|
183 |
$bundled_items_price = 0.0;
|
184 |
|
185 |
+
foreach ( $bundled_items as $bundled_item_id => $bundled_item ) {
|
186 |
|
187 |
+
$bundled_item_variation_id_request_key = apply_filters( 'woocommerce_product_bundle_field_prefix', '', $product_id ) . 'bundle_variation_id_' . $bundled_item_id;
|
188 |
+
$bundled_variation_id = absint( isset( $wl_product['meta'][ $bundled_item_variation_id_request_key ] ) ? $wl_product['meta'][ $bundled_item_variation_id_request_key ] : 0 );
|
189 |
+
if ( ! empty( $bundled_variation_id ) ) {
|
190 |
+
$_bundled_product = wc_get_product( $bundled_variation_id );
|
191 |
} else {
|
192 |
$_bundled_product = $bundled_item->product;
|
193 |
}
|
194 |
|
195 |
$is_optional = $bundled_item->is_optional();
|
196 |
|
197 |
+
$bundled_item_quantity_request_key = apply_filters( 'woocommerce_product_bundle_field_prefix', '', $product_id ) . 'bundle_quantity_' . $bundled_item_id;
|
198 |
+
$bundled_product_qty = isset( $wl_product['meta'][ $bundled_item_quantity_request_key ] ) ? absint( $wl_product['meta'][ $bundled_item_quantity_request_key ] ) : $bundled_item->get_quantity();
|
199 |
|
200 |
+
if ( $is_optional ) {
|
201 |
|
202 |
/** Documented in method 'get_posted_bundle_configuration'. */
|
203 |
+
$bundled_item_selected_request_key = apply_filters( 'woocommerce_product_bundle_field_prefix', '', $product_id ) . 'bundle_selected_optional_' . $bundled_item_id;
|
204 |
|
205 |
+
if ( ! array_key_exists( $bundled_item_selected_request_key, $wl_product['meta'] ) ) {
|
206 |
$bundled_product_qty = 0;
|
207 |
}
|
208 |
}
|
209 |
|
210 |
+
if ( $bundled_item->is_priced_individually() ) {
|
211 |
$product_price = $_bundled_product->get_price();
|
212 |
|
213 |
+
$discount = $bundled_item->get_discount();
|
214 |
+
$product_price = empty( $discount ) ? $product_price : WC_PB_Product_Prices::get_discounted_price( $product_price, $discount );
|
215 |
|
216 |
+
$bundled_item_price = (double) $product_price * (int) $bundled_product_qty;
|
217 |
|
218 |
+
$bundled_items_price += (double) $bundled_item_price;
|
219 |
}
|
220 |
|
221 |
} // End foreach().
|
222 |
+
$price = (double) $bundle_price + $bundled_items_price;
|
223 |
+
if ( ! $raw ) {
|
224 |
+
$price = apply_filters( 'woocommerce_get_price_html', wc_price( $price ), $product );
|
225 |
}
|
226 |
} // End if().
|
227 |
} // End if().
|
229 |
return $price;
|
230 |
}
|
231 |
|
232 |
+
add_filter( 'tinvwl_wishlist_item_price', 'tinvwl_item_price_woocommerce_product_bundles', 10, 3 );
|
233 |
} // End if().
|
languages/ti-woocommerce-wishlist.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
# Copyright (C) 2022 TI WooCommerce Wishlist Plugin - 1.
|
2 |
-
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -11,7 +11,7 @@ msgstr ""
|
|
11 |
"Language-Team: TemplateInvaders (https://templateinvaders.com/)\n"
|
12 |
"Last-Translator: TemplateInvaders (https://templateinvaders.com/)\n"
|
13 |
"MIME-Version: 1.0\n"
|
14 |
-
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.
|
15 |
"Report-Msgid-Bugs-To: https://templateinvaders.com/help/\n"
|
16 |
"X-Poedit-Basepath: ..\n"
|
17 |
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
|
@@ -1156,7 +1156,7 @@ msgstr ""
|
|
1156 |
msgid "Custom Title"
|
1157 |
msgstr ""
|
1158 |
|
1159 |
-
#: integrations/woo-product-bundle.php:115, integrations/woocommerce-composite-products.php:142, integrations/woocommerce-mix-and-match-products.php:112, integrations/woocommerce-product-bundles.php:
|
1160 |
msgid "In stock"
|
1161 |
msgstr ""
|
1162 |
|
@@ -1301,23 +1301,23 @@ msgstr[1] ""
|
|
1301 |
msgid "Facebook"
|
1302 |
msgstr ""
|
1303 |
|
1304 |
-
#: public/wishlist/social.class.php:
|
1305 |
msgid "Twitter"
|
1306 |
msgstr ""
|
1307 |
|
1308 |
-
#: public/wishlist/social.class.php:
|
1309 |
msgid "Pinterest"
|
1310 |
msgstr ""
|
1311 |
|
1312 |
-
#: public/wishlist/social.class.php:
|
1313 |
msgid "Email"
|
1314 |
msgstr ""
|
1315 |
|
1316 |
-
#: public/wishlist/social.class.php:
|
1317 |
msgid "Clipboard"
|
1318 |
msgstr ""
|
1319 |
|
1320 |
-
#: public/wishlist/social.class.php:
|
1321 |
msgid "WhatsApp"
|
1322 |
msgstr ""
|
1323 |
|
1 |
+
# Copyright (C) 2022 TI WooCommerce Wishlist Plugin - 1.43.0
|
2 |
+
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.43.0 package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.43.0\n"
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"Language-Team: TemplateInvaders (https://templateinvaders.com/)\n"
|
12 |
"Last-Translator: TemplateInvaders (https://templateinvaders.com/)\n"
|
13 |
"MIME-Version: 1.0\n"
|
14 |
+
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.43.0\n"
|
15 |
"Report-Msgid-Bugs-To: https://templateinvaders.com/help/\n"
|
16 |
"X-Poedit-Basepath: ..\n"
|
17 |
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
|
1156 |
msgid "Custom Title"
|
1157 |
msgstr ""
|
1158 |
|
1159 |
+
#: integrations/woo-product-bundle.php:115, integrations/woocommerce-composite-products.php:142, integrations/woocommerce-mix-and-match-products.php:112, integrations/woocommerce-product-bundles.php:134, integrations/yith-woocommerce-product-bundles.php:165, templates/ti-wishlist-user.php:145, templates/ti-wishlist.php:153
|
1160 |
msgid "In stock"
|
1161 |
msgstr ""
|
1162 |
|
1301 |
msgid "Facebook"
|
1302 |
msgstr ""
|
1303 |
|
1304 |
+
#: public/wishlist/social.class.php:121
|
1305 |
msgid "Twitter"
|
1306 |
msgstr ""
|
1307 |
|
1308 |
+
#: public/wishlist/social.class.php:142
|
1309 |
msgid "Pinterest"
|
1310 |
msgstr ""
|
1311 |
|
1312 |
+
#: public/wishlist/social.class.php:164
|
1313 |
msgid "Email"
|
1314 |
msgstr ""
|
1315 |
|
1316 |
+
#: public/wishlist/social.class.php:185
|
1317 |
msgid "Clipboard"
|
1318 |
msgstr ""
|
1319 |
|
1320 |
+
#: public/wishlist/social.class.php:200
|
1321 |
msgid "WhatsApp"
|
1322 |
msgstr ""
|
1323 |
|
public/wishlist/social.class.php
CHANGED
@@ -104,6 +104,8 @@ class TInvWL_Public_Wishlist_Social {
|
|
104 |
'u' => self::$url,
|
105 |
);
|
106 |
|
|
|
|
|
107 |
return 'https://www.facebook.com/sharer/sharer.php?' . http_build_query( $data );
|
108 |
}
|
109 |
|
@@ -123,6 +125,8 @@ class TInvWL_Public_Wishlist_Social {
|
|
123 |
'url' => self::$url,
|
124 |
);
|
125 |
|
|
|
|
|
126 |
return 'https://twitter.com/share?' . http_build_query( $data );
|
127 |
}
|
128 |
|
@@ -143,6 +147,8 @@ class TInvWL_Public_Wishlist_Social {
|
|
143 |
'media' => self::$image,
|
144 |
);
|
145 |
|
|
|
|
|
146 |
return 'http://pinterest.com/pin/create/button/?' . http_build_query( $data );
|
147 |
}
|
148 |
|
@@ -162,6 +168,8 @@ class TInvWL_Public_Wishlist_Social {
|
|
162 |
'body' => self::$url,
|
163 |
);
|
164 |
|
|
|
|
|
165 |
return 'mailto:?' . http_build_query( $data );
|
166 |
}
|
167 |
|
@@ -196,6 +204,8 @@ class TInvWL_Public_Wishlist_Social {
|
|
196 |
'text' => self::$url,
|
197 |
);
|
198 |
|
|
|
|
|
199 |
return 'https://api.whatsapp.com/send?' . http_build_query( $data );
|
200 |
}
|
201 |
}
|
104 |
'u' => self::$url,
|
105 |
);
|
106 |
|
107 |
+
$data = apply_filters( 'tinvwl_social_link_facebook', $data );
|
108 |
+
|
109 |
return 'https://www.facebook.com/sharer/sharer.php?' . http_build_query( $data );
|
110 |
}
|
111 |
|
125 |
'url' => self::$url,
|
126 |
);
|
127 |
|
128 |
+
$data = apply_filters( 'tinvwl_social_link_twitter', $data );
|
129 |
+
|
130 |
return 'https://twitter.com/share?' . http_build_query( $data );
|
131 |
}
|
132 |
|
147 |
'media' => self::$image,
|
148 |
);
|
149 |
|
150 |
+
$data = apply_filters( 'tinvwl_social_link_pinterest', $data );
|
151 |
+
|
152 |
return 'http://pinterest.com/pin/create/button/?' . http_build_query( $data );
|
153 |
}
|
154 |
|
168 |
'body' => self::$url,
|
169 |
);
|
170 |
|
171 |
+
$data = apply_filters( 'tinvwl_social_link_email', $data );
|
172 |
+
|
173 |
return 'mailto:?' . http_build_query( $data );
|
174 |
}
|
175 |
|
204 |
'text' => self::$url,
|
205 |
);
|
206 |
|
207 |
+
$data = apply_filters( 'tinvwl_social_link_whatsapp', $data );
|
208 |
+
|
209 |
return 'https://api.whatsapp.com/send?' . http_build_query( $data );
|
210 |
}
|
211 |
}
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: templateinvaders
|
|
3 |
Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.9
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
@@ -163,6 +163,14 @@ Yes, you can! Join in on our [GitHub repository](https://github.com/TemplateInva
|
|
163 |
|
164 |
|
165 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
= 1.42.1 =
|
167 |
*Release Date - 04 April 2022*
|
168 |
|
3 |
Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.9
|
6 |
+
Stable tag: 1.43.0
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
163 |
|
164 |
|
165 |
== Changelog ==
|
166 |
+
= 1.43.0 =
|
167 |
+
*Release Date - 24 April 2022*
|
168 |
+
|
169 |
+
* WooCommerce 6.4 support
|
170 |
+
* Added filters for share links
|
171 |
+
* Updated integration with [WooCommerce Gravity Forms Product Add-Ons](https://woocommerce.com/products/gravity-forms-add-ons/?aff=3955) plugin
|
172 |
+
* Added tinvwl_get_wishlist_data() as jQuery public function
|
173 |
+
|
174 |
= 1.42.1 =
|
175 |
*Release Date - 04 April 2022*
|
176 |
|
ti-woocommerce-wishlist.php
CHANGED
@@ -4,11 +4,11 @@
|
|
4 |
* Plugin Name: TI WooCommerce Wishlist
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
-
* Version: 1.
|
8 |
* Requires at least: 4.7
|
9 |
* Tested up to: 5.9
|
10 |
* WC requires at least: 3.0
|
11 |
-
* WC tested up to: 6.
|
12 |
* Author: TemplateInvaders
|
13 |
* Author URI: https://templateinvaders.com/
|
14 |
* License: GPL-2.0+
|
@@ -41,7 +41,7 @@ if (!defined('TINVWL_DOMAIN')) {
|
|
41 |
}
|
42 |
|
43 |
if (!defined('TINVWL_FVERSION')) {
|
44 |
-
define('TINVWL_FVERSION', '1.
|
45 |
}
|
46 |
|
47 |
if (!defined('TINVWL_LOAD_FREE')) {
|
4 |
* Plugin Name: TI WooCommerce Wishlist
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
+
* Version: 1.43.0
|
8 |
* Requires at least: 4.7
|
9 |
* Tested up to: 5.9
|
10 |
* WC requires at least: 3.0
|
11 |
+
* WC tested up to: 6.4
|
12 |
* Author: TemplateInvaders
|
13 |
* Author URI: https://templateinvaders.com/
|
14 |
* License: GPL-2.0+
|
41 |
}
|
42 |
|
43 |
if (!defined('TINVWL_FVERSION')) {
|
44 |
+
define('TINVWL_FVERSION', '1.43.0');
|
45 |
}
|
46 |
|
47 |
if (!defined('TINVWL_LOAD_FREE')) {
|