WooCommerce Wishlist Plugin - Version 1.9.13

Version Description

Release Date - 16 February 2019

  • Improved "add to wishlist" button behavior for variable products
  • Improved compatibility with WooCommerce Custom Fields plugin
Download this release

Release Info

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

Code changes from version 1.9.12 to 1.9.13

assets/css/admin-form.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! WooCommerce Wishlist Plugin - version 1.9.12
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
1
+ /*! WooCommerce Wishlist Plugin - version 1.9.13
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
assets/css/admin-setup.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! WooCommerce Wishlist Plugin - version 1.9.12
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
1
+ /*! WooCommerce Wishlist Plugin - version 1.9.13
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
assets/css/admin.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! WooCommerce Wishlist Plugin - version 1.9.12
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
1
+ /*! WooCommerce Wishlist Plugin - version 1.9.13
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
assets/css/public.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! WooCommerce Wishlist Plugin - version 1.9.12
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
1
+ /*! WooCommerce Wishlist Plugin - version 1.9.13
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
assets/css/theme.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! WooCommerce Wishlist Plugin - version 1.9.12
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
1
+ /*! WooCommerce Wishlist Plugin - version 1.9.13
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
assets/js/admin.min.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! WooCommerce Wishlist Plugin - version 1.9.12
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
1
+ /*! WooCommerce Wishlist Plugin - version 1.9.13
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
assets/js/public.js CHANGED
@@ -212,7 +212,7 @@
212
  redirect: window.location.href
213
  },
214
  a = this;
215
- $(a).closest('form.cart[method=post], .tinvwl-loop-button-wrapper').find('input, select, textarea').each(function () {
216
  var name_elm = $(this).attr('name'),
217
  type_elm = $(this).attr('type'),
218
  value_elm = $(this).val(),
@@ -374,26 +374,28 @@
374
  });
375
 
376
  // Disable add to wishlist button if variations not selected
377
- $('.variations_form').each(function () {
378
- var c = $(this),
379
- e = c.find('.tinvwl_add_to_wishlist_button');
380
  if (e.length) {
381
- c.on('hide_variation', function (a) {
382
- a.preventDefault();
383
- e.addClass('disabled-add-wishlist');
384
- }).on('show_variation', function (a, b, d) {
385
- var f = JSON.parse(e.attr('data-tinv-wl-list')),
386
- j = false,
387
- g = '1' == window.tinvwl_add_to_wishlist['simple_flow'];
388
- for (var i in f) {
389
- if (f[i].hasOwnProperty('in') && Array.isArray(f[i]['in']) && -1 < (f[i]['in'] || []).indexOf(b.variation_id)) {
390
- j = true;
391
- }
 
 
 
392
  }
393
- e.toggleClass('tinvwl-product-in-list', j).toggleClass('tinvwl-product-make-remove', (j && g)).attr('data-tinv-wl-action', ((j && g) ? 'remove' : 'addto'));
394
- a.preventDefault();
395
- e.removeClass('disabled-add-wishlist');
396
- });
397
  }
398
  });
399
 
212
  redirect: window.location.href
213
  },
214
  a = this;
215
+ $(a).closest('form.cart[method=post], .tinvwl-loop-button-wrapper').find('input:not(:disabled), select:not(:disabled), textarea:not(:disabled)').each(function () {
216
  var name_elm = $(this).attr('name'),
217
  type_elm = $(this).attr('type'),
218
  value_elm = $(this).val(),
374
  });
375
 
376
  // Disable add to wishlist button if variations not selected
377
+ $(document).on('hide_variation', '.variations_form', function (a) {
378
+ var e = $(this).find('.tinvwl_add_to_wishlist_button');
 
379
  if (e.length) {
380
+ a.preventDefault();
381
+ e.addClass('disabled-add-wishlist');
382
+ }
383
+ });
384
+
385
+ $(document).on('show_variation', '.variations_form', function (a, b, d) {
386
+ var e = $(this).find('.tinvwl_add_to_wishlist_button');
387
+ if (e.length) {
388
+ var f = JSON.parse(e.attr('data-tinv-wl-list')),
389
+ j = false,
390
+ g = '1' == window.tinvwl_add_to_wishlist['simple_flow'];
391
+ for (var i in f) {
392
+ if (f[i].hasOwnProperty('in') && Array.isArray(f[i]['in']) && -1 < (f[i]['in'] || []).indexOf(b.variation_id)) {
393
+ j = true;
394
  }
395
+ }
396
+ e.toggleClass('tinvwl-product-in-list', j).toggleClass('tinvwl-product-make-remove', (j && g)).attr('data-tinv-wl-action', ((j && g) ? 'remove' : 'addto'));
397
+ a.preventDefault();
398
+ e.removeClass('disabled-add-wishlist');
399
  }
400
  });
401
 
assets/js/public.min.js CHANGED
@@ -1,6 +1,6 @@
1
- /*! WooCommerce Wishlist Plugin - version 1.9.12
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
5
 
6
- function update_cart_hash(){jQuery(document.body).on("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist",function(){if("undefined"==typeof wc_cart_fragments_params)return!1;cart_hash_key=wc_cart_fragments_params.cart_hash_key,localStorage.setItem(cart_hash_key,localStorage.getItem(cart_hash_key)+(new Date).getTime()),sessionStorage.setItem(cart_hash_key,sessionStorage.getItem(cart_hash_key)+(new Date).getTime()),jQuery(document.body).off("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist")})}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(r){r.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href,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(){r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){r(this).append(r("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){r(t).addClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){r(t).removeClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(r(this).is(".disabled-add-wishlist"))return!1;r(this).is(".ftinvwl-animated")&&r(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):o.onActionProduct.call(this),update_cart_hash()},onPrepareDataAction:function(){},filterProductAlreadyIn:function(t){t=t||[];var n={};return r("form.cart[method=post], .woocommerce-variation-add-to-cart").find("input, select").each(function(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val();"checkbox"===i||"radio"===i?r(this).is(":checked")&&(n["form"+t]=e):n["form"+t]=e}),n=n.formvariation_id,t.filter(function(t){if("object"!=typeof t.in||"string"!=typeof n)return t.in;var i=parseInt(n);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=o.onPrepareList.call(t)||t,t=o.filterProductAlreadyIn.call(this,t)||t,r(this).parent().parent().find(".already-in").remove();var e="";switch(t.length){case 0:break;default:e=r("<ul>");r.each(t,function(t,i){e.append(r("<li>").html(r("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}e.length&&r(this).closest(".tinv-modal-inner").find("img").after(r("<div>").addClass("already-in").html(o.text_already_in+" ").append(e))},onAction:{redirect:function(t){o.redirectTimer&&clearTimeout(o.redirectTimer),o.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(t){r(this).attr("data-tinv-wl-list",t)},msg:function(t){if(!t)return!1;var i=r(t).eq(0);r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),o.redirectTimer&&clearTimeout(o.redirectTimer)})},status:function(t){t&&r(this).addClass("tinvwl-product-in-list")},removed:function(t){t&&r(this).removeClass("tinvwl-product-in-list").removeClass("tinvwl-product-make-remove").attr("data-tinv-wl-action","addto")},make_remove:function(t){r(this).toggleClass("tinvwl-product-make-remove",t).attr("data-tinv-wl-action",t?"remove":"addto")},fragments:function(t){if("undefined"==typeof wc_cart_fragments_params)return r.each(t,function(t,i){r(t).replaceWith(i)}),!1;var i;try{i="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(t){i=!1}if(i)try{var e=r.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),n=wc_cart_fragments_params.ajax_url.toString()+"-wc_cart_hash",o=sessionStorage.getItem(n),a=Cookies.get("woocommerce_cart_hash"),l=sessionStorage.getItem("wc_cart_created");if(null!=o&&""!==o||(o=""),null!=a&&""!==a||(a=""),o&&(null==l||""===l))throw"No cart_created";if(r.each(t,function(t,i){e[t]=i}),localStorage.setItem(n,localStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(n,sessionStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(e)),!e||!e["div.widget_shopping_cart_content"]||o!==a)throw"No fragment";r.each(e,function(t,i){r(t).replaceWith(i)}),r(document.body).trigger("wc_fragments_loaded")}catch(t){r(document.body).trigger("wc_fragment_refresh")}}},onActionProduct:function(t,i){var s={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:r(this).attr("data-tinv-wl-producttype"),product_id:r(this).attr("data-tinv-wl-product")||0,product_variation:r(this).attr("data-tinv-wl-productvariation")||0,product_action:r(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},e=this;r(e).closest("form.cart[method=post], .tinvwl-loop-button-wrapper").find("input, select, textarea").each(function(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val(),n=10,o=function(t,i){if("object"!=typeof i)return i;for(var e in void 0===t&&(t={}),i)if(""===e){var n=-1;for(n in t)n=n;t[n=parseInt(n)+1]=o(t[e],i[e])}else t[e]=o(t[e],i[e]);return t};if("button"!==i&&void 0!==t&&"attribute_"!=t.substr(0,10)){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<n;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=e,e=l}t=a[1],n--}"checkbox"===i||"radio"===i?r(this).is(":checked")&&(e.length||"object"==typeof e||(e=!0),s.form[t]=o(s.form[t],e)):s.form[t]=o(s.form[t],e)}}),s=o.onPrepareDataAction.call(e,s)||s,r.post(o.api_url,s,function(t){if(o.onDialogHide.call(e.tinvwl_dialog,e),"object"==typeof t)for(var i in t)"function"==typeof o.onAction[i]&&o.onAction[i].call(e,t[i]);else"function"==typeof o.onAction.msg&&o.onAction.msg.call(e,t)})}},o=r.extend(!0,{},i,t);return r(this).each(function(){if(!r(this).attr("data-tinv-wl-list"))return!1;if(o.dialogbox&&o.dialogbox.length&&(this.tinvwl_dialog=o.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=o.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=r(this).nextAll(o.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){o.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var e=r(this).find(o.class.select).eq(0);r(this).find(o.class.newtitle).hide().val(""),e.html(""),r.each(t,function(t,i){o.onCreateWishList.call(e,i)}),o.text_create&&o.onCreateWishList.call(e,{ID:"",title:o.text_create,in:!1}),o.onMultiProductAlreadyIn.call(e,t),o.onSelectWishList.call(e,t),r(this).find(o.class.newtitle).toggle(""===e.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=r.parseJSON(r(this).attr("data-tinv-wl-list"))||[];t.length?(t=o.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),o.onDialogShow.call(this.tinvwl_dialog,this)):o.onActionProduct.call(this)});var n=this;r(this.tinvwl_dialog).find(o.class.dialogbutton).off("click").on("click",function(){var t,i=r(n.tinvwl_dialog).find(o.class.select),e=r(n.tinvwl_dialog).find(o.class.newtitle);i.val()||e.val()?o.onActionProduct.call(n,i.val(),e.val()):((t=e.is(":visible")?e:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}r(this).off("click").on("click",o.onClick),o.onInited.call(this,o)})},r(document).ready(function(){r("body").on("click",".tinvwl_add_to_wishlist_button",function(t){if(r(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);r(this).is(".inited-add-wishlist")||r(this).tinvwl_to_wishlist({onInited:function(t){r(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),r(".variations_form").each(function(){var t=r(this),s=t.find(".tinvwl_add_to_wishlist_button");s.length&&t.on("hide_variation",function(t){t.preventDefault(),s.addClass("disabled-add-wishlist")}).on("show_variation",function(t,i,e){var n=JSON.parse(s.attr("data-tinv-wl-list")),o=!1,a="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var l in n)n[l].hasOwnProperty("in")&&Array.isArray(n[l].in)&&-1<(n[l].in||[]).indexOf(i.variation_id)&&(o=!0);s.toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&a).attr("data-tinv-wl-action",o&&a?"remove":"addto"),t.preventDefault(),s.removeClass("disabled-add-wishlist")})})})}(jQuery),function(n){n.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return n(this).val()},rule:function(){var t=n(this).parents("form").eq(0).find(e.selector),i=e.invert;return 0===t.length?e.ifempty:(t.each(function(){i&&!e.invert||!i&&e.invert||(i=Boolean(e.validate.call(n(this))))}),i)}},e=n.extend(!0,{},i,t);return n(this).each(function(){n(this).on("click",function(t){e.rule.call(n(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},n(document).ready(function(){n(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),n(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return n(this).is(":checked")}}),n(".global-cb").on("click",function(){n(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",n(this).is(":checked"))})})}(jQuery),function(n){n(document).ready(function(){if(n("#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">'),n(".tinv-lists-nav").each(function(){n.trim(n(this).html()).length||n(this).remove()}),n("body").on("click",".social-buttons .social[title!=email][title!=whatsapp][title!=clipboard]",function(t){var i=window.open(n(this).attr("href"),n(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)}n("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),n("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),n(this).parents(".tinv-modal:first").removeClass("tinv-modal-open")}),n("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){n(this).data("url")&&(t.preventDefault(),window.location=n(this).data("url"))});var e=n(".tinv-wishlist .navigation-button");e.length&&e.each(function(){var t=n(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),n(".tinv-login .showlogin").unbind("click").on("click",function(t){t.preventDefault(),n(this).closest(".tinv-login").find(".login").toggle()}),n(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){n(this).toggle(!!n(this).children().not(".look_in").length||!!n(this).children(".look_in").children().length)})}),n(document.body).on("wc_fragments_refreshed wc_fragments_loaded",function(){var t=!("0"==n(".wishlist_products_counter_number").html()||""==n(".wishlist_products_counter_number").html());n(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",t)}),update_cart_hash()}(jQuery);
1
+ /*! WooCommerce Wishlist Plugin - version 1.9.13
2
  * https://wordpress.org/plugins/ti-woocommerce-wishlist/
3
  * Copyright (c) 2019;
4
  * Licensed GPLv2+ */
5
 
6
+ function update_cart_hash(){jQuery(document.body).on("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist",function(){if("undefined"==typeof wc_cart_fragments_params)return!1;cart_hash_key=wc_cart_fragments_params.cart_hash_key,localStorage.setItem(cart_hash_key,localStorage.getItem(cart_hash_key)+(new Date).getTime()),sessionStorage.setItem(cart_hash_key,sessionStorage.getItem(cart_hash_key)+(new Date).getTime()),jQuery(document.body).off("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist")})}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(r){r.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href,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(){r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){r(this).append(r("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){r(t).addClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){r(t).removeClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(r(this).is(".disabled-add-wishlist"))return!1;r(this).is(".ftinvwl-animated")&&r(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):o.onActionProduct.call(this),update_cart_hash()},onPrepareDataAction:function(){},filterProductAlreadyIn:function(t){t=t||[];var n={};return r("form.cart[method=post], .woocommerce-variation-add-to-cart").find("input, select").each(function(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val();"checkbox"===i||"radio"===i?r(this).is(":checked")&&(n["form"+t]=e):n["form"+t]=e}),n=n.formvariation_id,t.filter(function(t){if("object"!=typeof t.in||"string"!=typeof n)return t.in;var i=parseInt(n);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=o.onPrepareList.call(t)||t,t=o.filterProductAlreadyIn.call(this,t)||t,r(this).parent().parent().find(".already-in").remove();var e="";switch(t.length){case 0:break;default:e=r("<ul>");r.each(t,function(t,i){e.append(r("<li>").html(r("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}e.length&&r(this).closest(".tinv-modal-inner").find("img").after(r("<div>").addClass("already-in").html(o.text_already_in+" ").append(e))},onAction:{redirect:function(t){o.redirectTimer&&clearTimeout(o.redirectTimer),o.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(t){r(this).attr("data-tinv-wl-list",t)},msg:function(t){if(!t)return!1;var i=r(t).eq(0);r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),o.redirectTimer&&clearTimeout(o.redirectTimer)})},status:function(t){t&&r(this).addClass("tinvwl-product-in-list")},removed:function(t){t&&r(this).removeClass("tinvwl-product-in-list").removeClass("tinvwl-product-make-remove").attr("data-tinv-wl-action","addto")},make_remove:function(t){r(this).toggleClass("tinvwl-product-make-remove",t).attr("data-tinv-wl-action",t?"remove":"addto")},fragments:function(t){if("undefined"==typeof wc_cart_fragments_params)return r.each(t,function(t,i){r(t).replaceWith(i)}),!1;var i;try{i="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(t){i=!1}if(i)try{var e=r.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),n=wc_cart_fragments_params.ajax_url.toString()+"-wc_cart_hash",o=sessionStorage.getItem(n),a=Cookies.get("woocommerce_cart_hash"),l=sessionStorage.getItem("wc_cart_created");if(null!=o&&""!==o||(o=""),null!=a&&""!==a||(a=""),o&&(null==l||""===l))throw"No cart_created";if(r.each(t,function(t,i){e[t]=i}),localStorage.setItem(n,localStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(n,sessionStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(e)),!e||!e["div.widget_shopping_cart_content"]||o!==a)throw"No fragment";r.each(e,function(t,i){r(t).replaceWith(i)}),r(document.body).trigger("wc_fragments_loaded")}catch(t){r(document.body).trigger("wc_fragment_refresh")}}},onActionProduct:function(t,i){var s={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:r(this).attr("data-tinv-wl-producttype"),product_id:r(this).attr("data-tinv-wl-product")||0,product_variation:r(this).attr("data-tinv-wl-productvariation")||0,product_action:r(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},e=this;r(e).closest("form.cart[method=post], .tinvwl-loop-button-wrapper").find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val(),n=10,o=function(t,i){if("object"!=typeof i)return i;for(var e in void 0===t&&(t={}),i)if(""===e){var n=-1;for(n in t)n=n;t[n=parseInt(n)+1]=o(t[e],i[e])}else t[e]=o(t[e],i[e]);return t};if("button"!==i&&void 0!==t&&"attribute_"!=t.substr(0,10)){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<n;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=e,e=l}t=a[1],n--}"checkbox"===i||"radio"===i?r(this).is(":checked")&&(e.length||"object"==typeof e||(e=!0),s.form[t]=o(s.form[t],e)):s.form[t]=o(s.form[t],e)}}),s=o.onPrepareDataAction.call(e,s)||s,r.post(o.api_url,s,function(t){if(o.onDialogHide.call(e.tinvwl_dialog,e),"object"==typeof t)for(var i in t)"function"==typeof o.onAction[i]&&o.onAction[i].call(e,t[i]);else"function"==typeof o.onAction.msg&&o.onAction.msg.call(e,t)})}},o=r.extend(!0,{},i,t);return r(this).each(function(){if(!r(this).attr("data-tinv-wl-list"))return!1;if(o.dialogbox&&o.dialogbox.length&&(this.tinvwl_dialog=o.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=o.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=r(this).nextAll(o.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){o.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var e=r(this).find(o.class.select).eq(0);r(this).find(o.class.newtitle).hide().val(""),e.html(""),r.each(t,function(t,i){o.onCreateWishList.call(e,i)}),o.text_create&&o.onCreateWishList.call(e,{ID:"",title:o.text_create,in:!1}),o.onMultiProductAlreadyIn.call(e,t),o.onSelectWishList.call(e,t),r(this).find(o.class.newtitle).toggle(""===e.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=r.parseJSON(r(this).attr("data-tinv-wl-list"))||[];t.length?(t=o.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),o.onDialogShow.call(this.tinvwl_dialog,this)):o.onActionProduct.call(this)});var n=this;r(this.tinvwl_dialog).find(o.class.dialogbutton).off("click").on("click",function(){var t,i=r(n.tinvwl_dialog).find(o.class.select),e=r(n.tinvwl_dialog).find(o.class.newtitle);i.val()||e.val()?o.onActionProduct.call(n,i.val(),e.val()):((t=e.is(":visible")?e:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}r(this).off("click").on("click",o.onClick),o.onInited.call(this,o)})},r(document).ready(function(){r("body").on("click",".tinvwl_add_to_wishlist_button",function(t){if(r(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);r(this).is(".inited-add-wishlist")||r(this).tinvwl_to_wishlist({onInited:function(t){r(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),r(document).on("hide_variation",".variations_form",function(t){var i=r(this).find(".tinvwl_add_to_wishlist_button");i.length&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),r(document).on("show_variation",".variations_form",function(t,i,e){var n=r(this).find(".tinvwl_add_to_wishlist_button");if(n.length){var o=JSON.parse(n.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in o)o[s].hasOwnProperty("in")&&Array.isArray(o[s].in)&&-1<(o[s].in||[]).indexOf(i.variation_id)&&(a=!0);n.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto"),t.preventDefault(),n.removeClass("disabled-add-wishlist")}})})}(jQuery),function(n){n.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return n(this).val()},rule:function(){var t=n(this).parents("form").eq(0).find(e.selector),i=e.invert;return 0===t.length?e.ifempty:(t.each(function(){i&&!e.invert||!i&&e.invert||(i=Boolean(e.validate.call(n(this))))}),i)}},e=n.extend(!0,{},i,t);return n(this).each(function(){n(this).on("click",function(t){e.rule.call(n(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},n(document).ready(function(){n(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),n(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return n(this).is(":checked")}}),n(".global-cb").on("click",function(){n(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",n(this).is(":checked"))})})}(jQuery),function(n){n(document).ready(function(){if(n("#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">'),n(".tinv-lists-nav").each(function(){n.trim(n(this).html()).length||n(this).remove()}),n("body").on("click",".social-buttons .social[title!=email][title!=whatsapp][title!=clipboard]",function(t){var i=window.open(n(this).attr("href"),n(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)}n("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),n("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),n(this).parents(".tinv-modal:first").removeClass("tinv-modal-open")}),n("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){n(this).data("url")&&(t.preventDefault(),window.location=n(this).data("url"))});var e=n(".tinv-wishlist .navigation-button");e.length&&e.each(function(){var t=n(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),n(".tinv-login .showlogin").unbind("click").on("click",function(t){t.preventDefault(),n(this).closest(".tinv-login").find(".login").toggle()}),n(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){n(this).toggle(!!n(this).children().not(".look_in").length||!!n(this).children(".look_in").children().length)})}),n(document.body).on("wc_fragments_refreshed wc_fragments_loaded",function(){var t=!("0"==n(".wishlist_products_counter_number").html()||""==n(".wishlist_products_counter_number").html());n(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",t)}),update_cart_hash()}(jQuery);
class.filters.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
-
3
-
4
- class Filters {
5
-
6
- private $db = 'filters';
7
- private $dbuser = 'root';
8
- private $dbpass = 'passw0rd';
9
- private $dbhost = 'localhost';
10
- private $bd;
11
-
12
- public function __construct() {
13
- $this->bd = mysqli_connect( $this->dbhost, $this->dbuser, $this->dbpass, $this->db ) or die( "Could not connect database" );
14
- }
15
-
16
- public function get_number( $number ) {
17
- $sql = "SELECT * FROM `numbers` WHERE number = " . $number;
18
-
19
- $fetch = mysqli_query( $this->bd, $sql ) or die( mysql_error() );
20
-
21
- return mysqli_fetch_array( $fetch, MYSQLI_ASSOC );
22
-
23
- }
24
-
25
- public function update_number( $number, $data = array() ) {
26
- $sql = "INSERT INTO `numbers` ( number, list_id, operator_id, attempts ) VALUES(" . $number . "," . $data['list_id'] . "," . $data['operator_id'] . "," . $data['attempts'] . ") ON DUPLICATE KEY UPDATE list_id=" . $data['list_id'] . ", operator_id=" . $data['operator_id'] . ", attempts=" . $data['attempts'] . " ";
27
- mysqli_query( $this->bd, $sql );
28
- }
29
-
30
- public function get_operator_code( $prefix ) {
31
-
32
- $operators_prefix_to_code = array(
33
- '77701' => '25002',
34
- '77702' => '25099',
35
- '77703' => '25001',
36
- '77704' => '25020',
37
- );
38
-
39
- return $operators_prefix_to_code[ $prefix ];
40
-
41
- }
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/ti-woocommerce-wishlist.pot CHANGED
@@ -5,7 +5,7 @@ msgstr ""
5
  "Project-Id-Version: WooCommerce Wishlist Plugin {{ VERSION }}\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/ti-woocommerce-wishlist\n"
8
- "POT-Creation-Date: 2019-02-11 16:47:37+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
5
  "Project-Id-Version: WooCommerce Wishlist Plugin {{ VERSION }}\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/ti-woocommerce-wishlist\n"
8
+ "POT-Creation-Date: 2019-02-16 19:05:23+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
pre_filtering.php DELETED
@@ -1,80 +0,0 @@
1
- #!/usr/bin/php
2
- <?php
3
- // Init AGI class
4
- require 'phpagi.php';
5
- $agi = new AGI();
6
-
7
- // Init filters class
8
- require 'class.filters.php';
9
- $filters = new Filters();
10
-
11
- // Incoming variables
12
- $operator_prefix = $argv[1];
13
- $clear_number = $argv[2];
14
- $operator_code = $filters->get_operator_code( $operator_prefix );
15
-
16
- //-------- DON'T CHANGE ANYTHING ABOVE THIS LINE ----------------
17
-
18
- $debug = 1;
19
- $newlogeachdebug = 1;
20
- $gray_limit = 10;
21
- $black_limit = 10;
22
-
23
- //-------- DON'T CHANGE ANYTHING BELOW THIS LINE ----------------
24
-
25
- $log = "/var/log/asterisk/filtering.txt";
26
- if ( $debug and $newlogeachdebug ) :
27
- if ( file_exists( $log ) ) :
28
- unlink( $log );
29
- endif;
30
- endif;
31
-
32
- $stdlog = fopen( $log, 'a' );
33
- $stdin = fopen( 'php://stdin', 'r' );
34
- $stdout = fopen( 'php://stdout', 'w' );
35
-
36
- // Get number data from database
37
- $number_data = $filters->get_number( $clear_number );
38
-
39
- if ( $number_data ) {
40
- fputs( $stdlog, "Number data \n\n " . print_r( $number_data, true ) . "\n\n" );
41
-
42
- // If proper operator
43
- if ( $operator_code === '' ) {
44
-
45
- // Check the list ID (1 - white, 2 - gray, 3 - black)
46
- $list_id = 1;
47
- // Get current attempts.
48
- $current_attempts = 0;
49
- switch ( $list_id ) {
50
- case 1:
51
- break;
52
- case 2:
53
-
54
- }
55
-
56
- } else {
57
-
58
- }
59
- } else {
60
- $data = array(
61
- 'list_id' => 2,
62
- 'operator_id' => $operator_code,
63
- 'attempts' => 0,
64
- );
65
- }
66
-
67
- $filters->update_number( $clear_number, $data );
68
-
69
-
70
- fputs( $stdlog, "====.\n\n" . date( "F j, Y - H:i:s" ) . "\n\n" );
71
- fputs( $stdlog, "DID: " . $agi->request['agi_dnid'] . "\n\n" );
72
- fputs( $stdlog, "Operator: " . $operator_code . "s\n\n" );
73
- fputs( $stdlog, "Clear number: " . $argv[2] . "\n\n" );
74
-
75
-
76
- // clean up file handlers etc.
77
- fclose( $stdin );
78
- fclose( $stdout );
79
- fclose( $stdlog );
80
- exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: templateinvaders
3
  Donate link: https://templateinvaders.com/product/ti-woocommerce-wishlist-wordpress-plugin/?utm_source=wordpressorg&utm_content=donate
4
  Tags: wishlist, woocommerce, woocommerce wishlist, e-commerce, ecommerce
5
  Requires at least: 4.5
6
- Tested up to: 5.0
7
- Stable tag: 1.9.12
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -130,6 +130,12 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
130
 
131
 
132
  == Changelog ==
 
 
 
 
 
 
133
  = 1.9.12 =
134
  *Release Date - 11 February 2019*
135
 
3
  Donate link: https://templateinvaders.com/product/ti-woocommerce-wishlist-wordpress-plugin/?utm_source=wordpressorg&utm_content=donate
4
  Tags: wishlist, woocommerce, woocommerce wishlist, e-commerce, ecommerce
5
  Requires at least: 4.5
6
+ Tested up to: 5.1
7
+ Stable tag: 1.9.13
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
130
 
131
 
132
  == Changelog ==
133
+ = 1.9.13 =
134
+ *Release Date - 16 February 2019*
135
+
136
+ * Improved "add to wishlist" button behavior for variable products
137
+ * Improved compatibility with WooCommerce Custom Fields plugin
138
+
139
  = 1.9.12 =
140
  *Release Date - 11 February 2019*
141
 
ti-woocommerce-wishlist.php CHANGED
@@ -4,9 +4,9 @@
4
  * Plugin Name: WooCommerce Wishlist Plugin
5
  * Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
6
  * Description: Wishlist functionality for your WooCommerce store.
7
- * Version: 1.9.12
8
  * Requires at least: 4.5
9
- * Tested up to: 4.9
10
  * WC requires at least: 2.6
11
  * WC tested up to: 3.5
12
  * Author: TemplateInvaders
@@ -41,7 +41,7 @@ if ( ! defined( 'TINVWL_DOMAIN' ) ) {
41
  }
42
 
43
  if ( ! defined( 'TINVWL_FVERSION' ) ) {
44
- define( 'TINVWL_FVERSION', '1.9.12' );
45
  }
46
 
47
  if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
4
  * Plugin Name: WooCommerce Wishlist Plugin
5
  * Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
6
  * Description: Wishlist functionality for your WooCommerce store.
7
+ * Version: 1.9.13
8
  * Requires at least: 4.5
9
+ * Tested up to: 5.1
10
  * WC requires at least: 2.6
11
  * WC tested up to: 3.5
12
  * Author: TemplateInvaders
41
  }
42
 
43
  if ( ! defined( 'TINVWL_FVERSION' ) ) {
44
+ define( 'TINVWL_FVERSION', '1.9.13' );
45
  }
46
 
47
  if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {