YITH WooCommerce Wishlist - Version 3.0.4

Version Description

  • Released on 19 December 2019 =

  • Tweak: added isset on wishlist data store, to prevent notice

  • Tweak: removed transients for items count, to avoid load on wp-options table

  • Tweak: improved dependencies animation

  • Tweak: restored $atts variable inside template, for better compatibility with themes

  • Tweak: handling for redirect_to param in $_REQUEST for form-handler class

  • Update: plugin framework

  • Fix: default variation not being added to wishlist

  • Fix: add default variation to wishlist when Ajax loading is enabled

  • Fix: count_all_products not retrieving correct number

  • Dev: added yith_wcwl_wishlist_delete_url filter

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Wishlist
Version 3.0.4
Comparing to
See all releases

Code changes from version 3.0.3 to 3.0.4

README.md CHANGED
@@ -72,11 +72,18 @@ We're also working hard to release a developer guide; please, follow our [social
72
 
73
  ## Changelog
74
 
75
- ### 3.0.3 - Released on 12 December 2019
76
-
77
- * Tweak: prevent yith_setcookie to process if cookie name is not set
78
- * Tweak: refactored session class to set up session cookie name on demand, when needed (avoid empty cookie name)
79
- * Tweak: minor improvements to functions that require session (count_products, get_default_wishlist..) as a consequence of changes applied to session class
 
 
 
 
 
 
 
80
 
81
  ## Support
82
 
72
 
73
  ## Changelog
74
 
75
+ ### 3.0.4 - Released on 19 December 2019
76
+
77
+ * Tweak: added isset on wishlist data store, to prevent notice
78
+ * Tweak: removed transients for items count, to avoid load on wp-options table
79
+ * Tweak: improved dependencies animation
80
+ * Tweak: restored $atts variable inside template, for better compatibility with themes
81
+ * Tweak: handling for redirect_to param in $_REQUEST for form-handler class
82
+ * Update: plugin framework
83
+ * Fix: default variation not being added to wishlist
84
+ * Fix: add default variation to wishlist when Ajax loading is enabled
85
+ * Fix: count_all_products not retrieving correct number
86
+ * Dev: added yith_wcwl_wishlist_delete_url filter
87
 
88
  ## Support
89
 
README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: wishlist, woocommerce, products, yit, e-commerce, shop, ecommerce wishlist, yith, woocommerce wishlist, shop wishlist
5
  Requires at least: 4.0
6
  Tested up to: 5.3
7
- Stable tag: 3.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -112,6 +112,19 @@ Yes, of course you can. To avoid Wishlist page to show product prices, you can h
112
 
113
  == Changelog ==
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  = 3.0.3 - Released on 12 December 2019 =
116
 
117
  * Tweak: prevent yith_setcookie to process if cookie name is not set
4
  Tags: wishlist, woocommerce, products, yit, e-commerce, shop, ecommerce wishlist, yith, woocommerce wishlist, shop wishlist
5
  Requires at least: 4.0
6
  Tested up to: 5.3
7
+ Stable tag: 3.0.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
112
 
113
  == Changelog ==
114
 
115
+ = 3.0.4 - Released on 19 December 2019 =
116
+
117
+ * Tweak: added isset on wishlist data store, to prevent notice
118
+ * Tweak: removed transients for items count, to avoid load on wp-options table
119
+ * Tweak: improved dependencies animation
120
+ * Tweak: restored $atts variable inside template, for better compatibility with themes
121
+ * Tweak: handling for redirect_to param in $_REQUEST for form-handler class
122
+ * Update: plugin framework
123
+ * Fix: default variation not being added to wishlist
124
+ * Fix: add default variation to wishlist when Ajax loading is enabled
125
+ * Fix: count_all_products not retrieving correct number
126
+ * Dev: added yith_wcwl_wishlist_delete_url filter
127
+
128
  = 3.0.3 - Released on 12 December 2019 =
129
 
130
  * Tweak: prevent yith_setcookie to process if cookie name is not set
assets/js/admin/yith-wcwl.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(s){s.fn.dependency=function(t,e,n,i){var o=s(this);o.on("change",function(){var c=e(o);s.each(t,function(t,e){var n=s(e);if(n.length){var i=n.closest("tr");i.length&&(c?i.removeClass("yith-disabled"):i.addClass("yith-disabled"))}}),void 0!==n&&n(o,i)}).change()};function n(e,t){var c=this;c.settings={},c.modal=null,c._init=function(){c.settings=s.extend({template:e.data("template"),template_data:{},container:".yith-wcwl-wizard-modal",events:{}},t),"function"==typeof c.settings.events.init&&c.settings.events.init(e,t),c._initOpener()},c._initOpener=function(){e.on("click",function(t){var e=s(this),n=c.settings.template_data;t.preventDefault(),"function"==typeof n&&(n=n(e)),e.WCBackboneModal({template:c.settings.template,variable:n});var i=s(c.settings.container);c._initEditor(i),c._initEnhancedSelect(i),c._initTabs(i),c._initSteps(i),c._initOptions(i,n),c._initEvents(i,c.settings.events)})},c._initEditor=function(t){t.find(".with-editor").each(function(){var n=s(this),t=n.attr("id");tinymce.get(t)&&(restoreTextMode=tinymce.get(t).isHidden(),wp.editor.remove(t)),wp.editor.initialize(t,{tinymce:{wpautop:!0,init_instance_callback:function(e){e.on("Change",function(t){n.val(e.getContent()).change()})}},quicktags:!0,mediaButtons:!0})})},c._initEnhancedSelect=function(t){s(document.body).trigger("wc-enhanced-select-init")},c._initTabs=function(t){t.find(".tabs").on("click","a",function(t){var e=s(this),n=e.closest("ul"),i=n.find("a"),c=n.parent().find(".tab"),o=e.data("target"),_=s(o),a=!1;t.preventDefault(),e.hasClass("active")||(a=!0),i.attr("aria-selected","false").removeClass("active"),e.attr("aria-selected","true").addClass("active"),c.attr("aria-expanded","false").removeClass("active").hide(),_.attr("aria-expanded","true").addClass("active").show(),a&&e.trigger("tabChange")})},c._initOptions=function(i,t){s.each(t,function(t,e){var n=i.find('[name="'+t+'"]');n.length&&e!==n.val()&&(n.is("select")&&!n.find('option[value="'+e+'"]').length?n.append('<option value="'+e+'" selected="selected">'+e+" </option>"):n.val(e))})},c._initSteps=function(i){i.find(".step").hide().first().show(),i.find(".continue-button").on("click",function(t){var e=s(this).closest(".step"),n=e.next(".step");t.preventDefault(),n.length&&c._changeStep(i,e,n)}),i.find(".back-button").on("click",function(t){var e=s(this).closest(".step"),n=e.prev(".step");t.preventDefault(),n.length&&c._changeStep(i,e,n)})},c._initEvents=function(n,t){"function"==typeof c.settings.events.open&&c.settings.events.open(e,n),s.each(t,function(t,e){"init"!==t&&"open"!==t&&("tabChange"===t?n.find(".tabs"):"stepChange"===t?n.find(".step"):n.find(":input")).on(t,function(t){return e(s(this),n,t)})})},c._changeStep=function(o,_,a){_.animate({opacity:0},{duration:200,complete:function(){var t=o.find("article"),e=t.outerWidth(),n=t.outerHeight();t.outerWidth("auto"),t.outerHeight("auto"),_.hide(),a.show();var i=a.outerWidth(),c=a.outerHeight();a.hide(),_.css("opacity",1),t.outerWidth(e),t.outerHeight(n),t.animate({width:i,height:c},{duration:200,complete:function(){a.fadeIn(200)}})}}),a.trigger("stepChange")},c._init()}function i(t,e,n){var i=e.find(".email-preview"),c=e.find("#template").val();o&&o.abort(),o=s.ajax({url:ajaxurl+"?action=preview_promotion_email",data:e.find("form").serialize(),method:"POST",beforeSend:function(){i.block({message:null,overlayCSS:{background:"transparent",opacity:.6}})},complete:function(){i.unblock()},success:function(t){i.removeClass("html plain").addClass(c).html(t)}})}function t(){return{template:"yith-wcwl-promotion-wizard",template_data:function(t){var e;return e=t.hasClass("restore-draft")?t.data("draft"):s.extend(e,{product_id:t.data("product_id"),user_id:t.data("user_id")})},events:{change:i,open:function(t,e,n){e.find("#content_html-tmce").click(),i(0,e)},tabChange:function(t,e,n){e.find("#template").val(t.find(".active").data("template")),i(0,e)},stepChange:function(t,e,n){var i=t.find(".receivers-count"),c=t.find(".show-on-long-queue"),o=c.data("threshold");i.length&&s.ajax({url:ajaxurl+"?action=calculate_promotion_email_receivers",data:e.find("form").serialize(),method:"post",beforeSend:function(){i.css("opacity",.3),c.length&&c.hide()},complete:function(){i.css("opacity",1)},success:function(t){void 0!==t.label&&(i.html(t.label),c.length&&void 0!==t.count&&t.count>o&&c.show())}})}}}}var o=null;s.fn.wizard=function(t){var e=s(this);new n(e,t)},s(".create-promotion").wizard(t()),s(".restore-draft").wizard(t());function e(t){return t.is('input[type="radio"]')||(t=t.find('input[type="radio"]:checked')),"no"===t.val()}function c(t){return t.is(":checked")}var _=s("#yith_wcwl_disable_wishlist_for_unauthenticated_users"),a=s("#yith_wcwl_multi_wishlist_enable"),l=s("#yith_wcwl_enable_multi_wishlist_for_unauthenticated_users"),r=s("#yith_wcwl_modal_enable"),u=s("#yith_wcwl_loop_position"),d=s(".icon-select"),h=s('[name="yith_wcwl_add_to_cart_style"]'),w=s("#yith_wcwl_add_to_cart_icon"),m=s('[name="yith_wcwl_ask_an_estimate_style"]'),f=s("#yith_wcwl_ask_an_estimate_icon"),y=s("#yith_wcwl_enable_share"),p=s("#yith_wcwl_share_fb"),g=s("#yith_wcwl_fb_button_icon"),v=s("#yith_wcwl_share_twitter"),b=s("#yith_wcwl_tw_button_icon"),k=s("#yith_wcwl_share_pinterest"),x=s("#yith_wcwl_pr_button_icon"),C=s("#yith_wcwl_share_email"),S=s("#yith_wcwl_em_button_icon"),z=s("#yith_wcwl_share_whatsapp"),j=s("#yith_wcwl_wa_button_icon"),E=s("#yith_wcwl_show_estimate_button"),H=s("#yith_wcwl_show_additional_info_textarea"),O=s("#yith_wcwl_ask_an_estimate_fields"),W=s("#woocommerce_promotion_mail_settings\\[email_type\\]"),D=s("#woocommerce_yith_wcwl_back_in_stock_settings\\[enabled\\]"),T=s("#woocommerce_yith_wcwl_back_in_stock_settings\\[email_type\\]"),q=s("#woocommerce_yith_wcwl_on_sale_item_settings\\[enabled\\]"),B=s("#woocommerce_yith_wcwl_on_sale_item_settings\\[email_type\\]"),M=s('[id^="type_"]');u.add("select#yith_wcwl_button_position").on("change",function(){var t=s(this);"shortcode"===t.val()?t.parent().next().find(".addon").show():t.parent().next().find(".addon").hide()}).change(),M.on("change",function(){var t=s(this),e=t.val(),n=t.closest(".yith-toggle-content-row").next();"radio"===e||"select"===e?n.removeClass("yith-disabled"):n.addClass("yith-disabled")}).change(),h.on("change",function(){w.change()}),m.on("change",function(){f.change()}),d.each(function(){function t(t){return t.id?s('<span><i class="option-icon fa '+t.element.value.toLowerCase()+'" ></i> '+t.text+"</span>"):t.text}s(this).select2({templateResult:t,templateSelection:t})}),_.dependency(["#yith_wcwl_enable_multi_wishlist_for_unauthenticated_users-yes"],function(){return e(_)&&c(a)},function(){l.change()}),a.dependency(["#yith_wcwl_enable_multi_wishlist_for_unauthenticated_users-yes"],function(){return e(_)&&c(a)},function(){l.change()}),l.dependency(["#yith_wcwl_show_login_notice","#yith_wcwl_login_anchor_text"],function(){return c(a)&&e(_)&&e(l)}),r.dependency(["#yith_wcwl_show_exists_in_a_wishlist"],function(){var t="default"!==r.find(":checked").val();return t||s("#yith_wcwl_show_exists_in_a_wishlist").prop("checked",!0),t}),w.dependency(["#yith_wcwl_add_to_cart_custom_icon"],function(){return"custom"===w.val()&&"button_custom"===h.filter(":checked").val()}),f.dependency(["#yith_wcwl_ask_an_estimate_custom_icon"],function(){return"custom"===f.val()&&"button_custom"===m.filter(":checked").val()}),y.dependency(["#yith_wcwl_share_fb"],c,function(){p.change(),g.change(),v.change(),b.change(),k.change(),x.change(),C.change(),S.change(),z.change(),j.change()}),p.dependency(["#yith_wcwl_fb_button_icon","#yith_wcwl_color_fb_button_background"],function(){return c(p)&&c(y)},function(){g.change()}),g.dependency(["#yith_wcwl_fb_button_custom_icon"],function(){return c(p)&&c(y)&&"custom"===g.val()}),v.dependency(["#yith_wcwl_tw_button_icon","#yith_wcwl_color_tw_button_background"],function(){return c(v)&&c(y)},function(){b.change()}),b.dependency(["#yith_wcwl_tw_button_custom_icon"],function(){return c(v)&&c(y)&&"custom"===b.val()}),k.dependency(["#yith_wcwl_socials_image_url","#yith_wcwl_pr_button_icon","#yith_wcwl_color_pr_button_background"],function(){return c(k)&&c(y)},function(){x.change()}),x.dependency(["#yith_wcwl_pr_button_custom_icon"],function(){return c(k)&&c(y)&&"custom"===x.val()}),C.dependency(["#yith_wcwl_em_button_icon","#yith_wcwl_color_em_button_background"],function(){return c(C)&&c(y)},function(){S.change()}),S.dependency(["#yith_wcwl_em_button_custom_icon"],function(){return c(C)&&c(y)&&"custom"===S.val()}),z.dependency(["#yith_wcwl_wa_button_icon","#yith_wcwl_wa_button_custom_icon","#yith_wcwl_color_wa_button_background"],function(){return c(z)&&c(y)},function(){j.change()}),j.dependency(["#yith_wcwl_wa_button_custom_icon"],function(){return c(z)&&c(y)&&"custom"===j.val()}),v.add(k).dependency(["#yith_wcwl_socials_title","#yith_wcwl_socials_text"],function(){return(c(v)||c(k))&&c(y)}),E.dependency(["#yith_wcwl_show_additional_info_textarea"],c,function(){H.change()}),E.on("change",function(){H.change()}),H.dependency(["#yith_wcwl_additional_info_textarea_label"],function(){return c(E)&&c(H)}),H.on("change",function(){s(this).is(":checked")&&E.is(":checked")?O.removeClass("yith-disabled"):O.addClass("yith-disabled")}),W.dependency(["#woocommerce_promotion_mail_settings\\[content_html\\]"],function(){return"multipart"===W.val()||"html"===W.val()}),W.dependency(["#woocommerce_promotion_mail_settings\\[content_text\\]"],function(){return"multipart"===W.val()||"plain"===W.val()}),D.dependency(["#woocommerce_yith_wcwl_back_in_stock_settings\\[product_exclusions\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[category_exclusions\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[email_type\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[heading\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[subject\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[content_html\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[content_text\\]"],function(){return c(D)},function(){T.change()}),T.dependency(["#woocommerce_yith_wcwl_back_in_stock_settings\\[content_html\\]"],function(){return("multipart"===T.val()||"html"===T.val())&&c(D)}),T.dependency(["#woocommerce_yith_wcwl_back_in_stock_settings\\[content_text\\]"],function(){return("multipart"===T.val()||"plain"===T.val())&&c(D)}),q.dependency(["#woocommerce_yith_wcwl_on_sale_item_settings\\[product_exclusions\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[category_exclusions\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[email_type\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[heading\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[subject\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[content_html\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[content_text\\]"],function(){return c(q)},function(){B.change()}),B.dependency(["#woocommerce_yith_wcwl_on_sale_item_settings\\[content_html\\]"],function(){return("multipart"===B.val()||"html"===B.val())&&c(q)}),B.dependency(["#woocommerce_yith_wcwl_on_sale_item_settings\\[content_text\\]"],function(){return("multipart"===B.val()||"plain"===B.val())&&c(q)}),s(document).on("yith-add-box-button-toggle",function(){var e=s("#new_type"),n=s("#new_options");e.on("change",function(){var t=e.val();"radio"===t||"select"===t?n.closest(".yith-add-box-row").removeClass("yith-disabled"):n.closest(".yith-add-box-row").addClass("yith-disabled")}).change()})});
1
+ jQuery(document).ready(function(s){s.fn.dependency=function(t,e,n,i){var o=s(this);o.on("change",function(){var c=e(o);s.each(t,function(t,e){var n=s(e);if(n.length){var i=n.closest("tr");i.length&&(c?i.show().fadeTo("slow",1):i.is(":visible")?i.fadeTo("slow",0,function(){i.hide()}):i.css("opacity",0).hide())}}),void 0!==n&&n(o,i)}).change()};function n(e,t){var c=this;c.settings={},c.modal=null,c._init=function(){c.settings=s.extend({template:e.data("template"),template_data:{},container:".yith-wcwl-wizard-modal",events:{}},t),"function"==typeof c.settings.events.init&&c.settings.events.init(e,t),c._initOpener()},c._initOpener=function(){e.on("click",function(t){var e=s(this),n=c.settings.template_data;t.preventDefault(),"function"==typeof n&&(n=n(e)),e.WCBackboneModal({template:c.settings.template,variable:n});var i=s(c.settings.container);c._initEditor(i),c._initEnhancedSelect(i),c._initTabs(i),c._initSteps(i),c._initOptions(i,n),c._initEvents(i,c.settings.events)})},c._initEditor=function(t){t.find(".with-editor").each(function(){var n=s(this),t=n.attr("id");tinymce.get(t)&&(restoreTextMode=tinymce.get(t).isHidden(),wp.editor.remove(t)),wp.editor.initialize(t,{tinymce:{wpautop:!0,init_instance_callback:function(e){e.on("Change",function(t){n.val(e.getContent()).change()})}},quicktags:!0,mediaButtons:!0})})},c._initEnhancedSelect=function(t){s(document.body).trigger("wc-enhanced-select-init")},c._initTabs=function(t){t.find(".tabs").on("click","a",function(t){var e=s(this),n=e.closest("ul"),i=n.find("a"),c=n.parent().find(".tab"),o=e.data("target"),_=s(o),a=!1;t.preventDefault(),e.hasClass("active")||(a=!0),i.attr("aria-selected","false").removeClass("active"),e.attr("aria-selected","true").addClass("active"),c.attr("aria-expanded","false").removeClass("active").hide(),_.attr("aria-expanded","true").addClass("active").show(),a&&e.trigger("tabChange")})},c._initOptions=function(i,t){s.each(t,function(t,e){var n=i.find('[name="'+t+'"]');n.length&&e!==n.val()&&(n.is("select")&&!n.find('option[value="'+e+'"]').length?n.append('<option value="'+e+'" selected="selected">'+e+" </option>"):n.val(e))})},c._initSteps=function(i){i.find(".step").hide().first().show(),i.find(".continue-button").on("click",function(t){var e=s(this).closest(".step"),n=e.next(".step");t.preventDefault(),n.length&&c._changeStep(i,e,n)}),i.find(".back-button").on("click",function(t){var e=s(this).closest(".step"),n=e.prev(".step");t.preventDefault(),n.length&&c._changeStep(i,e,n)})},c._initEvents=function(n,t){"function"==typeof c.settings.events.open&&c.settings.events.open(e,n),s.each(t,function(t,e){"init"!==t&&"open"!==t&&("tabChange"===t?n.find(".tabs"):"stepChange"===t?n.find(".step"):n.find(":input")).on(t,function(t){return e(s(this),n,t)})})},c._changeStep=function(o,_,a){_.animate({opacity:0},{duration:200,complete:function(){var t=o.find("article"),e=t.outerWidth(),n=t.outerHeight();t.outerWidth("auto"),t.outerHeight("auto"),_.hide(),a.show();var i=a.outerWidth(),c=a.outerHeight();a.hide(),_.css("opacity",1),t.outerWidth(e),t.outerHeight(n),t.animate({width:i,height:c},{duration:200,complete:function(){a.fadeIn(200)}})}}),a.trigger("stepChange")},c._init()}function i(t,e,n){var i=e.find(".email-preview"),c=e.find("#template").val();o&&o.abort(),o=s.ajax({url:ajaxurl+"?action=preview_promotion_email",data:e.find("form").serialize(),method:"POST",beforeSend:function(){i.block({message:null,overlayCSS:{background:"transparent",opacity:.6}})},complete:function(){i.unblock()},success:function(t){i.removeClass("html plain").addClass(c).html(t)}})}function t(){return{template:"yith-wcwl-promotion-wizard",template_data:function(t){var e;return e=t.hasClass("restore-draft")?t.data("draft"):s.extend(e,{product_id:t.data("product_id"),user_id:t.data("user_id")})},events:{change:i,open:function(t,e,n){e.find("#content_html-tmce").click(),i(0,e)},tabChange:function(t,e,n){e.find("#template").val(t.find(".active").data("template")),i(0,e)},stepChange:function(t,e,n){var i=t.find(".receivers-count"),c=t.find(".show-on-long-queue"),o=c.data("threshold");i.length&&s.ajax({url:ajaxurl+"?action=calculate_promotion_email_receivers",data:e.find("form").serialize(),method:"post",beforeSend:function(){i.css("opacity",.3),c.length&&c.hide()},complete:function(){i.css("opacity",1)},success:function(t){void 0!==t.label&&(i.html(t.label),c.length&&void 0!==t.count&&t.count>o&&c.show())}})}}}}var o=null;s.fn.wizard=function(t){var e=s(this);new n(e,t)},s(".create-promotion").wizard(t()),s(".restore-draft").wizard(t());function e(t){return t.is('input[type="radio"]')||(t=t.find('input[type="radio"]:checked')),"no"===t.val()}function c(t){return t.is(":checked")}var _=s("#yith_wcwl_disable_wishlist_for_unauthenticated_users"),a=s("#yith_wcwl_multi_wishlist_enable"),l=s("#yith_wcwl_enable_multi_wishlist_for_unauthenticated_users"),r=s("#yith_wcwl_modal_enable"),u=s("#yith_wcwl_loop_position"),h=s(".icon-select"),d=s('[name="yith_wcwl_add_to_cart_style"]'),w=s("#yith_wcwl_add_to_cart_icon"),m=s('[name="yith_wcwl_ask_an_estimate_style"]'),f=s("#yith_wcwl_ask_an_estimate_icon"),p=s("#yith_wcwl_enable_share"),y=s("#yith_wcwl_share_fb"),g=s("#yith_wcwl_fb_button_icon"),v=s("#yith_wcwl_share_twitter"),b=s("#yith_wcwl_tw_button_icon"),k=s("#yith_wcwl_share_pinterest"),x=s("#yith_wcwl_pr_button_icon"),C=s("#yith_wcwl_share_email"),S=s("#yith_wcwl_em_button_icon"),T=s("#yith_wcwl_share_whatsapp"),z=s("#yith_wcwl_wa_button_icon"),j=s("#yith_wcwl_show_estimate_button"),E=s("#yith_wcwl_show_additional_info_textarea"),H=s("#yith_wcwl_ask_an_estimate_fields"),O=s("#woocommerce_promotion_mail_settings\\[email_type\\]"),W=s("#woocommerce_yith_wcwl_back_in_stock_settings\\[enabled\\]"),D=s("#woocommerce_yith_wcwl_back_in_stock_settings\\[email_type\\]"),q=s("#woocommerce_yith_wcwl_on_sale_item_settings\\[enabled\\]"),B=s("#woocommerce_yith_wcwl_on_sale_item_settings\\[email_type\\]"),M=s('[id^="type_"]');u.add("select#yith_wcwl_button_position").on("change",function(){var t=s(this);"shortcode"===t.val()?t.parent().next().find(".addon").show():t.parent().next().find(".addon").hide()}).change(),M.on("change",function(){var t=s(this),e=t.val(),n=t.closest(".yith-toggle-content-row").next();"radio"===e||"select"===e?n.show().fadeTo("slow",1):n.is(":visible")?n.fadeTo("slow",0,function(){n.hide()}):n.css("opacity",0).hide()}).change(),d.on("change",function(){w.change()}),m.on("change",function(){f.change()}),h.each(function(){function t(t){return t.id?s('<span><i class="option-icon fa '+t.element.value.toLowerCase()+'" ></i> '+t.text+"</span>"):t.text}s(this).select2({templateResult:t,templateSelection:t})}),_.dependency(["#yith_wcwl_enable_multi_wishlist_for_unauthenticated_users-yes"],function(){return e(_)&&c(a)},function(){l.change()}),a.dependency(["#yith_wcwl_enable_multi_wishlist_for_unauthenticated_users-yes"],function(){return e(_)&&c(a)},function(){l.change()}),l.dependency(["#yith_wcwl_show_login_notice","#yith_wcwl_login_anchor_text"],function(){return c(a)&&e(_)&&e(l)}),r.dependency(["#yith_wcwl_show_exists_in_a_wishlist"],function(){var t="default"!==r.find(":checked").val();return t||s("#yith_wcwl_show_exists_in_a_wishlist").prop("checked",!0),t}),w.dependency(["#yith_wcwl_add_to_cart_custom_icon"],function(){return"custom"===w.val()&&"button_custom"===d.filter(":checked").val()}),f.dependency(["#yith_wcwl_ask_an_estimate_custom_icon"],function(){return"custom"===f.val()&&"button_custom"===m.filter(":checked").val()}),p.dependency(["#yith_wcwl_share_fb"],c,function(){y.change(),g.change(),v.change(),b.change(),k.change(),x.change(),C.change(),S.change(),T.change(),z.change()}),y.dependency(["#yith_wcwl_fb_button_icon","#yith_wcwl_color_fb_button_background"],function(){return c(y)&&c(p)},function(){g.change()}),g.dependency(["#yith_wcwl_fb_button_custom_icon"],function(){return c(y)&&c(p)&&"custom"===g.val()}),v.dependency(["#yith_wcwl_tw_button_icon","#yith_wcwl_color_tw_button_background"],function(){return c(v)&&c(p)},function(){b.change()}),b.dependency(["#yith_wcwl_tw_button_custom_icon"],function(){return c(v)&&c(p)&&"custom"===b.val()}),k.dependency(["#yith_wcwl_socials_image_url","#yith_wcwl_pr_button_icon","#yith_wcwl_color_pr_button_background"],function(){return c(k)&&c(p)},function(){x.change()}),x.dependency(["#yith_wcwl_pr_button_custom_icon"],function(){return c(k)&&c(p)&&"custom"===x.val()}),C.dependency(["#yith_wcwl_em_button_icon","#yith_wcwl_color_em_button_background"],function(){return c(C)&&c(p)},function(){S.change()}),S.dependency(["#yith_wcwl_em_button_custom_icon"],function(){return c(C)&&c(p)&&"custom"===S.val()}),T.dependency(["#yith_wcwl_wa_button_icon","#yith_wcwl_wa_button_custom_icon","#yith_wcwl_color_wa_button_background"],function(){return c(T)&&c(p)},function(){z.change()}),z.dependency(["#yith_wcwl_wa_button_custom_icon"],function(){return c(T)&&c(p)&&"custom"===z.val()}),v.add(k).dependency(["#yith_wcwl_socials_title","#yith_wcwl_socials_text"],function(){return(c(v)||c(k))&&c(p)}),j.dependency(["#yith_wcwl_show_additional_info_textarea"],c,function(){E.change()}),j.on("change",function(){E.change()}),E.dependency(["#yith_wcwl_additional_info_textarea_label"],function(){return c(j)&&c(E)}),E.on("change",function(){s(this).is(":checked")&&j.is(":checked")?H.removeClass("yith-disabled"):H.addClass("yith-disabled")}),O.dependency(["#woocommerce_promotion_mail_settings\\[content_html\\]"],function(){return"multipart"===O.val()||"html"===O.val()}),O.dependency(["#woocommerce_promotion_mail_settings\\[content_text\\]"],function(){return"multipart"===O.val()||"plain"===O.val()}),W.dependency(["#woocommerce_yith_wcwl_back_in_stock_settings\\[product_exclusions\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[category_exclusions\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[email_type\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[heading\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[subject\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[content_html\\]","#woocommerce_yith_wcwl_back_in_stock_settings\\[content_text\\]"],function(){return c(W)},function(){D.change()}),D.dependency(["#woocommerce_yith_wcwl_back_in_stock_settings\\[content_html\\]"],function(){return("multipart"===D.val()||"html"===D.val())&&c(W)}),D.dependency(["#woocommerce_yith_wcwl_back_in_stock_settings\\[content_text\\]"],function(){return("multipart"===D.val()||"plain"===D.val())&&c(W)}),q.dependency(["#woocommerce_yith_wcwl_on_sale_item_settings\\[product_exclusions\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[category_exclusions\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[email_type\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[heading\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[subject\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[content_html\\]","#woocommerce_yith_wcwl_on_sale_item_settings\\[content_text\\]"],function(){return c(q)},function(){B.change()}),B.dependency(["#woocommerce_yith_wcwl_on_sale_item_settings\\[content_html\\]"],function(){return("multipart"===B.val()||"html"===B.val())&&c(q)}),B.dependency(["#woocommerce_yith_wcwl_on_sale_item_settings\\[content_text\\]"],function(){return("multipart"===B.val()||"plain"===B.val())&&c(q)}),s(document).on("yith-add-box-button-toggle",function(){var e=s("#new_type"),n=s("#new_options").closest(".yith-add-box-row");e.on("change",function(){var t=e.val();"radio"===t||"select"===t?n.show().fadeTo("slow",1):n.is(":visible")?n.fadeTo("slow",0,function(){s(this).hide()}):n.css("opacity",0).hide()}).change()})});
assets/js/jquery.yith-wcwl.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(r){function i(){void 0!==r.fn.selectBox&&r("select.selectBox").filter(":visible").not(".enhanced").selectBox().addClass("enhanced")}function e(){if(void 0!==r.prettyPhoto){var t={hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1,overlay_gallery:!1,default_width:500,changepicturecallback:function(){i(),r(".wishlist-select").change(),r(document).trigger("yith_wcwl_popup_opened",[this])},markup:'<div class="pp_pic_holder"><div class="ppt">&nbsp;</div><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content_container"><div class="pp_left"><div class="pp_right"><div class="pp_content"><div class="pp_loaderIcon"></div><div class="pp_fade"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details"><a class="pp_close" href="#">Close</a></div></div></div></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div><div class="pp_overlay yith-wcwl-overlay"></div>'};r('a[data-rel^="prettyPhoto[add_to_wishlist_"]').add('a[data-rel="prettyPhoto[ask_an_estimate]"]').add('a[data-rel="prettyPhoto[create_wishlist]"]').unbind("click").prettyPhoto(t),r('a[data-rel="prettyPhoto[move_to_another_wishlist]"]').on("click",function(){var t=r(this),i=r("#move_to_another_wishlist").find("form"),e=i.find(".row-id"),a=t.closest("[data-row-id]").data("row-id");e.length&&e.remove(),i.append('<input type="hidden" name="row_id" class="row-id" value="'+a+'"/>')}).prettyPhoto(t),new MutationObserver(function(t,i){for(var e in t){var a=t[e];"childList"===a.type&&(void 0!==a.addedNodes&&a.addedNodes.forEach(function(t){t.classList.contains("yith-wcwl-overlay")&&r("body").addClass("yith-wcwl-with-pretty-photo")}),void 0!==a.removedNodes&&a.removedNodes.forEach(function(t){t.classList.contains("yith-wcwl-overlay")&&r("body").removeClass("yith-wcwl-with-pretty-photo")}))}}).observe(document.body,{childList:!0})}}function a(){r(".wishlist_table").find('.product-checkbox input[type="checkbox"]').off("change").on("change",function(){var t=r(this);t.parent().removeClass("checked").removeClass("unchecked").addClass(t.is(":checked")?"checked":"unchecked")}).trigger("change")}function o(){r(".add_to_cart").filter("[data-icon]").not(".icon-added").each(function(){var t,i=r(this),e=i.data("icon");t=e.match(/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi)?r("<img/>",{src:e}):r("<i/>",{class:"fa "+e}),i.prepend(t).addClass("icon-added")})}function h(){i(),e(),a(),o(),d(),n(),_(),l(),c(),r(document).trigger("yith_wcwl_init_after_ajax")}function n(){yith_wcwl_l10n.enable_tooltip&&r(".yith-wcwl-add-to-wishlist").find("[data-title]").each(function(){var t=r(this);t.hasClass("tooltip-added")||(t.on("mouseenter",function(){var t,i=r(this),e=null,a=i.outerWidth(),o=0;e=r("<span>",{class:"yith-wcwl-tooltip",text:i.data("title")}),i.append(e),t=e.outerWidth()+6,e.outerWidth(t),o=(a-t)/2,e.css({left:o.toFixed(0)+"px"}).fadeIn(200),i.addClass("with-tooltip")}).on("mouseleave",function(){var t=r(this);t.find(".yith-wcwl-tooltip").fadeOut(200,function(){t.removeClass("with-tooltip").find(".yith-wcwl-tooltip").remove()})}),t.addClass("tooltip-added"))})}function d(){r(".yith-wcwl-add-button").filter(".with-dropdown").on("mouseleave",function(){var t=r(this).find(".yith-wcwl-dropdown");t.length&&t.fadeOut(200)}).children("a").on("mouseenter",function(){var t=r(this).closest(".with-dropdown"),i=t.find(".yith-wcwl-dropdown");i.length&&i.children().length&&t.find(".yith-wcwl-dropdown").fadeIn(200)})}function l(){void 0!==yith_wcwl_l10n.enable_drag_n_drop&&yith_wcwl_l10n.enable_drag_n_drop&&r(".wishlist_table").each(function(){var e=r(this),a=!1;e.sortable({items:"[data-row-id]",helper:function(t,i){return i.children().each(function(){r(this).width(r(this).width())}),i},update:function(){var t=e.find("[data-row-id]"),i=[];t.length&&(a&&a.abort(),t.each(function(){var t=r(this);i.push(t.data("row-id"))}),a=r.ajax({data:{action:yith_wcwl_l10n.actions.sort_wishlist_items,positions:i,wishlist_token:e.data("token"),page:e.data("page"),per_page:e.data("per-page")},method:"POST",url:yith_wcwl_l10n.ajax_url}))}})})}function c(){r(".copy-trigger").on("click",function(){var t=r(".copy-target");if(0<t.length)if(t.is("input"))s()?t[0].setSelectionRange(0,9999):t.select(),document.execCommand("copy");else{var i=r("<input/>",{val:t.text(),type:"text"});b("body").append(i),s()?i[0].setSelectionRange(0,9999):i.select(),document.execCommand("copy"),i.remove()}})}function _(){r(".wishlist_table").filter(".images_grid").not(".enhanced").on("click","[data-row-id] .product-thumbnail a",function(t){var i=r(this).closest("[data-row-id]"),e=i.siblings("[data-row-id]"),a=i.find(".item-details");t.preventDefault(),a.length&&(e.removeClass("show"),i.toggleClass("show"))}).on("click","[data-row-id] a.close",function(t){var i=r(this).closest("[data-row-id]"),e=i.find(".item-details");t.preventDefault(),e.length&&i.removeClass("show")}).on("click","[data-row-id] a.remove_from_wishlist",function(t){var i=r(this);return t.stopPropagation(),f(i),!1}).addClass("enhanced"),r(document).on("click",function(t){r(t.target).closest("[data-row-id]").length||r(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")}).on("added_to_cart",function(){r(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")})}function w(i,t,e){i.action=yith_wcwl_l10n.actions.move_to_another_wishlist_action,""!==i.wishlist_token&&""!==i.destination_wishlist_token&&""!==i.item_id&&r.ajax({beforeSend:t,url:yith_wcwl_l10n.ajax_url,data:i,dataType:"json",method:"post",success:function(t){e(t),h(),r("body").trigger("moved_to_another_wishlist",[r(this),i.item_id])}})}function f(i){var t=i.parents(".cart.wishlist_table"),e=i.parents("[data-row-id]"),a=e.data("row-id"),o=t.data("id"),n=t.data("token"),s={action:yith_wcwl_l10n.actions.remove_from_wishlist_action,remove_from_wishlist:a,wishlist_id:o,wishlist_token:n,fragments:C(a)};r.ajax({beforeSend:function(){y(t)},complete:function(){k(t)},data:s,method:"post",success:function(t){void 0!==t.fragments&&j(t.fragments),h(),r("body").trigger("removed_from_wishlist",[i,e])},url:yith_wcwl_l10n.ajax_url})}function p(t){var i=r(this),e=i.closest(".wishlist_table"),a=null;t.preventDefault(),(a=e.length?i.closest("[data-wishlist-id]").find(".wishlist-title"):i.parents(".wishlist-title")).next().show(),a.hide()}function u(t){var i=r(this);t.preventDefault(),i.parents(".hidden-title-form").hide(),i.parents(".hidden-title-form").prev().show()}function m(t){if(void 0!==r.prettyPhoto&&void 0!==r.prettyPhoto.close)if(void 0!==t){var i=r(".pp_content_container"),e=i.find(".pp_content"),a=i.find(".yith-wcwl-popup-form"),o=a.closest(".pp_pic_holder");if(a.length){var n=r("<div/>",{class:"yith-wcwl-popup-feedback"});n.append(r("<i/>",{class:"fa fa-check heading-icon"})),n.append(r("<p/>",{class:"feedback",html:t})),n.css("display","none"),e.css("height","auto"),a.after(n),a.fadeOut(200,function(){n.fadeIn()}),o.addClass("feedback"),o.css("left",r(window).innerWidth()/2-o.outerWidth()/2+"px"),setTimeout(m,3e3)}}else try{r.prettyPhoto.close()}catch(t){}}function v(t){var i=r("#yith-wcwl-popup-message"),e=r("#yith-wcwl-message");yith_wcwl_l10n.enable_notices&&(e.html(t),i.css("margin-left","-"+r(i).width()+"px").fadeIn(),window.setTimeout(function(){i.fadeOut()},2e3))}function g(n){var t=r("select.wishlist-select"),i=r("ul.yith-wcwl-dropdown");t.each(function(){var e=r(this),t=e.find("option"),i=t.filter('[value="new"]');t.not(i).remove(),r.each(n,function(t,i){r("<option>",{value:i.id,html:i.wishlist_name}).appendTo(e)}),e.append(i)}),i.each(function(){var e=r(this),t=e.find("li"),i=e.closest(".yith-wcwl-add-button").children("a.add_to_wishlist"),a=i.data("product-id"),o=i.data("product-type");t.remove(),r.each(n,function(t,i){r("<li>").append(r("<a>",{rel:"nofollow",html:i.wishlist_name,class:"add_to_wishlist",href:i.add_to_this_wishlist_url,"data-product-id":a,"data-product-type":o,"data-wishlist-id":i.id})).appendTo(e)})})}function y(t){void 0!==r.fn.block&&t.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"40px 40px",opacity:1}})}function k(t){void 0!==r.fn.unblock&&t.stop(!0).css("opacity","1").unblock()}function x(){if(navigator.cookieEnabled)return!0;document.cookie="cookietest=1";var t=-1!==document.cookie.indexOf("cookietest=");return document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}function C(t){var e={},i=r(".wishlist-fragment");return t&&("object"==typeof t?((t=r.extend({s:"",firstLoad:!1},t)).s&&(i=i.not("[data-fragment-ref]").add(i.filter('[data-fragment-ref="'+t.s+'"]'))),t.firstLoad&&(i=i.filter(".on-first-load"))):"string"!=typeof t&&"number"!=typeof t||(i=i.not("[data-fragment-ref]").add(i.filter('[data-fragment-ref="'+t+'"]')))),i.each(function(){var t=r(this),i=t.attr("class");e[i]=t.data("fragment-options")}),e}function j(t){r.each(t,function(t,i){var e="."+t.split(" ").filter(function(t){return t.length&&"exists"!==t}).join("."),a=r(e),o=r(i).filter(e);o.length||(o=r(i).find(e)),a.length&&o.length&&a.replaceWith(o)})}function s(){return navigator.userAgent.match(/ipad|iphone/i)}r(document).on("yith_wcwl_init",function(){var t=r(this),s="undefined"!=typeof wc_add_to_cart_params&&null!==wc_add_to_cart_params?wc_add_to_cart_params.cart_redirect_after_add:"";t.on("click",".add_to_wishlist",function(t){var a=r(this),i=a.data("product-id"),o=r(".add-to-wishlist-"+i),e={add_to_wishlist:i,product_type:a.data("product-type"),wishlist_id:a.data("wishlist-id"),action:yith_wcwl_l10n.actions.add_to_wishlist_action,fragments:C(i)};if(t.preventDefault(),jQuery(document.body).trigger("adding_to_wishlist"),yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.modal_enable){var n=a.parents(".yith-wcwl-popup-footer").prev(".yith-wcwl-popup-content"),s=n.find(".wishlist-select"),d=n.find(".wishlist-name"),l=n.find(".wishlist-visibility").filter(":checked");if(e.wishlist_id=s.is(":visible")?s.val():"new",e.wishlist_name=d.val(),e.wishlist_visibility=l.val(),"new"===e.wishlist_id&&!e.wishlist_name)return d.closest("p").addClass("woocommerce-invalid"),!1;d.closest("p").removeClass("woocommerce-invalid")}if(x())return r.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",beforeSend:function(){y(a)},complete:function(){k(a)},success:function(t){var i=t.result,e=t.message;yith_wcwl_l10n.multi_wishlist?(m(e),void 0!==t.user_wishlists&&g(t.user_wishlists)):v(e),"true"!==i&&"exists"!==i||(void 0!==t.fragments&&j(t.fragments),yith_wcwl_l10n.multi_wishlist&&!yith_wcwl_l10n.hide_add_button||o.find(".yith-wcwl-add-button").remove(),o.addClass("exists")),h(),r("body").trigger("added_to_wishlist",[a,o])}}),!1;alert(yith_wcwl_l10n.labels.cookie_disabled)}),t.on("click",".wishlist_table .remove_from_wishlist",function(t){var i=r(this);return t.preventDefault(),f(i),!1}),t.on("adding_to_cart","body",function(t,i,e){void 0!==i&&void 0!==e&&i.closest(".wishlist_table").length&&(e.remove_from_wishlist_after_add_to_cart=i.closest("[data-row-id]").data("row-id"),e.wishlist_id=i.closest(".wishlist_table").data("id"),"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=yith_wcwl_l10n.redirect_to_cart),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=yith_wcwl_l10n.redirect_to_cart))}),t.on("added_to_cart","body",function(t,i,e,a){if(void 0!==a&&a.closest(".wishlist_table").length){"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=s),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=s);var o=a.closest("[data-row-id]"),n=o.closest(".wishlist-fragment").data("fragment-options");a.removeClass("added"),o.find(".added_to_cart").remove(),yith_wcwl_l10n.remove_from_wishlist_after_add_to_cart&&n.is_user_owner&&o.remove()}}),t.on("added_to_cart","body",function(){var t=r(".woocommerce-message");0===t.length?r("#yith-wcwl-form").prepend(yith_wcwl_l10n.labels.added_to_cart_message):t.fadeOut(300,function(){r(this).replaceWith(yith_wcwl_l10n.labels.added_to_cart_message).fadeIn()})}),t.on("cart_page_refreshed","body",h),t.on("click",".show-title-form",p),t.on("click",".wishlist-title-with-form h2",p),t.on("click",".remove_from_all_wishlists",function(t){var i=r(this),e=i.data("product-id"),a=i.data("wishlist-id"),o=i.closest(".content"),n={action:yith_wcwl_l10n.actions.remove_from_all_wishlists,prod_id:e,wishlist_id:a,fragments:C(e)};t.preventDefault(),r.ajax({beforeSend:function(){y(o)},complete:function(){k(o)},data:n,dataType:"json",method:"post",success:function(t){void 0!==t.fragments&&j(t.fragments),h()},url:yith_wcwl_l10n.ajax_url})}),t.on("click",".hide-title-form",u),t.on("change",".change-wishlist",function(){var t=r(this),i=t.parents(".cart.wishlist_table"),e=i.data("token"),a=t.parents("[data-row-id]").data("row-id");w({wishlist_token:e,destination_wishlist_token:t.val(),item_id:a,fragments:C()},function(){y(i)},function(t){void 0!==t.fragments&&j(t.fragments),k(i)})}),t.on("click",".yith-wcwl-popup-footer .move_to_wishlist",function(){var e=r(this),t=e.data("product-id"),i=e.data("origin-wishlist-id"),a=e.closest("form"),o=a.find(".wishlist-select").val(),n=a.find(".wishlist-name"),s=n.val(),d=a.find(".wishlist-visibility").filter(":checked").val();if("new"===o&&!s)return n.closest("p").addClass("woocommerce-invalid"),!1;n.closest("p").removeClass("woocommerce-invalid"),w({wishlist_token:i,destination_wishlist_token:o,item_id:t,wishlist_name:s,wishlist_visibility:d,fragments:C(t)},function(){y(e)},function(t){var i=t.message;yith_wcwl_l10n.multi_wishlist?(m(i),void 0!==t.user_wishlists&&g(t.user_wishlists)):v(i),void 0!==t.fragments&&j(t.fragments),h(),k(e)})}),t.on("click",".delete_item",function(){var a=r(this),t=a.data("product-id"),i=a.data("item-id"),o=r(".add-to-wishlist-"+t);return r.ajax({url:yith_wcwl_l10n.ajax_url,data:{action:yith_wcwl_l10n.actions.delete_item_action,item_id:i,fragments:C(t)},dataType:"json",beforeSend:function(){y(a)},complete:function(){k(a)},method:"post",success:function(t){var i=t.fragments,e=t.message;yith_wcwl_l10n.multi_wishlist&&m(e),a.closest(".yith-wcwl-remove-button").length||v(e),void 0!==i&&j(i),h(),r("body").trigger("removed_from_wishlist",[a,o])}}),!1}),t.on("change",".yith-wcwl-popup-content .wishlist-select",function(){var t=r(this);"new"===t.val()?t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").show():t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").hide()}),t.on("change","#bulk_add_to_cart",function(){var t=r(this),i=t.closest(".wishlist_table").find("[data-row-id]").find('input[type="checkbox"]:not(:disabled)');t.is(":checked")?i.attr("checked","checked").change():i.removeAttr("checked").change()}),t.on("submit",".wishlist-ask-an-estimate-popup",function(){var t=r(this),e=t.closest("form"),a=t.closest(".pp_content"),i=e.serialize();return r.ajax({beforeSend:function(){y(e)},complete:function(){k(e)},data:i+"&action="+yith_wcwl_l10n.actions.ask_an_estimate,dataType:"json",method:"post",success:function(t){if(void 0!==t.result&&t.result){var i=t.template;void 0!==i&&(e.replaceWith(i),a.css("height","auto"),setTimeout(m,3e3))}else void 0!==t.message&&(e.find(".woocommerce-error").remove(),e.find(".popup-description").after(r("<div>",{text:t.message,class:"woocommerce-error"})))},url:yith_wcwl_l10n.ajax_url}),!1}),t.on("click",".yith-wfbt-add-wishlist",function(t){t.preventDefault();var i=r(this),e=r("#yith-wcwl-form");r("html, body").animate({scrollTop:e.offset().top},500),function(t,e){var i=t.data("product-id"),a=r(document).find(".cart.wishlist_table"),o=a.data("pagination"),n=a.data("per-page"),s=a.data("id"),d=a.data("token"),l={action:yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,pagination:o,per_page:n,wishlist_id:s,wishlist_token:d,add_to_wishlist:i,product_type:t.data("product-type")};if(!x())return alert(yith_wcwl_l10n.labels.cookie_disabled);r.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:l,dataType:"html",beforeSend:function(){y(a)},complete:function(){k(a)},success:function(t){var i=r(t).find("#yith-wcwl-form");e.replaceWith(i),h()}})}(i,e)}),t.on("submit",".yith-wcwl-popup-form",function(){return!1}),t.on("yith_infs_added_elem",function(){e()}),t.on("found_variation",function(t,i){var a=r(t.target).data("product_id"),o=i.variation_id,e=r('.add_to_wishlist[data-product-id="'+a+'"]').add('.add_to_wishlist[data-original-product-id="'+a+'"]');a&&o&&e.length&&e.each(function(){var t,i=r(this),e=i.closest(".yith-wcwl-add-to-wishlist");i.data("original-product-id",a),i.data("product-id",o),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=o,e.data("fragment-options",t)),e.removeClass(function(t,i){return i.match(/add-to-wishlist-\S+/g).join(" ")}).addClass("add-to-wishlist-"+o).attr("data-fragment-ref",o))})}),t.on("reset_data",function(t){var o=r(t.target).data("product_id"),i=r('.add_to_wishlist[data-original-product-id="'+o+'"]');o&&i.length&&i.each(function(){var t,i=r(this),e=i.closest(".yith-wcwl-add-to-wishlist"),a=i.data("product-id");i.data("product-id",o),i.data("original-product-id",""),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=o,e.data("fragment-options",t)),e.removeClass("add-to-wishlist-"+a).addClass("add-to-wishlist-"+o).attr("data-fragment-ref",o))})}),function(){if(!yith_wcwl_l10n.enable_notices)return;if(r(".yith-wcwl-add-to-wishlist").length&&!r("#yith-wcwl-popup-message").length){var t=r("<div>").attr("id","yith-wcwl-message"),i=r("<div>").attr("id","yith-wcwl-popup-message").html(t).hide();r("body").prepend(i)}}(),n(),d(),l(),function(){var n,s;r(".wishlist_table").on("change",".product-quantity input",function(){var t=r(this),i=t.closest("[data-row-id]"),e=i.data("row-id"),a=t.closest(".wishlist_table"),o=a.data("token");clearTimeout(s),i.find(".add_to_cart").data("quantity",t.val()),s=setTimeout(function(){n&&n.abort(),n=r.ajax({beforeSend:function(){y(a)},complete:function(){k(a)},data:{product_id:e,wishlist_token:o,quantity:t.val(),action:yith_wcwl_l10n.actions.update_item_quantity},method:"POST",url:yith_wcwl_l10n.ajax_url})},1e3)})}(),_(),r(document).on("click",".show-tab",function(t){var i=r(this),e=i.closest(".yith-wcwl-popup-content"),a=i.data("tab"),o=e.find(".tab").filter("."+a);if(t.preventDefault(),!o.length)return!1;i.addClass("active").siblings(".show-tab").removeClass("active"),o.show().siblings(".tab").hide(),"create"===a?e.prepend('<input type="hidden" id="new_wishlist_selector" class="wishlist-select" value="new">'):e.find("#new_wishlist_selector").remove()}),r(document).on("change",".wishlist-select",function(t){var i=r(this),e=i.closest(".yith-wcwl-popup-content"),a=i.closest(".tab"),o=e.find(".tab.create"),n=e.find(".show-tab"),s=n.filter('[data-tab="create"]');"new"===i.val()&&o.length&&(a.hide(),o.show(),n.removeClass("active"),s.addClass("active"),i.find("option").removeProp("selected"),i.change())}),i(),a(),e(),o(),function(){var c=!1;r(window).on("resize",function(t){var i=r(".wishlist_table.responsive"),e=i.is(".mobile"),a=window.matchMedia("(max-width: 768px)"),o=i.closest("form"),n=o.attr("class"),s=o.data("fragment-options"),d={},l=!1;i.length&&(a.matches&&i&&!e?(s.is_mobile="yes",l=!0):!a.matches&&i&&e&&(s.is_mobile="no",l=!0),l&&(c&&c.abort(),d[n]=s,c=r.ajax({beforeSend:function(){y(i)},complete:function(){k(i)},data:{action:yith_wcwl_l10n.actions.load_mobile_action,fragments:d},method:"post",success:function(t){void 0!==t.fragments&&(j(t.fragments),h(),r(document).trigger("yith_wcwl_responsive_template",[e,t.fragments]))},url:yith_wcwl_l10n.ajax_url})))})}(),c(),function(){if(!yith_wcwl_l10n.enable_ajax_loading)return;var i=C({firstLoad:!0});if(!i)return;r.ajax({data:{action:yith_wcwl_l10n.actions.load_fragments,fragments:i},method:"post",success:function(t){void 0!==t.fragments&&(j(t.fragments),h(),r(document).trigger("yith_wcwl_fragments_loaded",[i,t.fragments]))},url:yith_wcwl_l10n.ajax_url})}()}).trigger("yith_wcwl_init")});
1
+ jQuery(document).ready(function(r){function i(){void 0!==r.fn.selectBox&&r("select.selectBox").filter(":visible").not(".enhanced").selectBox().addClass("enhanced")}function e(){if(void 0!==r.prettyPhoto){var t={hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1,overlay_gallery:!1,default_width:500,changepicturecallback:function(){i(),r(".wishlist-select").change(),r(document).trigger("yith_wcwl_popup_opened",[this])},markup:'<div class="pp_pic_holder"><div class="ppt">&nbsp;</div><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content_container"><div class="pp_left"><div class="pp_right"><div class="pp_content"><div class="pp_loaderIcon"></div><div class="pp_fade"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details"><a class="pp_close" href="#">Close</a></div></div></div></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div><div class="pp_overlay yith-wcwl-overlay"></div>'};r('a[data-rel^="prettyPhoto[add_to_wishlist_"]').add('a[data-rel="prettyPhoto[ask_an_estimate]"]').add('a[data-rel="prettyPhoto[create_wishlist]"]').unbind("click").prettyPhoto(t),r('a[data-rel="prettyPhoto[move_to_another_wishlist]"]').on("click",function(){var t=r(this),i=r("#move_to_another_wishlist").find("form"),e=i.find(".row-id"),a=t.closest("[data-row-id]").data("row-id");e.length&&e.remove(),i.append('<input type="hidden" name="row_id" class="row-id" value="'+a+'"/>')}).prettyPhoto(t),new MutationObserver(function(t,i){for(var e in t){var a=t[e];"childList"===a.type&&(void 0!==a.addedNodes&&a.addedNodes.forEach(function(t){t.classList.contains("yith-wcwl-overlay")&&r("body").addClass("yith-wcwl-with-pretty-photo")}),void 0!==a.removedNodes&&a.removedNodes.forEach(function(t){t.classList.contains("yith-wcwl-overlay")&&r("body").removeClass("yith-wcwl-with-pretty-photo")}))}}).observe(document.body,{childList:!0})}}function a(){r(".wishlist_table").find('.product-checkbox input[type="checkbox"]').off("change").on("change",function(){var t=r(this);t.parent().removeClass("checked").removeClass("unchecked").addClass(t.is(":checked")?"checked":"unchecked")}).trigger("change")}function o(){r(".add_to_cart").filter("[data-icon]").not(".icon-added").each(function(){var t,i=r(this),e=i.data("icon");t=e.match(/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi)?r("<img/>",{src:e}):r("<i/>",{class:"fa "+e}),i.prepend(t).addClass("icon-added")})}function h(){i(),e(),a(),o(),d(),n(),_(),l(),c(),r(document).trigger("yith_wcwl_init_after_ajax")}function n(){yith_wcwl_l10n.enable_tooltip&&r(".yith-wcwl-add-to-wishlist").find("[data-title]").each(function(){var t=r(this);t.hasClass("tooltip-added")||(t.on("mouseenter",function(){var t,i=r(this),e=null,a=i.outerWidth(),o=0;e=r("<span>",{class:"yith-wcwl-tooltip",text:i.data("title")}),i.append(e),t=e.outerWidth()+6,e.outerWidth(t),o=(a-t)/2,e.css({left:o.toFixed(0)+"px"}).fadeIn(200),i.addClass("with-tooltip")}).on("mouseleave",function(){var t=r(this);t.find(".yith-wcwl-tooltip").fadeOut(200,function(){t.removeClass("with-tooltip").find(".yith-wcwl-tooltip").remove()})}),t.addClass("tooltip-added"))})}function d(){r(".yith-wcwl-add-button").filter(".with-dropdown").on("mouseleave",function(){var t=r(this).find(".yith-wcwl-dropdown");t.length&&t.fadeOut(200)}).children("a").on("mouseenter",function(){var t=r(this).closest(".with-dropdown"),i=t.find(".yith-wcwl-dropdown");i.length&&i.children().length&&t.find(".yith-wcwl-dropdown").fadeIn(200)})}function l(){void 0!==yith_wcwl_l10n.enable_drag_n_drop&&yith_wcwl_l10n.enable_drag_n_drop&&r(".wishlist_table").each(function(){var e=r(this),a=!1;e.sortable({items:"[data-row-id]",helper:function(t,i){return i.children().each(function(){r(this).width(r(this).width())}),i},update:function(){var t=e.find("[data-row-id]"),i=[];t.length&&(a&&a.abort(),t.each(function(){var t=r(this);i.push(t.data("row-id"))}),a=r.ajax({data:{action:yith_wcwl_l10n.actions.sort_wishlist_items,positions:i,wishlist_token:e.data("token"),page:e.data("page"),per_page:e.data("per-page")},method:"POST",url:yith_wcwl_l10n.ajax_url}))}})})}function c(){r(".copy-trigger").on("click",function(){var t=r(".copy-target");if(0<t.length)if(t.is("input"))s()?t[0].setSelectionRange(0,9999):t.select(),document.execCommand("copy");else{var i=r("<input/>",{val:t.text(),type:"text"});b("body").append(i),s()?i[0].setSelectionRange(0,9999):i.select(),document.execCommand("copy"),i.remove()}})}function _(){r(".wishlist_table").filter(".images_grid").not(".enhanced").on("click","[data-row-id] .product-thumbnail a",function(t){var i=r(this).closest("[data-row-id]"),e=i.siblings("[data-row-id]"),a=i.find(".item-details");t.preventDefault(),a.length&&(e.removeClass("show"),i.toggleClass("show"))}).on("click","[data-row-id] a.close",function(t){var i=r(this).closest("[data-row-id]"),e=i.find(".item-details");t.preventDefault(),e.length&&i.removeClass("show")}).on("click","[data-row-id] a.remove_from_wishlist",function(t){var i=r(this);return t.stopPropagation(),f(i),!1}).addClass("enhanced"),r(document).on("click",function(t){r(t.target).closest("[data-row-id]").length||r(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")}).on("added_to_cart",function(){r(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")})}function w(i,t,e){i.action=yith_wcwl_l10n.actions.move_to_another_wishlist_action,""!==i.wishlist_token&&""!==i.destination_wishlist_token&&""!==i.item_id&&r.ajax({beforeSend:t,url:yith_wcwl_l10n.ajax_url,data:i,dataType:"json",method:"post",success:function(t){e(t),h(),r("body").trigger("moved_to_another_wishlist",[r(this),i.item_id])}})}function f(i){var t=i.parents(".cart.wishlist_table"),e=i.parents("[data-row-id]"),a=e.data("row-id"),o=t.data("id"),n=t.data("token"),s={action:yith_wcwl_l10n.actions.remove_from_wishlist_action,remove_from_wishlist:a,wishlist_id:o,wishlist_token:n,fragments:C(a)};r.ajax({beforeSend:function(){y(t)},complete:function(){k(t)},data:s,method:"post",success:function(t){void 0!==t.fragments&&j(t.fragments),h(),r("body").trigger("removed_from_wishlist",[i,e])},url:yith_wcwl_l10n.ajax_url})}function p(t){var i=r(this),e=i.closest(".wishlist_table"),a=null;t.preventDefault(),(a=e.length?i.closest("[data-wishlist-id]").find(".wishlist-title"):i.parents(".wishlist-title")).next().show(),a.hide()}function u(t){var i=r(this);t.preventDefault(),i.parents(".hidden-title-form").hide(),i.parents(".hidden-title-form").prev().show()}function m(t){if(void 0!==r.prettyPhoto&&void 0!==r.prettyPhoto.close)if(void 0!==t){var i=r(".pp_content_container"),e=i.find(".pp_content"),a=i.find(".yith-wcwl-popup-form"),o=a.closest(".pp_pic_holder");if(a.length){var n=r("<div/>",{class:"yith-wcwl-popup-feedback"});n.append(r("<i/>",{class:"fa fa-check heading-icon"})),n.append(r("<p/>",{class:"feedback",html:t})),n.css("display","none"),e.css("height","auto"),a.after(n),a.fadeOut(200,function(){n.fadeIn()}),o.addClass("feedback"),o.css("left",r(window).innerWidth()/2-o.outerWidth()/2+"px"),setTimeout(m,3e3)}}else try{r.prettyPhoto.close()}catch(t){}}function v(t){var i=r("#yith-wcwl-popup-message"),e=r("#yith-wcwl-message");yith_wcwl_l10n.enable_notices&&(e.html(t),i.css("margin-left","-"+r(i).width()+"px").fadeIn(),window.setTimeout(function(){i.fadeOut()},2e3))}function g(n){var t=r("select.wishlist-select"),i=r("ul.yith-wcwl-dropdown");t.each(function(){var e=r(this),t=e.find("option"),i=t.filter('[value="new"]');t.not(i).remove(),r.each(n,function(t,i){r("<option>",{value:i.id,html:i.wishlist_name}).appendTo(e)}),e.append(i)}),i.each(function(){var e=r(this),t=e.find("li"),i=e.closest(".yith-wcwl-add-button").children("a.add_to_wishlist"),a=i.attr("data-product-id"),o=i.attr("data-product-type");t.remove(),r.each(n,function(t,i){r("<li>").append(r("<a>",{rel:"nofollow",html:i.wishlist_name,class:"add_to_wishlist",href:i.add_to_this_wishlist_url,"data-product-id":a,"data-product-type":o,"data-wishlist-id":i.id})).appendTo(e)})})}function y(t){void 0!==r.fn.block&&t.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"40px 40px",opacity:1}})}function k(t){void 0!==r.fn.unblock&&t.stop(!0).css("opacity","1").unblock()}function x(){if(navigator.cookieEnabled)return!0;document.cookie="cookietest=1";var t=-1!==document.cookie.indexOf("cookietest=");return document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}function C(t){var e={},i=r(".wishlist-fragment");return t&&("object"==typeof t?((t=r.extend({s:"",firstLoad:!1},t)).s&&(i=i.not("[data-fragment-ref]").add(i.filter('[data-fragment-ref="'+t.s+'"]'))),t.firstLoad&&(i=i.filter(".on-first-load"))):"string"!=typeof t&&"number"!=typeof t||(i=i.not("[data-fragment-ref]").add(i.filter('[data-fragment-ref="'+t+'"]')))),i.each(function(){var t=r(this),i=t.attr("class");e[i]=t.data("fragment-options")}),e}function j(t){r.each(t,function(t,i){var e="."+t.split(" ").filter(function(t){return t.length&&"exists"!==t}).join("."),a=r(e),o=r(i).filter(e);o.length||(o=r(i).find(e)),a.length&&o.length&&a.replaceWith(o)})}function s(){return navigator.userAgent.match(/ipad|iphone/i)}r(document).on("yith_wcwl_init",function(){var t=r(this),s="undefined"!=typeof wc_add_to_cart_params&&null!==wc_add_to_cart_params?wc_add_to_cart_params.cart_redirect_after_add:"";t.on("click",".add_to_wishlist",function(t){var a=r(this),i=a.attr("data-product-id"),o=r(".add-to-wishlist-"+i),e={add_to_wishlist:i,product_type:a.data("product-type"),wishlist_id:a.data("wishlist-id"),action:yith_wcwl_l10n.actions.add_to_wishlist_action,fragments:C(i)};if(t.preventDefault(),jQuery(document.body).trigger("adding_to_wishlist"),yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.modal_enable){var n=a.parents(".yith-wcwl-popup-footer").prev(".yith-wcwl-popup-content"),s=n.find(".wishlist-select"),d=n.find(".wishlist-name"),l=n.find(".wishlist-visibility").filter(":checked");if(e.wishlist_id=s.is(":visible")?s.val():"new",e.wishlist_name=d.val(),e.wishlist_visibility=l.val(),"new"===e.wishlist_id&&!e.wishlist_name)return d.closest("p").addClass("woocommerce-invalid"),!1;d.closest("p").removeClass("woocommerce-invalid")}if(x())return r.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",beforeSend:function(){y(a)},complete:function(){k(a)},success:function(t){var i=t.result,e=t.message;yith_wcwl_l10n.multi_wishlist?(m(e),void 0!==t.user_wishlists&&g(t.user_wishlists)):v(e),"true"!==i&&"exists"!==i||(void 0!==t.fragments&&j(t.fragments),yith_wcwl_l10n.multi_wishlist&&!yith_wcwl_l10n.hide_add_button||o.find(".yith-wcwl-add-button").remove(),o.addClass("exists")),h(),r("body").trigger("added_to_wishlist",[a,o])}}),!1;alert(yith_wcwl_l10n.labels.cookie_disabled)}),t.on("click",".wishlist_table .remove_from_wishlist",function(t){var i=r(this);return t.preventDefault(),f(i),!1}),t.on("adding_to_cart","body",function(t,i,e){void 0!==i&&void 0!==e&&i.closest(".wishlist_table").length&&(e.remove_from_wishlist_after_add_to_cart=i.closest("[data-row-id]").data("row-id"),e.wishlist_id=i.closest(".wishlist_table").data("id"),"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=yith_wcwl_l10n.redirect_to_cart),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=yith_wcwl_l10n.redirect_to_cart))}),t.on("added_to_cart","body",function(t,i,e,a){if(void 0!==a&&a.closest(".wishlist_table").length){"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=s),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=s);var o=a.closest("[data-row-id]"),n=o.closest(".wishlist-fragment").data("fragment-options");a.removeClass("added"),o.find(".added_to_cart").remove(),yith_wcwl_l10n.remove_from_wishlist_after_add_to_cart&&n.is_user_owner&&o.remove()}}),t.on("added_to_cart","body",function(){var t=r(".woocommerce-message");0===t.length?r("#yith-wcwl-form").prepend(yith_wcwl_l10n.labels.added_to_cart_message):t.fadeOut(300,function(){r(this).replaceWith(yith_wcwl_l10n.labels.added_to_cart_message).fadeIn()})}),t.on("cart_page_refreshed","body",h),t.on("click",".show-title-form",p),t.on("click",".wishlist-title-with-form h2",p),t.on("click",".remove_from_all_wishlists",function(t){var i=r(this),e=i.attr("data-product-id"),a=i.data("wishlist-id"),o=i.closest(".content"),n={action:yith_wcwl_l10n.actions.remove_from_all_wishlists,prod_id:e,wishlist_id:a,fragments:C(e)};t.preventDefault(),r.ajax({beforeSend:function(){y(o)},complete:function(){k(o)},data:n,dataType:"json",method:"post",success:function(t){void 0!==t.fragments&&j(t.fragments),h()},url:yith_wcwl_l10n.ajax_url})}),t.on("click",".hide-title-form",u),t.on("change",".change-wishlist",function(){var t=r(this),i=t.parents(".cart.wishlist_table"),e=i.data("token"),a=t.parents("[data-row-id]").data("row-id");w({wishlist_token:e,destination_wishlist_token:t.val(),item_id:a,fragments:C()},function(){y(i)},function(t){void 0!==t.fragments&&j(t.fragments),k(i)})}),t.on("click",".yith-wcwl-popup-footer .move_to_wishlist",function(){var e=r(this),t=e.attr("data-product-id"),i=e.data("origin-wishlist-id"),a=e.closest("form"),o=a.find(".wishlist-select").val(),n=a.find(".wishlist-name"),s=n.val(),d=a.find(".wishlist-visibility").filter(":checked").val();if("new"===o&&!s)return n.closest("p").addClass("woocommerce-invalid"),!1;n.closest("p").removeClass("woocommerce-invalid"),w({wishlist_token:i,destination_wishlist_token:o,item_id:t,wishlist_name:s,wishlist_visibility:d,fragments:C(t)},function(){y(e)},function(t){var i=t.message;yith_wcwl_l10n.multi_wishlist?(m(i),void 0!==t.user_wishlists&&g(t.user_wishlists)):v(i),void 0!==t.fragments&&j(t.fragments),h(),k(e)})}),t.on("click",".delete_item",function(){var a=r(this),t=a.attr("data-product-id"),i=a.data("item-id"),o=r(".add-to-wishlist-"+t);return r.ajax({url:yith_wcwl_l10n.ajax_url,data:{action:yith_wcwl_l10n.actions.delete_item_action,item_id:i,fragments:C(t)},dataType:"json",beforeSend:function(){y(a)},complete:function(){k(a)},method:"post",success:function(t){var i=t.fragments,e=t.message;yith_wcwl_l10n.multi_wishlist&&m(e),a.closest(".yith-wcwl-remove-button").length||v(e),void 0!==i&&j(i),h(),r("body").trigger("removed_from_wishlist",[a,o])}}),!1}),t.on("change",".yith-wcwl-popup-content .wishlist-select",function(){var t=r(this);"new"===t.val()?t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").show():t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").hide()}),t.on("change","#bulk_add_to_cart",function(){var t=r(this),i=t.closest(".wishlist_table").find("[data-row-id]").find('input[type="checkbox"]:not(:disabled)');t.is(":checked")?i.attr("checked","checked").change():i.removeAttr("checked").change()}),t.on("submit",".wishlist-ask-an-estimate-popup",function(){var t=r(this),e=t.closest("form"),a=t.closest(".pp_content"),i=e.serialize();return r.ajax({beforeSend:function(){y(e)},complete:function(){k(e)},data:i+"&action="+yith_wcwl_l10n.actions.ask_an_estimate,dataType:"json",method:"post",success:function(t){if(void 0!==t.result&&t.result){var i=t.template;void 0!==i&&(e.replaceWith(i),a.css("height","auto"),setTimeout(m,3e3))}else void 0!==t.message&&(e.find(".woocommerce-error").remove(),e.find(".popup-description").after(r("<div>",{text:t.message,class:"woocommerce-error"})))},url:yith_wcwl_l10n.ajax_url}),!1}),t.on("click",".yith-wfbt-add-wishlist",function(t){t.preventDefault();var i=r(this),e=r("#yith-wcwl-form");r("html, body").animate({scrollTop:e.offset().top},500),function(t,e){var i=t.data("data-product-id"),a=r(document).find(".cart.wishlist_table"),o=a.data("pagination"),n=a.data("per-page"),s=a.data("id"),d=a.data("token"),l={action:yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,pagination:o,per_page:n,wishlist_id:s,wishlist_token:d,add_to_wishlist:i,product_type:t.data("product-type")};if(!x())return alert(yith_wcwl_l10n.labels.cookie_disabled);r.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:l,dataType:"html",beforeSend:function(){y(a)},complete:function(){k(a)},success:function(t){var i=r(t).find("#yith-wcwl-form");e.replaceWith(i),h()}})}(i,e)}),t.on("submit",".yith-wcwl-popup-form",function(){return!1}),t.on("yith_infs_added_elem",function(){e()}),t.on("found_variation",function(t,i){var a=r(t.target).data("product_id"),o=i.variation_id,e=r('.add_to_wishlist[data-product-id="'+a+'"]').add('.add_to_wishlist[data-original-product-id="'+a+'"]');a&&o&&e.length&&e.each(function(){var t,i=r(this),e=i.closest(".yith-wcwl-add-to-wishlist");i.attr("data-original-product-id",a),i.attr("data-product-id",o),console.log(i,i.attr("data-product-id")),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=o,e.data("fragment-options",t)),e.removeClass(function(t,i){return i.match(/add-to-wishlist-\S+/g).join(" ")}).addClass("add-to-wishlist-"+o).attr("data-fragment-ref",o))})}),t.on("reset_data",function(t){var o=r(t.target).data("product_id"),i=r('.add_to_wishlist[data-original-product-id="'+o+'"]');o&&i.length&&i.each(function(){var t,i=r(this),e=i.closest(".yith-wcwl-add-to-wishlist"),a=i.attr("data-product-id");i.attr("data-product-id",o),i.attr("data-original-product-id",""),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=o,e.data("fragment-options",t)),e.removeClass("add-to-wishlist-"+a).addClass("add-to-wishlist-"+o).attr("data-fragment-ref",o))})}),t.on("yith_wcwl_fragments_loaded",function(t){r(".variations_form").find(".variations select").last().change()}),function(){if(!yith_wcwl_l10n.enable_notices)return;if(r(".yith-wcwl-add-to-wishlist").length&&!r("#yith-wcwl-popup-message").length){var t=r("<div>").attr("id","yith-wcwl-message"),i=r("<div>").attr("id","yith-wcwl-popup-message").html(t).hide();r("body").prepend(i)}}(),n(),d(),l(),function(){var n,s;r(".wishlist_table").on("change",".product-quantity input",function(){var t=r(this),i=t.closest("[data-row-id]"),e=i.data("row-id"),a=t.closest(".wishlist_table"),o=a.data("token");clearTimeout(s),i.find(".add_to_cart").data("quantity",t.val()),s=setTimeout(function(){n&&n.abort(),n=r.ajax({beforeSend:function(){y(a)},complete:function(){k(a)},data:{product_id:e,wishlist_token:o,quantity:t.val(),action:yith_wcwl_l10n.actions.update_item_quantity},method:"POST",url:yith_wcwl_l10n.ajax_url})},1e3)})}(),_(),r(document).on("click",".show-tab",function(t){var i=r(this),e=i.closest(".yith-wcwl-popup-content"),a=i.data("tab"),o=e.find(".tab").filter("."+a);if(t.preventDefault(),!o.length)return!1;i.addClass("active").siblings(".show-tab").removeClass("active"),o.show().siblings(".tab").hide(),"create"===a?e.prepend('<input type="hidden" id="new_wishlist_selector" class="wishlist-select" value="new">'):e.find("#new_wishlist_selector").remove()}),r(document).on("change",".wishlist-select",function(t){var i=r(this),e=i.closest(".yith-wcwl-popup-content"),a=i.closest(".tab"),o=e.find(".tab.create"),n=e.find(".show-tab"),s=n.filter('[data-tab="create"]');"new"===i.val()&&o.length&&(a.hide(),o.show(),n.removeClass("active"),s.addClass("active"),i.find("option").removeProp("selected"),i.change())}),i(),a(),e(),o(),function(){var c=!1;r(window).on("resize",function(t){var i=r(".wishlist_table.responsive"),e=i.is(".mobile"),a=window.matchMedia("(max-width: 768px)"),o=i.closest("form"),n=o.attr("class"),s=o.data("fragment-options"),d={},l=!1;i.length&&(a.matches&&i&&!e?(s.is_mobile="yes",l=!0):!a.matches&&i&&e&&(s.is_mobile="no",l=!0),l&&(c&&c.abort(),d[n]=s,c=r.ajax({beforeSend:function(){y(i)},complete:function(){k(i)},data:{action:yith_wcwl_l10n.actions.load_mobile_action,fragments:d},method:"post",success:function(t){void 0!==t.fragments&&(j(t.fragments),h(),r(document).trigger("yith_wcwl_responsive_template",[e,t.fragments]))},url:yith_wcwl_l10n.ajax_url})))})}(),c(),function(){if(!yith_wcwl_l10n.enable_ajax_loading)return;var i=C({firstLoad:!0});if(!i)return;r.ajax({data:{action:yith_wcwl_l10n.actions.load_fragments,fragments:i},method:"post",success:function(t){void 0!==t.fragments&&(j(t.fragments),h(),r(document).trigger("yith_wcwl_fragments_loaded",[i,t.fragments]))},url:yith_wcwl_l10n.ajax_url})}()}).trigger("yith_wcwl_init")});
assets/js/unminified/admin/yith-wcwl.js CHANGED
@@ -29,7 +29,14 @@ jQuery( document ).ready( function( $ ) {
29
  return;
30
  }
31
 
32
- val ? target.removeClass('yith-disabled') : target.addClass('yith-disabled');
 
 
 
 
 
 
 
33
  });
34
 
35
  if (typeof complete != 'undefined') {
@@ -451,10 +458,10 @@ jQuery( document ).ready( function( $ ) {
451
  options_field = t.closest( '.yith-toggle-content-row' ).next();
452
 
453
  if( v === 'radio' || v === 'select' ){
454
- options_field.removeClass( 'yith-disabled' );
455
  }
456
  else{
457
- options_field.addClass( 'yith-disabled' );
458
  }
459
  } ).change();
460
 
@@ -724,16 +731,17 @@ jQuery( document ).ready( function( $ ) {
724
 
725
  $(document).on( 'yith-add-box-button-toggle', function(){
726
  var ask_an_estimate_type_new = $('#new_type'),
727
- ask_an_estimate_options_new = $('#new_options');
 
728
 
729
  ask_an_estimate_type_new.on( 'change', function(){
730
  var v = ask_an_estimate_type_new.val();
731
 
732
  if( v === 'radio' || v === 'select' ){
733
- ask_an_estimate_options_new.closest('.yith-add-box-row').removeClass('yith-disabled');
734
  }
735
  else{
736
- ask_an_estimate_options_new.closest('.yith-add-box-row').addClass('yith-disabled');
737
  }
738
  } ).change();
739
  } );
29
  return;
30
  }
31
 
32
+ if( val ){
33
+ target.show().fadeTo("slow", 1);
34
+ }
35
+ else{
36
+ target.is( ':visible' ) ? target.fadeTo("slow", 0, function(){ target.hide() }) : target.css('opacity', 0).hide();
37
+ }
38
+
39
+ // val ? target.removeClass('yith-disabled') : target.addClass('yith-disabled');
40
  });
41
 
42
  if (typeof complete != 'undefined') {
458
  options_field = t.closest( '.yith-toggle-content-row' ).next();
459
 
460
  if( v === 'radio' || v === 'select' ){
461
+ options_field.show().fadeTo('slow' , 1);
462
  }
463
  else{
464
+ options_field.is( ':visible' ) ? options_field.fadeTo('slow', 0, function(){ options_field.hide() }) : options_field.css('opacity', 0).hide();
465
  }
466
  } ).change();
467
 
731
 
732
  $(document).on( 'yith-add-box-button-toggle', function(){
733
  var ask_an_estimate_type_new = $('#new_type'),
734
+ ask_an_estimate_options_new = $('#new_options'),
735
+ target = ask_an_estimate_options_new.closest('.yith-add-box-row');
736
 
737
  ask_an_estimate_type_new.on( 'change', function(){
738
  var v = ask_an_estimate_type_new.val();
739
 
740
  if( v === 'radio' || v === 'select' ){
741
+ target.show().fadeTo('slow', 1);
742
  }
743
  else{
744
+ target.is( ':visible' ) ? target.fadeTo('slow', 0, function(){ $(this).hide() }) : target.css('opacity', 0).hide();
745
  }
746
  } ).change();
747
  } );
assets/js/unminified/jquery.yith-wcwl.js CHANGED
@@ -16,7 +16,7 @@ jQuery( document ).ready( function( $ ){
16
 
17
  t.on( 'click', '.add_to_wishlist', function( ev ) {
18
  var t = $( this),
19
- product_id = t.data( 'product-id' ),
20
  el_wrap = $( '.add-to-wishlist-' + product_id ),
21
  data = {
22
  add_to_wishlist: product_id,
@@ -162,7 +162,7 @@ jQuery( document ).ready( function( $ ){
162
 
163
  t.on( 'click', '.remove_from_all_wishlists', function( ev ){
164
  var t = $(this),
165
- prod_id = t.data('product-id'),
166
  wishlist_id = t.data('wishlist-id'),
167
  content = t.closest( '.content' ),
168
  data = {
@@ -226,7 +226,7 @@ jQuery( document ).ready( function( $ ){
226
 
227
  t.on( 'click', '.yith-wcwl-popup-footer .move_to_wishlist', function(){
228
  var t = $(this),
229
- product_id = t.data('product-id'),
230
  wishlist_token = t.data('origin-wishlist-id'),
231
  form = t.closest('form'),
232
  to_token = form.find('.wishlist-select').val(),
@@ -281,7 +281,7 @@ jQuery( document ).ready( function( $ ){
281
 
282
  t.on( 'click', '.delete_item', function(){
283
  var t = $(this),
284
- product_id = t.data('product-id'),
285
  item_id = t.data('item-id'),
286
  el_wrap = $( '.add-to-wishlist-' + product_id );
287
 
@@ -425,8 +425,10 @@ jQuery( document ).ready( function( $ ){
425
  container = t.closest( '.yith-wcwl-add-to-wishlist' ),
426
  options;
427
 
428
- t.data( 'original-product-id', product_id );
429
- t.data( 'product-id', variation_id );
 
 
430
 
431
  if( container.length ) {
432
  options = container.data( 'fragment-options' );
@@ -458,11 +460,11 @@ jQuery( document ).ready( function( $ ){
458
  targets.each( function(){
459
  var t = $(this),
460
  container = t.closest( '.yith-wcwl-add-to-wishlist' ),
461
- variation_id = t.data( 'product-id' ),
462
  options;
463
 
464
- t.data( 'product-id', product_id );
465
- t.data( 'original-product-id', '' );
466
 
467
  if( container.length ) {
468
  options = container.data( 'fragment-options' );
@@ -480,6 +482,10 @@ jQuery( document ).ready( function( $ ){
480
  } );
481
  } );
482
 
 
 
 
 
483
  init_wishlist_popup();
484
 
485
  init_wishlist_tooltip();
@@ -1199,7 +1205,7 @@ jQuery( document ).ready( function( $ ){
1199
  */
1200
  function reload_wishlist_and_adding_elem( el, form ) {
1201
 
1202
- var product_id = el.data( 'product-id' ),
1203
  table = $(document).find( '.cart.wishlist_table' ),
1204
  pagination = table.data( 'pagination' ),
1205
  per_page = table.data( 'per-page' ),
@@ -1382,8 +1388,8 @@ jQuery( document ).ready( function( $ ){
1382
  wishlist_options = t.find( 'li' ),
1383
  container = t.closest( '.yith-wcwl-add-button' ),
1384
  default_button = container.children( 'a.add_to_wishlist' ),
1385
- product_id = default_button.data('product-id'),
1386
- product_type = default_button.data('product-type');
1387
 
1388
  wishlist_options.remove();
1389
  $.each( wishlists, function( i, v ) {
16
 
17
  t.on( 'click', '.add_to_wishlist', function( ev ) {
18
  var t = $( this),
19
+ product_id = t.attr( 'data-product-id' ),
20
  el_wrap = $( '.add-to-wishlist-' + product_id ),
21
  data = {
22
  add_to_wishlist: product_id,
162
 
163
  t.on( 'click', '.remove_from_all_wishlists', function( ev ){
164
  var t = $(this),
165
+ prod_id = t.attr('data-product-id'),
166
  wishlist_id = t.data('wishlist-id'),
167
  content = t.closest( '.content' ),
168
  data = {
226
 
227
  t.on( 'click', '.yith-wcwl-popup-footer .move_to_wishlist', function(){
228
  var t = $(this),
229
+ product_id = t.attr('data-product-id'),
230
  wishlist_token = t.data('origin-wishlist-id'),
231
  form = t.closest('form'),
232
  to_token = form.find('.wishlist-select').val(),
281
 
282
  t.on( 'click', '.delete_item', function(){
283
  var t = $(this),
284
+ product_id = t.attr('data-product-id'),
285
  item_id = t.data('item-id'),
286
  el_wrap = $( '.add-to-wishlist-' + product_id );
287
 
425
  container = t.closest( '.yith-wcwl-add-to-wishlist' ),
426
  options;
427
 
428
+ t.attr( 'data-original-product-id', product_id );
429
+ t.attr( 'data-product-id', variation_id );
430
+
431
+ console.log(t, t.attr('data-product-id'));
432
 
433
  if( container.length ) {
434
  options = container.data( 'fragment-options' );
460
  targets.each( function(){
461
  var t = $(this),
462
  container = t.closest( '.yith-wcwl-add-to-wishlist' ),
463
+ variation_id = t.attr( 'data-product-id' ),
464
  options;
465
 
466
+ t.attr( 'data-product-id', product_id );
467
+ t.attr( 'data-original-product-id', '' );
468
 
469
  if( container.length ) {
470
  options = container.data( 'fragment-options' );
482
  } );
483
  } );
484
 
485
+ t.on( 'yith_wcwl_fragments_loaded', function( ev ){
486
+ $( '.variations_form' ).find( '.variations select' ).last().change();
487
+ } );
488
+
489
  init_wishlist_popup();
490
 
491
  init_wishlist_tooltip();
1205
  */
1206
  function reload_wishlist_and_adding_elem( el, form ) {
1207
 
1208
+ var product_id = el.data( 'data-product-id' ),
1209
  table = $(document).find( '.cart.wishlist_table' ),
1210
  pagination = table.data( 'pagination' ),
1211
  per_page = table.data( 'per-page' ),
1388
  wishlist_options = t.find( 'li' ),
1389
  container = t.closest( '.yith-wcwl-add-button' ),
1390
  default_button = container.children( 'a.add_to_wishlist' ),
1391
+ product_id = default_button.attr('data-product-id'),
1392
+ product_type = default_button.attr('data-product-type');
1393
 
1394
  wishlist_options.remove();
1395
  $.each( wishlists, function( i, v ) {
includes/class.yith-wcwl-form-handler.php CHANGED
@@ -137,7 +137,7 @@ if ( ! class_exists( 'YITH_WCWL_Form_Handler' ) ) {
137
  $wishlist->save();
138
  }
139
 
140
- $redirect_url = $wishlist->get_url();
141
 
142
  wp_redirect( $redirect_url );
143
  die;
137
  $wishlist->save();
138
  }
139
 
140
+ $redirect_url = isset( $_REQUEST['redirect_to'] ) ? esc_url_raw( $_REQUEST['redirect_to'] ) : $wishlist->get_url();
141
 
142
  wp_redirect( $redirect_url );
143
  die;
includes/class.yith-wcwl-frontend.php CHANGED
@@ -33,7 +33,7 @@ if ( ! class_exists( 'YITH_WCWL_Frontend' ) ) {
33
  * @var string
34
  * @since 1.0.0
35
  */
36
- public $version = '3.0.3';
37
 
38
  /**
39
  * Plugin database version
33
  * @var string
34
  * @since 1.0.0
35
  */
36
+ public $version = '3.0.4';
37
 
38
  /**
39
  * Plugin database version
includes/class.yith-wcwl-wishlist.php CHANGED
@@ -434,7 +434,7 @@ if ( ! class_exists( 'YITH_WCWL_Wishlist' ) ) {
434
  * @return string Url to delete the wishlist
435
  */
436
  public function get_delete_url() {
437
- return wp_nonce_url( add_query_arg( 'wishlist_id', $this->get_id(), YITH_WCWL()->get_wishlist_url( 'manage' ) ), 'yith_wcwl_delete_action', 'yith_wcwl_delete' );
438
  }
439
 
440
  /* === SETTERS === */
434
  * @return string Url to delete the wishlist
435
  */
436
  public function get_delete_url() {
437
+ return apply_filters( 'yith_wcwl_wishlist_delete_url', wp_nonce_url( add_query_arg( 'wishlist_id', $this->get_id(), YITH_WCWL()->get_wishlist_url( 'manage' ) ), 'yith_wcwl_delete_action', 'yith_wcwl_delete' ) );
438
  }
439
 
440
  /* === SETTERS === */
includes/class.yith-wcwl.php CHANGED
@@ -189,11 +189,10 @@ if ( ! class_exists( 'YITH_WCWL' ) ) {
189
  $wishlist->add_item( $item );
190
  $wishlist->save();
191
 
192
- delete_transient( 'yith_wcwl_wishlist_count_' . $wishlist->get_token() );
193
 
194
  if( $user_id = $wishlist->get_user_id() ) {
195
- delete_transient( 'yith_wcwl_user_default_count_' . $user_id );
196
- delete_transient( 'yith_wcwl_user_total_count_' . $user_id );
197
  }
198
 
199
  do_action( 'yith_wcwl_added_to_wishlist', $prod_id, $wishlist_id, $user_id );
@@ -238,11 +237,10 @@ if ( ! class_exists( 'YITH_WCWL' ) ) {
238
  $wishlist->remove_product( $prod_id );
239
  $wishlist->save();
240
 
241
- delete_transient( 'yith_wcwl_wishlist_count_' . $wishlist->get_token() );
242
 
243
  if( $user_id = $wishlist->get_user_id() ) {
244
- delete_transient( 'yith_wcwl_user_default_count_' . $user_id );
245
- delete_transient( 'yith_wcwl_user_total_count_' . $user_id );
246
  }
247
 
248
  do_action( 'yith_wcwl_removed_from_wishlist', $prod_id, $wishlist_id, $user_id );
@@ -304,12 +302,11 @@ if ( ! class_exists( 'YITH_WCWL' ) ) {
304
  return 0;
305
  }
306
 
307
- $transient_name = 'yith_wcwl_wishlist_count_' . $wishlist->get_token();
308
- $count = get_transient( $transient_name );
309
 
310
  if( false === $count ){
311
  $count = $wishlist->count_items();
312
- set_transient( $transient_name, $count, WEEK_IN_SECONDS );
313
  }
314
 
315
  return $count;
@@ -322,7 +319,9 @@ if ( ! class_exists( 'YITH_WCWL' ) ) {
322
  * @since 2.0.12
323
  */
324
  public function count_all_products() {
325
- $args = array();
 
 
326
 
327
  if( is_user_logged_in() ){
328
  $id = get_current_user_id();
@@ -333,9 +332,9 @@ if ( ! class_exists( 'YITH_WCWL' ) ) {
333
  $args['session_id'] = $id;
334
  }
335
 
336
- if( false === $count = get_transient( 'yith_wcwl_user_total_count_' . $id ) ) {
337
  $count = YITH_WCWL_Wishlist_Factory::get_wishlist_items_count( $args );
338
- set_transient( 'yith_wcwl_user_total_count_' . $id, $count, WEEK_IN_SECONDS );
339
  }
340
 
341
  return $count;
189
  $wishlist->add_item( $item );
190
  $wishlist->save();
191
 
192
+ wp_cache_delete( 'wishlist-count-' . $wishlist->get_token(), 'wishlists' );
193
 
194
  if( $user_id = $wishlist->get_user_id() ) {
195
+ wp_cache_delete( 'wishlist-user-total-count-' . $user_id, 'wishlists' );
 
196
  }
197
 
198
  do_action( 'yith_wcwl_added_to_wishlist', $prod_id, $wishlist_id, $user_id );
237
  $wishlist->remove_product( $prod_id );
238
  $wishlist->save();
239
 
240
+ wp_cache_delete( 'wishlist-count-' . $wishlist->get_token(), 'wishlists' );
241
 
242
  if( $user_id = $wishlist->get_user_id() ) {
243
+ wp_cache_delete( 'wishlist-user-total-count-' . $user_id );
 
244
  }
245
 
246
  do_action( 'yith_wcwl_removed_from_wishlist', $prod_id, $wishlist_id, $user_id );
302
  return 0;
303
  }
304
 
305
+ $count = wp_cache_get( 'wishlist-count-' . $wishlist->get_token(), 'wishlists' );
 
306
 
307
  if( false === $count ){
308
  $count = $wishlist->count_items();
309
+ wp_cache_set( 'wishlist-count-' . $wishlist->get_token(), $count, 'wishlists' );
310
  }
311
 
312
  return $count;
319
  * @since 2.0.12
320
  */
321
  public function count_all_products() {
322
+ $args = array(
323
+ 'wishlist_id' => 'all'
324
+ );
325
 
326
  if( is_user_logged_in() ){
327
  $id = get_current_user_id();
332
  $args['session_id'] = $id;
333
  }
334
 
335
+ if( false === $count = wp_cache_get( 'wishlist-user-total-count-' . $id, 'wishlists' ) ) {
336
  $count = YITH_WCWL_Wishlist_Factory::get_wishlist_items_count( $args );
337
+ wp_cache_set( 'wishlist-user-total-count-' . $id, $count, 'wishlists' );
338
  }
339
 
340
  return $count;
includes/data-stores/class.yith-wcwl-wishlist-data-store.php CHANGED
@@ -164,13 +164,13 @@ if ( ! class_exists( 'YITH_WCWL_Wishlist_Data_Store' ) ) {
164
  'id' => $wishlist_data->ID,
165
  'privacy' => $wishlist_data->wishlist_privacy,
166
  'user_id' => $wishlist_data->user_id,
167
- 'session_id' => $wishlist_data->session_id,
168
  'name' => wc_clean( stripslashes( $wishlist_data->wishlist_name ) ),
169
  'slug' => $wishlist_data->wishlist_slug,
170
  'token' => $wishlist_data->wishlist_token,
171
  'is_default' => $wishlist_data->is_default,
172
  'date_added' => $wishlist_data->dateadded,
173
- 'expiration' => $wishlist_data->expiration
174
  )
175
  );
176
  $wishlist->set_object_read( true );
164
  'id' => $wishlist_data->ID,
165
  'privacy' => $wishlist_data->wishlist_privacy,
166
  'user_id' => $wishlist_data->user_id,
167
+ 'session_id' => isset( $wishlist_data->session_id ) ? $wishlist_data->session_id : '',
168
  'name' => wc_clean( stripslashes( $wishlist_data->wishlist_name ) ),
169
  'slug' => $wishlist_data->wishlist_slug,
170
  'token' => $wishlist_data->wishlist_token,
171
  'is_default' => $wishlist_data->is_default,
172
  'date_added' => $wishlist_data->dateadded,
173
+ 'expiration' => isset( $wishlist_data->expiration ) ? $wishlist_data->expiration : ''
174
  )
175
  );
176
  $wishlist->set_object_read( true );
includes/functions.yith-wcwl.php CHANGED
@@ -86,6 +86,7 @@ if( !function_exists( 'yith_wcwl_get_template' ) ) {
86
  $located = yith_wcwl_locate_template( $path, $var );
87
 
88
  if ( $var && is_array( $var ) ) {
 
89
  extract( $var );
90
  }
91
 
86
  $located = yith_wcwl_locate_template( $path, $var );
87
 
88
  if ( $var && is_array( $var ) ) {
89
+ $atts = $var;
90
  extract( $var );
91
  }
92
 
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Wishlist
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-wishlist/
5
  * Description: <code><strong>YITH WooCommerce Wishlist</strong></code> gives your users the possibility to create, fill, manage and share their wishlists allowing you to analyze their interests and needs to improve your marketing strategies. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce on <strong>YITH</strong></a>
6
- * Version: 3.0.3
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-wishlist
3
  * Plugin Name: YITH WooCommerce Wishlist
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-wishlist/
5
  * Description: <code><strong>YITH WooCommerce Wishlist</strong></code> gives your users the possibility to create, fill, manage and share their wishlists allowing you to analyze their interests and needs to improve your marketing strategies. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce on <strong>YITH</strong></a>
6
+ * Version: 3.0.4
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-wishlist
plugin-fw/assets/css/yith-fields.css CHANGED
@@ -73,7 +73,7 @@
73
  }
74
 
75
  .wp-core-ui .yith-plugin-fw-colorpicker-field-wrapper button{
76
- border-color: #7e8993;
77
  }
78
 
79
  .woocommerce .yith-plugin-fw table.form-table input[type=text].colorpick,
@@ -442,12 +442,12 @@ ul.yit-icons-manager-list li.active {
442
  WordPress 5.3 with old panel fixes
443
  ****************/
444
  .yith-plugin-fw-field-wrapper .select2-container .select2-selection--single {
445
- height: auto;
446
- line-height: 1;
447
  }
448
 
449
  .yith-plugin-fw-field-wrapper .select2-container .select2-selection--single .select2-selection__arrow{
450
- height: 100%;
451
  }
452
 
453
  /****************
@@ -615,28 +615,18 @@ YITH UI
615
 
616
  .yith-plugin-fw-banner {
617
  width : 100%;
618
- height : 75px;
619
  background : url('../images/banner-premium.png');
620
- }
621
-
622
- .yith-plugin-fw-banner.yith-plugin-fw-banner-free {
623
- height : 290px;
624
- background : url('../images/banner-free.png') no-repeat;
625
- }
626
-
627
- .yith-plugin-fw-banner.yith-plugin-fw-banner-free h1 {
628
- max-width : auto;
629
- text-align : left;
630
- padding-left : 100px;
631
- padding-top : 15px;
632
- padding-bottom : 8px;
633
  }
634
 
635
  .yith-plugin-fw-banner h1 {
636
  text-transform : uppercase;
637
  color : #0c5777;
638
  font-size : 15px;
639
- padding-left : 150px;
640
  font-weight : 700;
641
  text-align : left;
642
  display : inline-block;
@@ -659,16 +649,19 @@ YITH UI
659
  box-shadow : none;
660
  }
661
 
662
- .yith-banners ul {
663
- list-style : none;
664
- margin-left : 10px;
665
  }
666
 
667
- .yith-banners ul li {
668
- display : inline-block;
669
- margin-left : 10px;
 
670
  }
671
 
 
 
 
672
  .yith-plugin-ui a {
673
  outline : none;
674
  box-shadow : none;
@@ -866,11 +859,11 @@ YITH UI
866
  .yith-plugin-ui input[type=text]:not(.select2-search__field).wp-color-picker,
867
  .yith-plugin-ui table.form-table input[type=text].wp-color-picker,
868
  .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text].wp-color-picker {
869
- border: 0;
870
- height: 30px;
871
- max-width: 121px;
872
- font-size: 11px;
873
- padding: 0;
874
  }
875
 
876
  .yith-plugin-ui .search-box input[name="s"] {
@@ -2118,6 +2111,14 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
2118
  min-width: auto !important;
2119
  }
2120
 
 
 
 
 
 
 
 
 
2121
  @media screen and (max-width : 1440px) {
2122
  .yith-plugin-ui .yith-add-box,
2123
  .yith-plugin-ui .yith-toggle-row:not(.fixed) {
@@ -2153,25 +2154,13 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
2153
  }
2154
 
2155
  @media screen and (max-width : 782px) {
2156
- .yith-plugin-fw-banner.yith-plugin-fw-banner-free {
2157
- height : auto;
2158
- background-color : #a9c7d3;
2159
- }
2160
-
2161
- .yith-plugin-fw-banner.yith-plugin-fw-banner-free ul {
2162
- width : 90%;
2163
- text-align : center;
2164
- }
2165
-
2166
- .yith-plugin-fw-banner.yith-plugin-fw-banner-free li img {
2167
- width : 90%;
2168
- margin : 0 auto;
2169
- }
2170
-
2171
  .yith-plugin-fw-banner h1 {
2172
  line-height : 1.2em;
2173
  }
2174
-
 
 
 
2175
  .yith-plugin-ui .yith-add-box,
2176
  .yith-plugin-ui .yith-toggle-row {
2177
  width : 100%;
73
  }
74
 
75
  .wp-core-ui .yith-plugin-fw-colorpicker-field-wrapper button{
76
+ border-color: #7e8993;
77
  }
78
 
79
  .woocommerce .yith-plugin-fw table.form-table input[type=text].colorpick,
442
  WordPress 5.3 with old panel fixes
443
  ****************/
444
  .yith-plugin-fw-field-wrapper .select2-container .select2-selection--single {
445
+ height: auto;
446
+ line-height: 1;
447
  }
448
 
449
  .yith-plugin-fw-field-wrapper .select2-container .select2-selection--single .select2-selection__arrow{
450
+ height: 100%;
451
  }
452
 
453
  /****************
615
 
616
  .yith-plugin-fw-banner {
617
  width : 100%;
618
+ height: 45px;
619
  background : url('../images/banner-premium.png');
620
+ display: flex;
621
+ align-items: center;
622
+ padding-right: -23px;
 
 
 
 
 
 
 
 
 
 
623
  }
624
 
625
  .yith-plugin-fw-banner h1 {
626
  text-transform : uppercase;
627
  color : #0c5777;
628
  font-size : 15px;
629
+ padding: 0 0 0 110px;
630
  font-weight : 700;
631
  text-align : left;
632
  display : inline-block;
649
  box-shadow : none;
650
  }
651
 
652
+ .yith-plugin-fw-rate{
653
+ margin: 20px 0;
 
654
  }
655
 
656
+ .yith-plugin-fw-rate .dashicons-star-filled{
657
+ font-size: 12px;
658
+ margin: 4px -4px;
659
+ color: #0c5777;
660
  }
661
 
662
+ .yith-plugin-fw-rate a{
663
+ text-decoration: none;
664
+ }
665
  .yith-plugin-ui a {
666
  outline : none;
667
  box-shadow : none;
859
  .yith-plugin-ui input[type=text]:not(.select2-search__field).wp-color-picker,
860
  .yith-plugin-ui table.form-table input[type=text].wp-color-picker,
861
  .woocommerce.yith-plugin-fw-panel .yith-plugin-ui table.form-table input[type=text].wp-color-picker {
862
+ border: 0;
863
+ height: 30px;
864
+ max-width: 121px;
865
+ font-size: 11px;
866
+ padding: 0;
867
  }
868
 
869
  .yith-plugin-ui .search-box input[name="s"] {
2111
  min-width: auto !important;
2112
  }
2113
 
2114
+ /** OVERRIDE WOOCOMMERCE CLASSES FOR 5.3 */
2115
+ .branch-5-3 .yith-plugin-fw .select2-container .select2-selection--single .select2-selection__arrow{
2116
+ background:none;
2117
+ }
2118
+ .branch-5-3 .yith-plugin-fw .select2-container.select2-container--focus .select2-selection--single, .branch-5-3 .yith-plugin-fw .select2-container.select2-container--open .select2-selection--multiple, .branch-5-3 .yith-plugin-fw .select2-container.select2-container--open .select2-selection--single{
2119
+ box-shadow: none;
2120
+ }
2121
+
2122
  @media screen and (max-width : 1440px) {
2123
  .yith-plugin-ui .yith-add-box,
2124
  .yith-plugin-ui .yith-toggle-row:not(.fixed) {
2154
  }
2155
 
2156
  @media screen and (max-width : 782px) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2157
  .yith-plugin-fw-banner h1 {
2158
  line-height : 1.2em;
2159
  }
2160
+ .yith-plugin-fw-banner h1{
2161
+ font-size: 12px;
2162
+ padding-right: 10px;
2163
+ }
2164
  .yith-plugin-ui .yith-add-box,
2165
  .yith-plugin-ui .yith-toggle-row {
2166
  width : 100%;
plugin-fw/assets/images/banner-free.png DELETED
Binary file
plugin-fw/assets/images/banner-premium.png CHANGED
Binary file
plugin-fw/assets/images/rate_banner.png DELETED
Binary file
plugin-fw/assets/images/upgrade_banner.png DELETED
Binary file
plugin-fw/assets/js/metabox.js CHANGED
@@ -129,7 +129,14 @@
129
  $current_field.hide();
130
  break;
131
  default:
132
- $current_container.hide();
 
 
 
 
 
 
 
133
  }
134
 
135
  } else {
@@ -143,6 +150,7 @@
143
  break;
144
  default:
145
  $current_container.show();
 
146
  }
147
  }
148
  }
129
  $current_field.hide();
130
  break;
131
  default:
132
+ if( ! $current_container.hasClass('fade-in')){
133
+ $current_container.hide();
134
+ $current_container.css({'opacity':'0'});
135
+ }else{
136
+ $current_container.fadeTo("slow" , 0, function(){
137
+ $(this).hide().removeClass('fade-in');
138
+ });
139
+ }
140
  }
141
 
142
  } else {
150
  break;
151
  default:
152
  $current_container.show();
153
+ $current_container.fadeTo("slow" , 1).addClass('fade-in');
154
  }
155
  }
156
  }
plugin-fw/assets/js/metabox.min.js CHANGED
@@ -1,7 +1 @@
1
- var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,e,c){a instanceof String&&(a=String(a));for(var b=a.length,d=0;d<b;d++){var f=a[d];if(e.call(c,f,d,a))return{i:d,v:f}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,e,c){a!=Array.prototype&&a!=Object.prototype&&(a[e]=c.value)};
2
- $jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,e,c,b){if(e){c=$jscomp.global;a=a.split(".");for(b=0;b<a.length-1;b++){var d=a[b];d in c||(c[d]={});c=c[d]}a=a[a.length-1];b=c[a];e=e(b);e!=b&&null!=e&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:e})}};
3
- $jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6","es3");
4
- (function(a){function e(b,d,c,e){var f=!0;if("string"==typeof d){":radio"==d.substr(0,6)&&(d+=":checked");var g=a(d).val();"checkbox"==a(d).attr("type")&&(g=a(d).is(":checked")?"yes":"no");c=c.split(",");for(d=0;d<c.length;d++)if(g!=c[d])f=!1;else{f=!0;break}}c=a(b);b=a(b+"-container").parent();e=e.split("-");for(var h in e)if(g=e[h],f)switch(g){case "disable":b.removeClass("yith-disabled");c.attr("disabled",!1);break;case "hideme":c.show();break;default:b.show()}else switch(g){case "disable":b.addClass("yith-disabled");
5
- c.attr("disabled",!0);break;case "hideme":c.hide();break;default:b.hide()}}a(".metaboxes-tab").each(function(){a(".tabs-panel",this).hide();var b=wpCookies.get("active_metabox_tab");b=null==b?a("ul.metaboxes-tabs li:first-child a",this).attr("href"):"#"+b;a(b).show();a(".metaboxes-tabs a",this).click(function(b){if(a(this).parent().hasClass("tabs"))b.preventDefault();else return b=a(this).attr("href"),a(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),a(this).closest(".metaboxes-tab").find(".tabs-panel").hide(),
6
- a(b).show(),!1})});var c=a("#_active_page_options-container").parent().html();a("#_active_page_options-container").parent().remove();a(c).insertAfter("#yit-post-setting .handlediv");a(c).insertAfter("#yit-page-setting .handlediv");a("#_active_page_options-container").on("click",function(){a("#_active_page_options").is(":checked")?a("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:1,"pointer-events":"auto"}):a("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:.5,
7
- "pointer-events":"none"})}).click();a(document.body).on("yith-plugin-fw-metabox-init-deps",function(){a(document.body).trigger("yith-plugin-fw-init-radio");a(".metaboxes-tab [data-dep-target]:not(.yith-plugin-fw-metabox-deps-initialized)").each(function(){var b=a(this),c="#"+b.data("dep-target"),f="#"+b.data("dep-id"),h=b.data("dep-value"),k=b.data("dep-type");e(c,f,h.toString(),k);a(f).on("change",function(){e(c,f,h.toString(),k)}).change();b.addClass("yith-plugin-fw-metabox-deps-initialized")})}).trigger("yith-plugin-fw-metabox-init-deps")})(jQuery);
1
+ !function(h){h(".metaboxes-tab").each(function(){h(".tabs-panel",this).hide();var t=wpCookies.get("active_metabox_tab");t=null==t?h("ul.metaboxes-tabs li:first-child a",this).attr("href"):"#"+t,h(t).show(),h(".metaboxes-tabs a",this).click(function(t){if(!h(this).parent().hasClass("tabs")){var e=h(this).attr("href");return h(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),h(this).closest(".metaboxes-tab").find(".tabs-panel").hide(),h(e).show(),!1}t.preventDefault()})});var t=h("#_active_page_options-container").parent().html();function n(t,e,a,i){var s=!0;if("string"==typeof e){":radio"==e.substr(0,6)&&(e+=":checked");var n=h(e).val();if("checkbox"==h(e).attr("type"))n=h(e).is(":checked")?"yes":"no";a=a.split(",");for(var o=0;o<a.length;o++){if(n==a[o]){s=!0;break}s=!1}}var d,r=h(t),c=h(t+"-container").parent(),l=i.split("-");for(d in l){var p=l[d];if(s)switch(p){case"disable":c.removeClass("yith-disabled"),r.attr("disabled",!1);break;case"hideme":r.show();break;default:c.show(),c.fadeTo("slow",1).addClass("fade-in")}else switch(p){case"disable":c.addClass("yith-disabled"),r.attr("disabled",!0);break;case"hideme":r.hide();break;default:c.hasClass("fade-in")?c.fadeTo("slow",0,function(){h(this).hide().removeClass("fade-in")}):(c.hide(),c.css({opacity:"0"}))}}}h("#_active_page_options-container").parent().remove(),h(t).insertAfter("#yit-post-setting .handlediv"),h(t).insertAfter("#yit-page-setting .handlediv"),h("#_active_page_options-container").on("click",function(){h("#_active_page_options").is(":checked")?h("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:1,"pointer-events":"auto"}):h("#yit-page-setting .inside .metaboxes-tab, #yit-post-setting .inside .metaboxes-tab").css({opacity:.5,"pointer-events":"none"})}).click(),h(document.body).on("yith-plugin-fw-metabox-init-deps",function(){h(document.body).trigger("yith-plugin-fw-init-radio"),h(".metaboxes-tab [data-dep-target]:not(.yith-plugin-fw-metabox-deps-initialized)").each(function(){var t=h(this),e="#"+t.data("dep-target"),a="#"+t.data("dep-id"),i=t.data("dep-value"),s=t.data("dep-type");n(e,a,i.toString(),s),h(a).on("change",function(){n(e,a,i.toString(),s)}).change(),t.addClass("yith-plugin-fw-metabox-deps-initialized")})}).trigger("yith-plugin-fw-metabox-init-deps")}(jQuery);
 
 
 
 
 
 
plugin-fw/assets/js/yit-plugin-panel.js CHANGED
@@ -27,7 +27,6 @@ jQuery( function ( $ ) {
27
  //Handle dependencies.
28
  function dependencies_handler( id, deps, values, type ) {
29
  var result = true;
30
-
31
  //Single dependency
32
  if ( typeof( deps ) == 'string' ) {
33
  if ( deps.substr( 0, 6 ) == ':radio' ) {
@@ -81,7 +80,15 @@ jQuery( function ( $ ) {
81
  $current_field.hide();
82
  break;
83
  default:
84
- $current_container.hide();
 
 
 
 
 
 
 
 
85
  }
86
 
87
  } else {
@@ -95,6 +102,7 @@ jQuery( function ( $ ) {
95
  break;
96
  default:
97
  $current_container.show();
 
98
  }
99
  }
100
  }
27
  //Handle dependencies.
28
  function dependencies_handler( id, deps, values, type ) {
29
  var result = true;
 
30
  //Single dependency
31
  if ( typeof( deps ) == 'string' ) {
32
  if ( deps.substr( 0, 6 ) == ':radio' ) {
80
  $current_field.hide();
81
  break;
82
  default:
83
+ if( ! $current_container.hasClass('fade-in')){
84
+ $current_container.hide();
85
+ $current_container.css({'opacity':'0'});
86
+ }else{
87
+ $current_container.fadeTo("slow" , 0, function(){
88
+ $(this).hide().removeClass('fade-in');
89
+ });
90
+ }
91
+
92
  }
93
 
94
  } else {
102
  break;
103
  default:
104
  $current_container.show();
105
+ $current_container.fadeTo("slow" , 1).addClass('fade-in');
106
  }
107
  }
108
  }
plugin-fw/assets/js/yit-plugin-panel.min.js CHANGED
@@ -1,7 +1 @@
1
- var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,e,b){a instanceof String&&(a=String(a));for(var c=a.length,d=0;d<c;d++){var g=a[d];if(e.call(b,g,d,a))return{i:d,v:g}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,e,b){a!=Array.prototype&&a!=Object.prototype&&(a[e]=b.value)};
2
- $jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,e,b,c){if(e){b=$jscomp.global;a=a.split(".");for(c=0;c<a.length-1;c++){var d=a[c];d in b||(b[d]={});b=b[d]}a=a[a.length-1];c=b[a];e=e(c);e!=c&&null!=e&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:e})}};
3
- $jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");
4
- jQuery(function(a){function e(b,c,d,e){var f=!0;if("string"==typeof c){":radio"==c.substr(0,6)&&(c+=":checked");var h=a(c).val();"checkbox"==a(c).attr("type")&&(h=a(c).is(":checked")?"yes":"no");d=d.split(",");for(c=0;c<d.length;c++)if(h!=d[c])f=!1;else{f=!0;break}}d=a(b);b=a(b+"-container").closest("tr");1>b.length&&(b=d.closest(".yith-plugin-fw-panel-wc-row"));e=e.split("-");for(var g in e)if(h=e[g],f)switch(h){case "disable":b.removeClass("yith-disabled");d.attr("disabled",!1);break;case "hideme":d.show();
5
- break;default:b.show()}else switch(h){case "disable":b.addClass("yith-disabled");d.attr("disabled",!0);break;case "hideme":d.hide();break;default:b.hide()}}a("[data-dep-target]").each(function(){var b=a(this),c="#"+b.data("dep-target"),d="#"+b.data("dep-id"),g=b.data("dep-value"),f=b.data("dep-type");e(c,d,g.toString(),f);a(d).on("change",function(){e(c,d,g.toString(),f)}).change()});a(".rm_connectedlist").each(function(){var b=a(this).find("ul"),c=a(this).find(":hidden");b.sortable({connectWith:b,
6
- update:function(d,e){var f={};b.each(function(){var b={};a(this).children().each(function(){b[a(this).data("option")]=a(this).text()});f[a(this).data("list")]=b});c.val(JSON.stringify(f).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()});a(document).ready(function(){a(".google-analytic-generate").click(function(){var b=a("#"+a(this).data("textarea")).data("codemirrorInstance"),c=a("#"+a(this).data("input")).val(),d=a(this).data("basename");b.replaceRange("(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n"+
7
- ("ga('create', '"+c+"', '"+d+"');\n")+"ga('send', 'pageview');\n",b.getCursor("start"),b.getCursor("end"))})});a(".yith-plugin-fw-panel .woo-nav-tab-wrapper").removeClass("woo-nav-tab-wrapper").addClass("yith-nav-tab-wrapper")});
1
+ jQuery(function(f){function s(a,e,t,i){var n=!0;if("string"==typeof e){":radio"==e.substr(0,6)&&(e+=":checked");var s=f(e).val();if("checkbox"==f(e).attr("type"))s=f(e).is(":checked")?"yes":"no";t=t.split(",");for(var r=0;r<t.length;r++){if(s==t[r]){n=!0;break}n=!1}}var o=f(a),d=f(a+"-container").closest("tr");d.length<1&&(d=o.closest(".yith-plugin-fw-panel-wc-row"));var c,l=i.split("-");for(c in l){var h=l[c];if(n)switch(h){case"disable":d.removeClass("yith-disabled"),o.attr("disabled",!1);break;case"hideme":o.show();break;default:d.show(),d.fadeTo("slow",1).addClass("fade-in")}else switch(h){case"disable":d.addClass("yith-disabled"),o.attr("disabled",!0);break;case"hideme":o.hide();break;default:d.hasClass("fade-in")?d.fadeTo("slow",0,function(){f(this).hide().removeClass("fade-in")}):(d.hide(),d.css({opacity:"0"}))}}}f("[data-dep-target]").each(function(){var a=f(this),e="#"+a.data("dep-target"),t="#"+a.data("dep-id"),i=a.data("dep-value"),n=a.data("dep-type");s(e,t,i.toString(),n),f(t).on("change",function(){s(e,t,i.toString(),n)}).change()}),f(".rm_connectedlist").each(function(){var i=f(this).find("ul"),n=f(this).find(":hidden");i.sortable({connectWith:i,update:function(a,e){var t={};i.each(function(){var a={};f(this).children().each(function(){a[f(this).data("option")]=f(this).text()}),t[f(this).data("list")]=a}),n.val(JSON.stringify(t).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()}),f(document).ready(function(){f(".google-analytic-generate").click(function(){var a=f("#"+f(this).data("textarea")).data("codemirrorInstance"),e="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n";e+="(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\n",e+="m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n",e+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n",e+="ga('create', '"+f("#"+f(this).data("input")).val()+"', '"+f(this).data("basename")+"');\n",e+="ga('send', 'pageview');\n",a.replaceRange(e,a.getCursor("start"),a.getCursor("end"))})}),f(".yith-plugin-fw-panel .woo-nav-tab-wrapper").removeClass("woo-nav-tab-wrapper").addClass("yith-nav-tab-wrapper")});
 
 
 
 
 
 
plugin-fw/assets/js/yith-fields.js CHANGED
@@ -457,7 +457,13 @@
457
  action = 'yith_plugin_fw_save_toggle_element_metabox';
458
  post_id = $( this ).closest( 'form#post' ).find( '#post_ID' ).val();
459
  yit_metaboxes_nonce = $( this ).closest( 'form#post' ).find( '#yit_metaboxes_nonce' ).val();
460
- url = yith_framework_fw_fields.ajax_url + '?action=' + action + "&post_ID=" + post_id + '&yit_metaboxes_nonce=' + yit_metaboxes_nonce + "&toggle_id=" + id;
 
 
 
 
 
 
461
  } else {
462
  url = yith_framework_fw_fields.admin_url + '?action=' + action + '&tab=' + current_tab + "&toggle_id=" + id;
463
  }
457
  action = 'yith_plugin_fw_save_toggle_element_metabox';
458
  post_id = $( this ).closest( 'form#post' ).find( '#post_ID' ).val();
459
  yit_metaboxes_nonce = $( this ).closest( 'form#post' ).find( '#yit_metaboxes_nonce' ).val();
460
+ metabox_tab = $( this ).closest( '.tabs-panel' ).attr( 'id' );
461
+ url = yith_framework_fw_fields.ajax_url +
462
+ '?action=' + action +
463
+ "&post_ID=" + post_id +
464
+ '&yit_metaboxes_nonce=' + yit_metaboxes_nonce +
465
+ "&toggle_id=" + id +
466
+ "&metabox_tab=" + metabox_tab;
467
  } else {
468
  url = yith_framework_fw_fields.admin_url + '?action=' + action + '&tab=' + current_tab + "&toggle_id=" + id;
469
  }
plugin-fw/assets/js/yith-fields.min.js CHANGED
@@ -16,14 +16,15 @@ function(){a("#"+a(this).data("select-id")).find("option").prop("selected",!1).t
16
  e.addClass("active")});b.on("click",".yit-icons-manager-action-set-default",function(){b.find(".yit-icons-manager-list li.default").trigger("click")})});a(document).on("click",".yith-plugin-fw-select-images__item",function(){var b=a(this),c=b.data("key"),d=b.closest(".yith-plugin-fw-select-images__wrapper"),e=d.find(".yith-plugin-fw-select-images__item");d=d.find("select").first();d.length&&(d.val(c),e.removeClass("yith-plugin-fw-select-images__item--selected"),b.addClass("yith-plugin-fw-select-images__item--selected"))});
17
  a(document.body).trigger("wc-enhanced-select-init");a(document).find(".ui-sortable .yith-toggle-elements").sortable({cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",stop:function(b,c){b=jQuery(".ui-sortable-handle");var d=[];for(c=0;c<b.length;c++)d[c]=a(b[c]).data("item_key");0<d.length&&a(this).closest(".toggle-element").saveToggleElement(null,d)}});a(document.body).trigger("yith-framework-enhanced-select-init")}).trigger("yith_fields_init");a(document).on("click",
18
  ".yith-plugin-fw-onoff-container span",function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a.fn.saveToggleElement=function(b,c){var d=a(this),e="yith_plugin_fw_save_toggle_element",g=d.serializeToggleElement(),h=d.find(".yith-toggle_wrapper"),k=h.attr("id"),l=a.urlParam("tab");g.append("security",h.data("nonce"));"undefined"!=typeof c&&0<c.length&&
19
- g.append("yith_toggle_elements_order_keys",c);d.closest(".metaboxes-tab.yith-plugin-ui").length?(e="yith_plugin_fw_save_toggle_element_metabox",post_id=a(this).closest("form#post").find("#post_ID").val(),yit_metaboxes_nonce=a(this).closest("form#post").find("#yit_metaboxes_nonce").val(),url=yith_framework_fw_fields.ajax_url+"?action="+e+"&post_ID="+post_id+"&yit_metaboxes_nonce="+yit_metaboxes_nonce+"&toggle_id="+k):url=yith_framework_fw_fields.admin_url+"?action="+e+"&tab="+l+"&toggle_id="+k;a.ajax({type:"POST",
20
- url:url,data:g,contentType:!1,processData:!1,success:function(c){b&&b.removeClass("show");a(document).trigger("yith_save_toggle_element_done",[c,d])}})};a.fn.serializeToggleElement=function(){var b=a(this),c=new FormData;b=a(b).find(":input").serializeArray();a.each(b,function(a,b){el_name=b.name;c.append(b.name,b.value)});return c};a.fn.formatToggleTitle=function(){var b=a(this),c=b.find(":input"),d=b.find("span.title").data("title_format"),e=b.find(".subtitle").data("subtitle_format"),g=/[^%%]+(?=[%%])/g;
21
- if("undefined"!=typeof d)var h=d.match(g);if("undefined"!=typeof e)var k=e.match(g);a.each(c,function(b,c){"undefined"!=typeof a(c).attr("id")&&($field_id=a(c).attr("id"),$field_array=$field_id.split("_"),$field_array.pop(),$field_id=$field_array.join("_"),$field_val=a(c).val(),null!=h&&"undefined"!=typeof h&&-1!==h.indexOf($field_id)&&(d=d.replace("%%"+$field_id+"%%",$field_val)),null!=k&&"undefined"!=typeof k&&-1!==k.indexOf($field_id)&&(e=e.replace("%%"+$field_id+"%%",$field_val)))});""!==d&&b.find("span.title").html(d);
22
- ""!==e&&b.find(".subtitle").html(e);a(document).trigger("yith-toggle-element-item-title",[b])};a.urlParam=function(a){a=(new RegExp("[?&]"+a+"=([^&#]*)")).exec(window.location.search);return null!==a?a[1]||0:!1};a(document).on("click",".yith-toggle-title",function(b){b=a(b.target);var c=b.closest(".yith-toggle-row"),d=c.find(".yith-toggle-content");if(b.hasClass("yith-plugin-fw-onoff")||b.hasClass("yith-icon-drag"))return!1;c.is(".yith-toggle-row-opened")?d.slideUp(400):d.slideDown(400);c.toggleClass("yith-toggle-row-opened")});
23
- a(document).on("click",".yith-add-box-button",function(b){b.preventDefault();b=a(this);var c=b.data("box_id"),d=b.data("closed_label"),e=b.data("opened_label"),g=b.closest(".yith-toggle_wrapper").attr("id");template=wp.template("yith-toggle-element-add-box-content-"+g);""!==c&&(a("#"+c).html(template({index:"box_id"})).slideToggle(),""!==d&&(b.html()===d?b.html(e).removeClass("closed"):b.html(d).addClass("closed")),a(document).trigger("yith_fields_init"),a(document).trigger("yith-add-box-button-toggle",
24
- [b]))});a(document).on("click",".yith-add-box-buttons .yith-save-button",function(b){b.preventDefault();var c=a(this).parents(".yith-add-box"),d=a(this).closest(".yith-toggle_wrapper").attr("id");b=c.find(".spinner");var e=a(this).parents(".toggle-element"),g=c.find(":input"),h=e.find(".yith-toggle-row").length,k=a('<input type="hidden">');k.val(h);a(document).trigger("yith-toggle-change-counter",[k,c]);h=k.val();d=wp.template("yith-toggle-element-item-"+d);var l=a(d({index:h}));b.addClass("show");
25
- a.each(g,function(b,c){"undefined"!=typeof a(c).attr("id")&&($field_id=a(c).attr("id"),$field_val=a(c).val(),"radio"==a(c).attr("type")?($field_id=$field_id.replace("new_",""),$field_id=$field_id.replace("-"+$field_val,""),$field_id=$field_id+"_dataindex-"+$field_val):$field_id=$field_id.replace("new_","")+"_"+h,a(c).is(":checked")&&a(l).find("#"+$field_id).prop("checked",!0),(a(c).hasClass("yith-post-search")||a(c).hasClass("yith-term-search"))&&a(l).find("#"+$field_id).html(a("#"+a(c).attr("id")).html()),
26
- a(l).find("#"+$field_id).val($field_val))});a(l).formatToggleTitle();var m=a('<input type="hidden">').val("yes");a(document).trigger("yith-toggle-element-item-before-add",[c,l,m]);setTimeout(function(){"yes"===m.val()&&(a(e).find(".yith-toggle-elements").append(l),a(c).find(".yith-plugin-fw-datepicker").datepicker("destroy"),a(c).html(""),a(c).prev(".yith-add-box-button").trigger("click"),e.saveToggleElement(),setTimeout(function(){a(e).find(".highlight").removeClass("highlight")},2E3),a(document).trigger("yith_fields_init"))},
27
- 1E3)});a(document).on("click",".yith-toggle-row .yith-save-button",function(b){b.preventDefault();b=a(this).closest(".toggle-element");var c=a(this).closest(".yith-toggle-row"),d=c.find(".spinner");c.formatToggleTitle();var e=a('<input type="hidden">').val("yes");a(document).trigger("yith-toggle-element-item-before-update",[b,c,e]);"yes"===e.val()&&(d.addClass("show"),b.saveToggleElement(d))});a(document).on("click",".yith-toggle-row .yith-delete-button",function(b){b.preventDefault();b=a(this).closest(".toggle-element");
28
- a(this).closest(".yith-toggle-row").remove();b.saveToggleElement()});a(document).on("click",".yith-toggle-onoff",function(b){b.preventDefault();a(this).closest(".toggle-element").saveToggleElement()});a(document).on("click",".yith-plugin-fw-radio input[type=radio]",function(){a(this).closest(".yith-plugin-fw-radio").val(a(this).val()).trigger("change")});a(document).on("click",".yith-password-eye",function(){var b=a(this),c=a(this).closest(".yith-password-wrapper").find("input");"password"===c.attr("type")?
29
- (c.attr("type","text"),b.addClass("yith-password-eye-closed")):(c.attr("type","password"),b.removeClass("yith-password-eye-closed"))});a(document.body).on("yith-plugin-fw-init-radio",function(){a(".yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)").each(function(){a(this).val(a(this).attr("value"));a(this).addClass("yith-plugin-fw-radio--initialized")})}).trigger("yith-plugin-fw-init-radio");a(document).on("select2:open",function(b){a(b.target).closest(".yith-plugin-ui").length&&a(".select2-results").closest(".select2-container").addClass("yith-plugin-fw-select2-container")})})(jQuery);
 
16
  e.addClass("active")});b.on("click",".yit-icons-manager-action-set-default",function(){b.find(".yit-icons-manager-list li.default").trigger("click")})});a(document).on("click",".yith-plugin-fw-select-images__item",function(){var b=a(this),c=b.data("key"),d=b.closest(".yith-plugin-fw-select-images__wrapper"),e=d.find(".yith-plugin-fw-select-images__item");d=d.find("select").first();d.length&&(d.val(c),e.removeClass("yith-plugin-fw-select-images__item--selected"),b.addClass("yith-plugin-fw-select-images__item--selected"))});
17
  a(document.body).trigger("wc-enhanced-select-init");a(document).find(".ui-sortable .yith-toggle-elements").sortable({cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",stop:function(b,c){b=jQuery(".ui-sortable-handle");var d=[];for(c=0;c<b.length;c++)d[c]=a(b[c]).data("item_key");0<d.length&&a(this).closest(".toggle-element").saveToggleElement(null,d)}});a(document.body).trigger("yith-framework-enhanced-select-init")}).trigger("yith_fields_init");a(document).on("click",
18
  ".yith-plugin-fw-onoff-container span",function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a.fn.saveToggleElement=function(b,c){var d=a(this),e="yith_plugin_fw_save_toggle_element",g=d.serializeToggleElement(),h=d.find(".yith-toggle_wrapper"),k=h.attr("id"),l=a.urlParam("tab");g.append("security",h.data("nonce"));"undefined"!=typeof c&&0<c.length&&
19
+ g.append("yith_toggle_elements_order_keys",c);d.closest(".metaboxes-tab.yith-plugin-ui").length?(e="yith_plugin_fw_save_toggle_element_metabox",post_id=a(this).closest("form#post").find("#post_ID").val(),yit_metaboxes_nonce=a(this).closest("form#post").find("#yit_metaboxes_nonce").val(),metabox_tab=a(this).closest(".tabs-panel").attr("id"),url=yith_framework_fw_fields.ajax_url+"?action="+e+"&post_ID="+post_id+"&yit_metaboxes_nonce="+yit_metaboxes_nonce+"&toggle_id="+k+"&metabox_tab="+metabox_tab):
20
+ url=yith_framework_fw_fields.admin_url+"?action="+e+"&tab="+l+"&toggle_id="+k;a.ajax({type:"POST",url:url,data:g,contentType:!1,processData:!1,success:function(c){b&&b.removeClass("show");a(document).trigger("yith_save_toggle_element_done",[c,d])}})};a.fn.serializeToggleElement=function(){var b=a(this),c=new FormData;b=a(b).find(":input").serializeArray();a.each(b,function(a,b){el_name=b.name;c.append(b.name,b.value)});return c};a.fn.formatToggleTitle=function(){var b=a(this),c=b.find(":input"),d=
21
+ b.find("span.title").data("title_format"),e=b.find(".subtitle").data("subtitle_format"),g=/[^%%]+(?=[%%])/g;if("undefined"!=typeof d)var h=d.match(g);if("undefined"!=typeof e)var k=e.match(g);a.each(c,function(b,c){"undefined"!=typeof a(c).attr("id")&&($field_id=a(c).attr("id"),$field_array=$field_id.split("_"),$field_array.pop(),$field_id=$field_array.join("_"),$field_val=a(c).val(),null!=h&&"undefined"!=typeof h&&-1!==h.indexOf($field_id)&&(d=d.replace("%%"+$field_id+"%%",$field_val)),null!=k&&
22
+ "undefined"!=typeof k&&-1!==k.indexOf($field_id)&&(e=e.replace("%%"+$field_id+"%%",$field_val)))});""!==d&&b.find("span.title").html(d);""!==e&&b.find(".subtitle").html(e);a(document).trigger("yith-toggle-element-item-title",[b])};a.urlParam=function(a){a=(new RegExp("[?&]"+a+"=([^&#]*)")).exec(window.location.search);return null!==a?a[1]||0:!1};a(document).on("click",".yith-toggle-title",function(b){b=a(b.target);var c=b.closest(".yith-toggle-row"),d=c.find(".yith-toggle-content");if(b.hasClass("yith-plugin-fw-onoff")||
23
+ b.hasClass("yith-icon-drag"))return!1;c.is(".yith-toggle-row-opened")?d.slideUp(400):d.slideDown(400);c.toggleClass("yith-toggle-row-opened")});a(document).on("click",".yith-add-box-button",function(b){b.preventDefault();b=a(this);var c=b.data("box_id"),d=b.data("closed_label"),e=b.data("opened_label"),g=b.closest(".yith-toggle_wrapper").attr("id");template=wp.template("yith-toggle-element-add-box-content-"+g);""!==c&&(a("#"+c).html(template({index:"box_id"})).slideToggle(),""!==d&&(b.html()===d?
24
+ b.html(e).removeClass("closed"):b.html(d).addClass("closed")),a(document).trigger("yith_fields_init"),a(document).trigger("yith-add-box-button-toggle",[b]))});a(document).on("click",".yith-add-box-buttons .yith-save-button",function(b){b.preventDefault();var c=a(this).parents(".yith-add-box"),d=a(this).closest(".yith-toggle_wrapper").attr("id");b=c.find(".spinner");var e=a(this).parents(".toggle-element"),g=c.find(":input"),h=e.find(".yith-toggle-row").length,k=a('<input type="hidden">');k.val(h);
25
+ a(document).trigger("yith-toggle-change-counter",[k,c]);h=k.val();d=wp.template("yith-toggle-element-item-"+d);var l=a(d({index:h}));b.addClass("show");a.each(g,function(b,c){"undefined"!=typeof a(c).attr("id")&&($field_id=a(c).attr("id"),$field_val=a(c).val(),"radio"==a(c).attr("type")?($field_id=$field_id.replace("new_",""),$field_id=$field_id.replace("-"+$field_val,""),$field_id=$field_id+"_dataindex-"+$field_val):$field_id=$field_id.replace("new_","")+"_"+h,a(c).is(":checked")&&a(l).find("#"+
26
+ $field_id).prop("checked",!0),(a(c).hasClass("yith-post-search")||a(c).hasClass("yith-term-search"))&&a(l).find("#"+$field_id).html(a("#"+a(c).attr("id")).html()),a(l).find("#"+$field_id).val($field_val))});a(l).formatToggleTitle();var m=a('<input type="hidden">').val("yes");a(document).trigger("yith-toggle-element-item-before-add",[c,l,m]);setTimeout(function(){"yes"===m.val()&&(a(e).find(".yith-toggle-elements").append(l),a(c).find(".yith-plugin-fw-datepicker").datepicker("destroy"),a(c).html(""),
27
+ a(c).prev(".yith-add-box-button").trigger("click"),e.saveToggleElement(),setTimeout(function(){a(e).find(".highlight").removeClass("highlight")},2E3),a(document).trigger("yith_fields_init"))},1E3)});a(document).on("click",".yith-toggle-row .yith-save-button",function(b){b.preventDefault();b=a(this).closest(".toggle-element");var c=a(this).closest(".yith-toggle-row"),d=c.find(".spinner");c.formatToggleTitle();var e=a('<input type="hidden">').val("yes");a(document).trigger("yith-toggle-element-item-before-update",
28
+ [b,c,e]);"yes"===e.val()&&(d.addClass("show"),b.saveToggleElement(d))});a(document).on("click",".yith-toggle-row .yith-delete-button",function(b){b.preventDefault();b=a(this).closest(".toggle-element");a(this).closest(".yith-toggle-row").remove();b.saveToggleElement()});a(document).on("click",".yith-toggle-onoff",function(b){b.preventDefault();a(this).closest(".toggle-element").saveToggleElement()});a(document).on("click",".yith-plugin-fw-radio input[type=radio]",function(){a(this).closest(".yith-plugin-fw-radio").val(a(this).val()).trigger("change")});
29
+ a(document).on("click",".yith-password-eye",function(){var b=a(this),c=a(this).closest(".yith-password-wrapper").find("input");"password"===c.attr("type")?(c.attr("type","text"),b.addClass("yith-password-eye-closed")):(c.attr("type","password"),b.removeClass("yith-password-eye-closed"))});a(document.body).on("yith-plugin-fw-init-radio",function(){a(".yith-plugin-fw-radio:not(.yith-plugin-fw-radio--initialized)").each(function(){a(this).val(a(this).attr("value"));a(this).addClass("yith-plugin-fw-radio--initialized")})}).trigger("yith-plugin-fw-init-radio");
30
+ a(document).on("select2:open",function(b){a(b.target).closest(".yith-plugin-ui").length&&a(".select2-results").closest(".select2-container").addClass("yith-plugin-fw-select2-container")})})(jQuery);
plugin-fw/init.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.4.7
5
  * Author: YITHEMES
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
- * @version 3.4.7
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 3.4.8
5
  * Author: YITHEMES
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
+ * @version 3.4.8
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
plugin-fw/lib/yit-cpt-unlimited.php CHANGED
@@ -138,8 +138,10 @@ class YIT_CPT_Unlimited {
138
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_assets' ) );
139
 
140
  // metaboxes
141
- add_action( 'add_meta_boxes', array( $this, 'add_metabox_cptu' ), 2 );
142
- add_action( 'add_meta_boxes', array( $this, 'add_metabox_item_fields' ), 2 );
 
 
143
 
144
  // multiuploader
145
  if ( $this->_args['add_multiuploader'] ) {
138
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_assets' ) );
139
 
140
  // metaboxes
141
+ if ( is_admin() ) {
142
+ add_action( 'init', array( $this, 'add_metabox_cptu' ) );
143
+ add_action( 'init', array( $this, 'add_metabox_item_fields' ) );
144
+ }
145
 
146
  // multiuploader
147
  if ( $this->_args['add_multiuploader'] ) {
plugin-fw/lib/yit-metabox.php CHANGED
@@ -461,19 +461,27 @@ if ( !class_exists( 'YIT_Metabox' ) ) {
461
  }
462
  }
463
 
464
- $this->sanitize_fields( $post_id );
465
 
 
 
466
 
 
 
 
 
 
 
 
467
  }
468
 
469
  /**
470
- * Sanitize the fields of metabox.
471
  *
472
  * @return void
473
- * @since 3.2.1
474
- * @author Emanuela Castorina
475
  */
476
- public function sanitize_fields( $post_id ) {
477
  $this->reorder_tabs();
478
  $tabs_to_sanitize = $this->tabs;
479
  $allow_ajax = isset( $_REQUEST[ 'yith_metabox_allow_ajax_saving' ] ) && $this->id === $_REQUEST[ 'yith_metabox_allow_ajax_saving' ];
@@ -489,61 +497,67 @@ if ( !class_exists( 'YIT_Metabox' ) ) {
489
  }
490
  }
491
 
492
-
493
-
494
-
495
  foreach ( $tabs_to_sanitize as $tab ) {
496
-
497
  foreach ( $tab[ 'fields' ] as $field ) {
 
 
 
 
498
 
499
- if ( in_array( $field[ 'type' ], array( 'title' ) ) ) {
500
- continue;
501
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
502
 
503
- if ( isset( $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ] ) ) {
504
- if ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
505
- update_post_meta( $post_id, $field[ 'id' ], '1' );
506
- } elseif ( in_array( $field[ 'type' ], array( 'toggle-element' ) ) ) {
507
- if ( isset( $field[ 'elements' ] ) && $field[ 'elements' ] ) {
508
- $elements_value = $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ];
509
- if ( $elements_value ) {
510
- if ( isset( $elements_value[ 'box_id' ] ) ) {
511
- unset( $elements_value[ 'box_id' ] );
512
  }
513
 
514
- foreach ( $field[ 'elements' ] as $element ) {
515
- foreach ( $elements_value as $key => $element_value ) {
516
- if ( isset( $field[ 'onoff_field' ] ) ) {
517
- $elements_value[ $key ][ $field[ 'onoff_field' ][ 'id' ] ] = !isset( $element_value[ $field[ 'onoff_field' ][ 'id' ] ] ) ? 0 : $element_value[ $field[ 'onoff_field' ][ 'id' ] ];
518
- }
519
- if ( in_array( $element[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
520
- $elements_value[ $key ][ $element[ 'id' ] ] = !isset( $element_value[ $element[ 'id' ] ] ) ? 0 : 1;
521
- }
522
-
523
- if ( !empty( $element[ 'yith-sanitize-callback' ] ) && is_callable( $element[ 'yith-sanitize-callback' ] ) ) {
524
- $elements_value[ $key ][ $element[ 'id' ] ] = call_user_func( $element[ 'yith-sanitize-callback' ], $elements_value[ $key ][ $element[ 'id' ] ] );
525
- }
526
- }
527
  }
528
  }
529
-
530
- update_post_meta( $post_id, $field[ 'id' ], maybe_serialize( $elements_value ) );
531
  }
532
- } else {
533
- $value = $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ];
534
- if ( !empty( $field[ 'yith-sanitize-callback' ] ) && is_callable( $field[ 'yith-sanitize-callback' ] ) ) {
535
- $value = call_user_func( $field[ 'yith-sanitize-callback' ], $value );
536
- }
537
- add_post_meta( $post_id, $field[ 'id' ], $value, true ) || update_post_meta( $post_id, $field[ 'id' ], $value );
538
  }
539
- } elseif ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
540
- update_post_meta( $post_id, $field[ 'id' ], '0' );
541
- } elseif ( in_array( $field[ 'type' ], array( 'checkbox-array' ) ) ) {
542
- update_post_meta( $post_id, $field[ 'id' ], array() );
543
- } else {
544
- delete_post_meta( $post_id, $field[ 'id' ] );
 
545
  }
 
546
  }
 
 
 
 
 
 
547
  }
548
  }
549
 
@@ -579,13 +593,26 @@ if ( !class_exists( 'YIT_Metabox' ) ) {
579
  }
580
  $post_id = $_REQUEST[ 'post_ID' ];
581
 
582
- if ( isset( $_REQUEST[ 'yit_metaboxes' ] ) ) {
583
  $yit_metabox_data = $_REQUEST[ 'yit_metaboxes' ];
 
 
 
 
 
584
 
585
  if ( is_array( $yit_metabox_data ) ) {
586
- $this->sanitize_fields( $post_id );
 
 
 
 
 
 
 
 
587
  }
588
- } elseif ( !isset( $_REQUEST[ 'yit_metaboxes' ] ) || !isset( $_REQUEST[ 'yit_metaboxes' ][ $_REQUEST[ 'toggle_id' ] ] ) ) {
589
  delete_post_meta( $post_id, $_REQUEST[ 'toggle_id' ] );
590
  }
591
  }
461
  }
462
  }
463
 
464
+ $this->sanitize_and_save_fields( $post_id );
465
 
466
+ return $post_id;
467
+ }
468
 
469
+ /**
470
+ * @param $post_id
471
+ * @since 3.2.1
472
+ * @deprecated since 3.4.8
473
+ */
474
+ public function sanitize_fields( $post_id ) {
475
+ $this->sanitize_and_save_fields( $post_id );
476
  }
477
 
478
  /**
479
+ * Sanitize and save fields of the Metabox.
480
  *
481
  * @return void
482
+ * @since 3.4.8
 
483
  */
484
+ public function sanitize_and_save_fields( $post_id ) {
485
  $this->reorder_tabs();
486
  $tabs_to_sanitize = $this->tabs;
487
  $allow_ajax = isset( $_REQUEST[ 'yith_metabox_allow_ajax_saving' ] ) && $this->id === $_REQUEST[ 'yith_metabox_allow_ajax_saving' ];
497
  }
498
  }
499
 
 
 
 
500
  foreach ( $tabs_to_sanitize as $tab ) {
 
501
  foreach ( $tab[ 'fields' ] as $field ) {
502
+ $this->sanitize_and_save_field( $field, $post_id );
503
+ }
504
+ }
505
+ }
506
 
507
+ /**
508
+ * Sanitize and save a single field
509
+ *
510
+ * @param array $field
511
+ * @param int $post_id
512
+ * @since 3.4.8
513
+ */
514
+ public function sanitize_and_save_field( $field, $post_id ) {
515
+ if ( in_array( $field[ 'type' ], array( 'title' ) ) ) {
516
+ return;
517
+ }
518
+
519
+ if ( isset( $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ] ) ) {
520
+ if ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
521
+ update_post_meta( $post_id, $field[ 'id' ], '1' );
522
+ } elseif ( in_array( $field[ 'type' ], array( 'toggle-element' ) ) ) {
523
+ if ( isset( $field[ 'elements' ] ) && $field[ 'elements' ] ) {
524
+ $elements_value = $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ];
525
+ if ( $elements_value ) {
526
+ if ( isset( $elements_value[ 'box_id' ] ) ) {
527
+ unset( $elements_value[ 'box_id' ] );
528
+ }
529
 
530
+ foreach ( $field[ 'elements' ] as $element ) {
531
+ foreach ( $elements_value as $key => $element_value ) {
532
+ if ( isset( $field[ 'onoff_field' ] ) ) {
533
+ $elements_value[ $key ][ $field[ 'onoff_field' ][ 'id' ] ] = !isset( $element_value[ $field[ 'onoff_field' ][ 'id' ] ] ) ? 0 : $element_value[ $field[ 'onoff_field' ][ 'id' ] ];
534
+ }
535
+ if ( in_array( $element[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
536
+ $elements_value[ $key ][ $element[ 'id' ] ] = !isset( $element_value[ $element[ 'id' ] ] ) ? 0 : 1;
 
 
537
  }
538
 
539
+ if ( !empty( $element[ 'yith-sanitize-callback' ] ) && is_callable( $element[ 'yith-sanitize-callback' ] ) ) {
540
+ $elements_value[ $key ][ $element[ 'id' ] ] = call_user_func( $element[ 'yith-sanitize-callback' ], $elements_value[ $key ][ $element[ 'id' ] ] );
 
 
 
 
 
 
 
 
 
 
 
541
  }
542
  }
 
 
543
  }
 
 
 
 
 
 
544
  }
545
+
546
+ update_post_meta( $post_id, $field[ 'id' ], maybe_serialize( $elements_value ) );
547
+ }
548
+ } else {
549
+ $value = $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ];
550
+ if ( !empty( $field[ 'yith-sanitize-callback' ] ) && is_callable( $field[ 'yith-sanitize-callback' ] ) ) {
551
+ $value = call_user_func( $field[ 'yith-sanitize-callback' ], $value );
552
  }
553
+ add_post_meta( $post_id, $field[ 'id' ], $value, true ) || update_post_meta( $post_id, $field[ 'id' ], $value );
554
  }
555
+ } elseif ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
556
+ update_post_meta( $post_id, $field[ 'id' ], '0' );
557
+ } elseif ( in_array( $field[ 'type' ], array( 'checkbox-array' ) ) ) {
558
+ update_post_meta( $post_id, $field[ 'id' ], array() );
559
+ } else {
560
+ delete_post_meta( $post_id, $field[ 'id' ] );
561
  }
562
  }
563
 
593
  }
594
  $post_id = $_REQUEST[ 'post_ID' ];
595
 
596
+ if ( isset( $_REQUEST[ 'yit_metaboxes' ], $_REQUEST[ 'toggle_id' ], $_REQUEST[ 'metabox_tab' ], $_REQUEST[ 'yit_metaboxes' ][ $_REQUEST[ 'toggle_id' ] ] ) ) {
597
  $yit_metabox_data = $_REQUEST[ 'yit_metaboxes' ];
598
+ $metabox_tab = $_REQUEST[ 'metabox_tab' ];
599
+ $field_id = $_REQUEST[ 'toggle_id' ];
600
+ if ( strpos( $field_id, '_' ) === 0 ) {
601
+ $field_id = substr( $field_id, 1 );
602
+ }
603
 
604
  if ( is_array( $yit_metabox_data ) ) {
605
+ $this->reorder_tabs();
606
+ $tabs = $this->tabs;
607
+
608
+ if ( isset( $tabs[ $metabox_tab ], $tabs[ $metabox_tab ][ 'fields' ] ) && isset( $tabs[ $metabox_tab ][ 'fields' ][ $field_id ] ) ) {
609
+ $field = $tabs[ $metabox_tab ][ 'fields' ][ $field_id ];
610
+ if ( $field ) {
611
+ $this->sanitize_and_save_field( $field, $post_id );
612
+ }
613
+ }
614
  }
615
+ } elseif ( isset( $_REQUEST[ 'toggle_id' ] ) ) {
616
  delete_post_meta( $post_id, $_REQUEST[ 'toggle_id' ] );
617
  }
618
  }
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -1222,41 +1222,25 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
1222
  }
1223
 
1224
  if ( $this->is_free() && isset( $this->settings[ 'plugin_slug' ] ) ):
1225
- $banners = apply_filters( 'yith_plugin_fw_banners_free', array(
1226
- 'upgrade' => array(
1227
- 'image' => YIT_CORE_PLUGIN_URL . '/assets/images/upgrade_banner.png',
1228
- 'link' => 'https://yithemes.com/themes/plugins/' . $this->settings[ 'plugin_slug' ],
1229
- ),
1230
- 'rate' => array(
1231
- 'image' => YIT_CORE_PLUGIN_URL . '/assets/images/rate_banner.png',
1232
- 'link' => 'https://wordpress.org/support/plugin/' . $this->settings[ 'plugin_slug' ] . '/reviews/?rate=5#new-post',
1233
- ),
1234
- ), $page );
1235
  ?>
1236
  <h1 class="notice-container"></h1>
1237
- <div class="yith-plugin-fw-banner yith-plugin-fw-banner-free">
1238
  <h1><?php echo esc_html( $this->settings[ 'page_title' ] ) ?></h1>
1239
- <?php if ( $banners ) : ?>
1240
- <div class="yith-banners">
1241
- <ul>
1242
- <?php foreach ( $banners as $banner ): ?>
1243
- <li><a href="<?php echo esc_url( $banner[ 'link' ] ) ?>" target="_blank"><img src="<?php echo esc_url( $banner[ 'image' ] ) ?>"></a></li>
1244
- <?php endforeach; ?>
1245
- </ul>
1246
- </div>
1247
-
1248
- <?php endif ?>
1249
  </div>
 
 
 
 
 
 
 
 
1250
  <?php else: ?>
1251
  <h1 class="notice-container"></h1>
1252
  <div class="yith-plugin-fw-banner">
1253
- <h1><?php echo esc_html( $this->settings[ 'page_title' ] ) ?>
1254
- <?php if ( isset( $this->settings[ 'plugin_description' ] ) ): ?>
1255
- <span><?php echo esc_html( $this->settings[ 'plugin_description' ] ) ?></span>
1256
- <?php endif ?>
1257
- </h1>
1258
  </div>
1259
-
1260
  <?php endif ?>
1261
  <?php
1262
  }
1222
  }
1223
 
1224
  if ( $this->is_free() && isset( $this->settings[ 'plugin_slug' ] ) ):
1225
+ $rate_link = apply_filters( 'yith_plugin_fw_rate_url', 'https://wordpress.org/support/plugin/' . $this->settings[ 'plugin_slug' ] . '/reviews/?rate=5#new-post' );
 
 
 
 
 
 
 
 
 
1226
  ?>
1227
  <h1 class="notice-container"></h1>
1228
+ <div class="yith-plugin-fw-banner">
1229
  <h1><?php echo esc_html( $this->settings[ 'page_title' ] ) ?></h1>
 
 
 
 
 
 
 
 
 
 
1230
  </div>
1231
+ <div class="yith-plugin-fw-rate">
1232
+ <?php printf('<strong>%s</strong> %s <a href="%s" target="_blank"><u>%s</u> <span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span></a> %s',
1233
+ __('We need your support','yith-plugin-fw'),
1234
+ __('to keep updating and improving the plugin. Please,','yith-plugin-fw'),
1235
+ $rate_link,
1236
+ __('help us by leaving a five-star rating','yith-plugin-fw' ),
1237
+ __(':) Thanks!','yith-plugin-fw' ) )?>
1238
+ </div>
1239
  <?php else: ?>
1240
  <h1 class="notice-container"></h1>
1241
  <div class="yith-plugin-fw-banner">
1242
+ <h1><?php echo esc_html( $this->settings[ 'page_title' ] ) ?></h1>
 
 
 
 
1243
  </div>
 
1244
  <?php endif ?>
1245
  <?php
1246
  }
plugin-options/add_to_wishlist-options.php CHANGED
@@ -74,8 +74,7 @@ return apply_filters( 'yith_wcwl_add_to_wishlist_options', array(
74
  ),
75
  'deps' => array(
76
  'id' => 'yith_wcwl_show_on_loop',
77
- 'value' => 'yes',
78
- 'type' => 'disable'
79
  )
80
  ),
81
 
@@ -222,8 +221,7 @@ return apply_filters( 'yith_wcwl_add_to_wishlist_options', array(
222
  ),
223
  'deps' => array(
224
  'id' => 'yith_wcwl_add_to_wishlist_style',
225
- 'value' => 'button_custom',
226
- 'type' => 'disable'
227
  )
228
  ),
229
 
@@ -238,8 +236,7 @@ return apply_filters( 'yith_wcwl_add_to_wishlist_options', array(
238
  'max' => 100,
239
  'deps' => array(
240
  'id' => 'yith_wcwl_add_to_wishlist_style',
241
- 'value' => 'button_custom',
242
- 'type' => 'disable'
243
  )
244
  ),
245
 
@@ -263,8 +260,7 @@ return apply_filters( 'yith_wcwl_add_to_wishlist_options', array(
263
  'yith-type' => 'upload',
264
  'deps' => array(
265
  'id' => 'yith_wcwl_add_to_wishlist_icon',
266
- 'value' => 'custom',
267
- 'type' => 'disable'
268
  )
269
  ),
270
 
@@ -288,8 +284,7 @@ return apply_filters( 'yith_wcwl_add_to_wishlist_options', array(
288
  'yith-type' => 'upload',
289
  'deps' => array(
290
  'id' => 'yith_wcwl_added_to_wishlist_icon',
291
- 'value' => 'custom',
292
- 'type' => 'disable'
293
  )
294
  ),
295
 
74
  ),
75
  'deps' => array(
76
  'id' => 'yith_wcwl_show_on_loop',
77
+ 'value' => 'yes'
 
78
  )
79
  ),
80
 
221
  ),
222
  'deps' => array(
223
  'id' => 'yith_wcwl_add_to_wishlist_style',
224
+ 'value' => 'button_custom'
 
225
  )
226
  ),
227
 
236
  'max' => 100,
237
  'deps' => array(
238
  'id' => 'yith_wcwl_add_to_wishlist_style',
239
+ 'value' => 'button_custom'
 
240
  )
241
  ),
242
 
260
  'yith-type' => 'upload',
261
  'deps' => array(
262
  'id' => 'yith_wcwl_add_to_wishlist_icon',
263
+ 'value' => 'custom'
 
264
  )
265
  ),
266
 
284
  'yith-type' => 'upload',
285
  'deps' => array(
286
  'id' => 'yith_wcwl_added_to_wishlist_icon',
287
+ 'value' => 'custom'
 
288
  )
289
  ),
290
 
plugin-options/settings-options.php CHANGED
@@ -61,4 +61,4 @@ return apply_filters( 'yith_wcwl_settings_options', array(
61
  'id' => 'yith_wcwl_yith_wfbt'
62
  )
63
  )
64
- ) );
61
  'id' => 'yith_wcwl_yith_wfbt'
62
  )
63
  )
64
+ ) );
plugin-options/wishlist_page-options.php CHANGED
@@ -309,8 +309,7 @@ return apply_filters( 'yith_wcwl_wishlist_page_options', array(
309
  ),
310
  'deps' => array(
311
  'id' => 'yith_wcwl_add_to_cart_style',
312
- 'value' => 'button_custom',
313
- 'type' => 'disable'
314
  )
315
  ),
316
 
@@ -325,8 +324,7 @@ return apply_filters( 'yith_wcwl_wishlist_page_options', array(
325
  'max' => 100,
326
  'deps' => array(
327
  'id' => 'yith_wcwl_add_to_cart_style',
328
- 'value' => 'button_custom',
329
- 'type' => 'disable'
330
  )
331
  ),
332
 
@@ -341,8 +339,7 @@ return apply_filters( 'yith_wcwl_wishlist_page_options', array(
341
  'options' => yith_wcwl_get_plugin_icons(),
342
  'deps' => array(
343
  'id' => 'yith_wcwl_add_to_cart_style',
344
- 'value' => 'button_custom',
345
- 'type' => 'disable'
346
  )
347
 
348
  ),
@@ -401,8 +398,7 @@ return apply_filters( 'yith_wcwl_wishlist_page_options', array(
401
  ),
402
  'deps' => array(
403
  'id' => 'yith_wcwl_add_to_cart_style',
404
- 'value' => 'button_custom',
405
- 'type' => 'disable'
406
  )
407
  ),
408
 
@@ -451,8 +447,7 @@ return apply_filters( 'yith_wcwl_wishlist_page_options', array(
451
  ),
452
  'deps' => array(
453
  'id' => 'yith_wcwl_add_to_cart_style',
454
- 'value' => 'button_custom',
455
- 'type' => 'disable'
456
  )
457
  ),
458
 
@@ -481,8 +476,7 @@ return apply_filters( 'yith_wcwl_wishlist_page_options', array(
481
  ),
482
  'deps' => array(
483
  'id' => 'yith_wcwl_add_to_cart_style',
484
- 'value' => 'button_custom',
485
- 'type' => 'disable'
486
  )
487
  ),
488
 
@@ -495,8 +489,7 @@ return apply_filters( 'yith_wcwl_wishlist_page_options', array(
495
  'default' => '#F4F4F4',
496
  'deps' => array(
497
  'id' => 'yith_wcwl_add_to_cart_style',
498
- 'value' => 'button_custom',
499
- 'type' => 'disable'
500
  )
501
  ),
502
 
@@ -520,8 +513,7 @@ return apply_filters( 'yith_wcwl_wishlist_page_options', array(
520
  ),
521
  'deps' => array(
522
  'id' => 'yith_wcwl_enable_share',
523
- 'value' => 'yes',
524
- 'type' => 'disable'
525
  )
526
 
527
  ),
@@ -731,4 +723,4 @@ return apply_filters( 'yith_wcwl_wishlist_page_options', array(
731
  'id' => 'yith_wcwl_style_section_settings'
732
  ),
733
  )
734
- ) );
309
  ),
310
  'deps' => array(
311
  'id' => 'yith_wcwl_add_to_cart_style',
312
+ 'value' => 'button_custom'
 
313
  )
314
  ),
315
 
324
  'max' => 100,
325
  'deps' => array(
326
  'id' => 'yith_wcwl_add_to_cart_style',
327
+ 'value' => 'button_custom'
 
328
  )
329
  ),
330
 
339
  'options' => yith_wcwl_get_plugin_icons(),
340
  'deps' => array(
341
  'id' => 'yith_wcwl_add_to_cart_style',
342
+ 'value' => 'button_custom'
 
343
  )
344
 
345
  ),
398
  ),
399
  'deps' => array(
400
  'id' => 'yith_wcwl_add_to_cart_style',
401
+ 'value' => 'button_custom'
 
402
  )
403
  ),
404
 
447
  ),
448
  'deps' => array(
449
  'id' => 'yith_wcwl_add_to_cart_style',
450
+ 'value' => 'button_custom'
 
451
  )
452
  ),
453
 
476
  ),
477
  'deps' => array(
478
  'id' => 'yith_wcwl_add_to_cart_style',
479
+ 'value' => 'button_custom'
 
480
  )
481
  ),
482
 
489
  'default' => '#F4F4F4',
490
  'deps' => array(
491
  'id' => 'yith_wcwl_add_to_cart_style',
492
+ 'value' => 'button_custom'
 
493
  )
494
  ),
495
 
513
  ),
514
  'deps' => array(
515
  'id' => 'yith_wcwl_enable_share',
516
+ 'value' => 'yes'
 
517
  )
518
 
519
  ),
723
  'id' => 'yith_wcwl_style_section_settings'
724
  ),
725
  )
726
+ ) );