Changeset 2626150
- Timestamp:
- 11/08/2021 01:12:55 PM (4 years ago)
- Location:
- woo-in-stock-notifier/trunk
- Files:
-
- 8 edited
-
assets/css/admin.min.css (modified) (1 diff)
-
assets/css/front.min.css (modified) (1 diff)
-
assets/js/admin.min.js (modified) (1 diff)
-
assets/js/front.min.js (modified) (1 diff)
-
inc/classes/class-wsn-options.php (modified) (3 diffs)
-
inc/classes/class-wsn-product.php (modified) (5 diffs)
-
instock-init.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-in-stock-notifier/trunk/assets/css/admin.min.css
r2414662 r2626150 1 1 #poststuff #wsn_product .inside{margin:0;padding:0}.wsn-wrapper{margin:0}.wsn-tabs__header{align-items:center;border-bottom:solid 1px #eee;display:flex;justify-content:space-between}.wsn-tabs__main{background:#fafafa;border-bottom:solid 1px #eee}.wsn-tabs__action{display:flex;align-items:center}.wsn-tabs__action-item{border-right:solid 1px #ddd;padding:0 15px}.wsn-tabs__action-item:last-child{border:none}.wsn-tabs__action-item a{align-items:center;display:inline-flex;text-decoration:none}.wsn-tabs__action-item a>i{margin-right:5px}.wsn-tabs-nav{margin:0;padding:0;list-style:none}.wsn-tabs-nav-item{background:none;color:#0073aa;cursor:pointer;display:inline-block;margin:0;padding:10px 15px;transition-property:border, background, color;transition-duration:.05s;transition-timing-function:ease-in-out}.wsn-tabs-nav-item--current{color:#555;background:#eeeeee;position:relative}.wsn-tabs__body{border-radius:0 0 5px 5px;border-top:none;margin-top:-1px}.wsn-tabs__content{display:none;padding:15px}.wsn-tabs__content--current{display:inherit}.wsn-tabs--hidden{display:none}.wsn-tab-section__header h5{color:#555;font-size:25px;margin:0}.wsn-tab-table{margin-top:10px;padding:0}.wsn-tab-table-header{align-items:center;display:flex;justify-content:space-between;padding:10px 0}.wsn-tab-table-list-col{color:#555;font-size:10px;font-weight:600;letter-spacing:0.3px;text-transform:uppercase}.wsn-tab-table-body{margin:0 -15px}.wsn-tab-table-body__no-result{align-items:center;border-top:solid 1px #eee;color:#aaa;display:flex;justify-content:center;padding:30px}.wsn-tab-table-item{align-items:center;border-top:solid 1px #eee;display:flex;justify-content:space-between;padding:10px 15px}.wsn-tab-table-item--disabled{background:whitesmoke;opacity:0.5;pointer-events:none}.wsn-tab-table-item:hover{background:#f5f5f5}.wsn-tab-table-item-col-actions{align-items:center;display:flex}.wsn-tab-table-item-col-action{align-items:center;display:flex;margin-right:10px;min-height:20px}.wsn-tab-table-item-col-action a{display:inline-flex;font-size:15px;text-decoration:none}.wsn-tab-table-item-col-action a>span{font-size:15px;height:auto;line-height:10px}.wsn-tab-table-item-col-action:last-child{margin:0}.wsn-splash{background:#f8f8f8;display:none}.wsn-splash__body{color:white;padding:50px}.wsn-splash__body h3{margin:0}.wsn-splash--visible{display:block}.wsn-form h3{font-size:30px;line-height:30px;margin:0}.wsn-form h5{color:#333;font-size:31px;line-height:31px;margin:0}.wsn-form-field{align-items:center;display:flex}.wsn-form-field a{margin-left:14px}.wsn-form .wsn-input-field{border:solid 1px #d0d0d0;padding:5px 10px;margin:15px 0;width:50%;background:#fff}.wsn-disabled{opacity:0.5;pointer-events:none}.wsn-product-variation-head{border-top:solid 1px #eee}.wsn-hidden{display:none}.wsn-notice{border-top:solid 1px #eee}.wsn-notice__main h5{color:#666;font-size:19px;margin:0;padding:10px 0}.wsn-notice__inner{max-width:500px;margin:0 auto;text-align:center;padding:50px 0}.wsn-notice__icon{text-align:center}.wsn-notice__icon i{color:#aaa;font-size:40px;line-height:40px;height:40px;width:40px}.wsn-notice-desc{color:#aaa}.wsn-unclickable{opacity:0.5;pointer-events:none} 2 2 3 4 /*# sourceMappingURL=admin.min.css.map*/ -
woo-in-stock-notifier/trunk/assets/css/front.min.css
r2414720 r2626150 1 1 .wsn-form__content{padding:10px 0}.wsn-form__footer{margin-bottom:15px}.wsn-form-field{padding:5px 0}.wsn-input-field{min-width:100%}.wsn-form-message-item{line-height:30px}.wsn-submit-form--disabled{pointer-events:none;opacity:.2} 2 2 3 4 /*# sourceMappingURL=front.min.css.map*/ -
woo-in-stock-notifier/trunk/assets/js/admin.min.js
r2414720 r2626150 1 !function(t){var a={};function e(n){if(a[n])return a[n].exports;var s=a[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,e),s.l=!0,s.exports}e.m=t,e.c=a,e.d=function(t,a,n){e.o(t,a)||Object.defineProperty(t,a,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,a){if(1&a&&(t=e(t)),8&a)return t;if(4&a&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&a&&"string"!=typeof t)for(var s in t)e.d(n,s,function(a){return t[a]}.bind(null,s));return n},e.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(a,"a",a),a},e.o=function(t,a){return Object.prototype.hasOwnProperty.call(t,a)},e.p="",e(e.s=0)}([function(t,a,e){e(1),t.exports=e(2)},function(t,a){jQuery(document).ready((function(t){t("ul.wsn-tabs-nav li.wsn-tabs-nav-item").click((function(){var a=t(this).attr("data-tab"),e=t(this).attr("data-type");t(this).closest(".wsn-tabs").find(".wsn-tabs-nav-item").removeClass("wsn-tabs-nav-item--current"),t(this).closest(".wsn-tabs").find(".wsn-tabs__content").removeClass("wsn-tabs__content--current"),t(this).addClass("wsn-tabs-nav-item--current"),t("#"+a).addClass("wsn-tabs__content--current ");var n=t(this).closest(".wsn-tabs").find(".wsn-tabs__action");"archived"===e?n.addClass("wsn-hidden"):n.removeClass("wsn-hidden")})),t(".wsn-archived-list").on("click","a.removeArchivedUser",(function(a){a.preventDefault();var e=t(this),n=e.data("uid"),s=e.data("pid"),i=e.closest(".wsn-tab-table-item"),r=e.closest(".wsn-tab-table"),o={action:"archive_function",product:s,user_id:n,type:"_remove"};jQuery.post(ajaxurl,o,(function(){o&&i.fadeOut(1e3,(function(){i.remove(),r.find(".wsn-tab-table-body .wsn-tab-table-item").length<=0&&r.find(".wsn-notice").removeClass("wsn-hidden")}))}))})),t(".wsn-archived-list").on("click","a.restoreEmail",(function(a){a.preventDefault();var e=t(this),n=e.data("uid"),s=e.data("pid"),i=e.closest(".wsn-tab-table-item"),r=e.closest(".wsn-tab-table"),o={action:"archive_function",product:s,user_id:n,type:"_restore"};jQuery.post(ajaxurl,o,(function(t){t&&i.fadeOut(1e3,(function(){i.remove(),r.find(".wsn-tab-table-body .wsn-tab-table-item").length<=0&&r.find(".wsn-notice").removeClass("wsn-hidden")}))}))})),t("a.close_archived").click((function(a){a.preventDefault();var e=t(this),n=e.attr("id");t("#form"+n).hide(),e.parents().find(".waitlist_data#"+n).show(),e.parents().find(".archived_data_panel#"+n).find("._archive_userlist").html(""),e.parents().find(".archived_data_panel#"+n).hide()})),t(".wsn-tab-table").on("click","a.removeUser",(function(a){a.preventDefault();var e=t(this),n=e.data("product_id"),s=e.data("email"),i=e.data("uid"),r=e.data("total"),o=e.data("wp_nonce"),d=e.data("action"),l=t("#row-"+i+"-"+n),c=l.closest(".wsn-tab-table"),u={action:"removeUser",security:o,p_id:n,wsn_email:s,inc:r,wp_action:d};jQuery.post(ajaxurl,u,(function(){l.fadeOut(1e3,(function(){l.remove(),c.find(".wsn-tab-table-body .wsn-tab-table-item").length<=0&&c.find(".wsn-notice").removeClass("wsn-hidden")}))}))})),t("a#wsn_add_new_user").on("click",(function(a){a.preventDefault();var e=t(this).data("product_id");t("#wsn-add-user-"+e).show(),t("#wsn-add-tabs-"+e).hide(),t(this).parent().find(".usrEmail#"+e).focus()})),t("a#wsn_hide_add_new_user").on("click",(function(a){a.preventDefault();var e=t(this).data("product_id");t("#wsn-add-user-"+e).hide(),t("#wsn-add-tabs-"+e).show()})),t("button#wsn_add_btn").on("click",(function(a){a.preventDefault();var e=t(this),n=e.data("product_id"),s=e.closest(".wsn-form").find("#user-email-field-"+n);s.addClass("disabled"),e.addClass("disabled");var i=e.closest(".wsn-form").find("#wsn_hide_add_new_user"),r=s.val(),o=e.data("total"),d=o+1,l=e.data("nonce"),c=t("#wsn-tab-table-"+n);s.val("");var u={action:"addNewUser",security:l,p_id:n,inc:d,email:r};if(!r)return alert("Please enter email address."),!1;if(!/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(r))return alert("Please enter valid email address"),s.focus(),!1;jQuery.post(ajaxurl,u,(function(a){var d=JSON.parse(a);switch(s.removeClass("disabled"),e.removeClass("disabled"),d.status){case"success":o+=1,e.data("total",o),e.parents().find(".no_user#"+n).hide(),t("#wsn-tab-table-"+n+" > .wsn-tab-table-body").append('<div class="wsn-tab-table-item" id="row-'+d.currentId+"-"+n+'">\n<div class="wsn-tab-table-item-col">'+d.email+'</div>\n<div class="wsn-tab-table-item-col">\n<div class="wsn-tab-table-item-col-actions">\n<div class="wsn-tab-table-item-col-action">'+d.emailLink+'</div>\n<div class="wsn-tab-table-item-col-action">'+d.removeLink+"</div>\n</div>\n</div>\n</div>"),c.find(".wsn-notice").addClass("wsn-hidden"),i.click(),t("#wsn-tab-table-"+n+" .wsn-tab-table-item:last").animate({backgroundColor:"rgb(247, 255, 176)"},"slow").animate({backgroundColor:"#fff"},"slow");break;case"exists":alert(r+" is already exist! "),s.focus()}}))})),t(".wsn-tab-table").on("click","a.wsn_waitlist_send_mail_btn",(function(a){a.preventDefault();var e=t(this),n=e.data("product_id"),s=e.data("user_email"),i=e.data("type"),r="all"==i?e.parent(".wsn-tab-table"):e.parents(".wsn-tab-table-item-col-action");"all"==i&&t(document).find("#waitlists-"+n).find("tr.old").addClass("unclickable"),r.block({message:null,overlayCSS:{background:"#fff no-repeat center",opacity:.5,cursor:"none"}}),t.ajax({url:_wsn_waitlist.ajax_url,dataType:"json",data:{action:"wsn_waitlist_send_mail",product:n,email:s,type:i},success:function(t){r.html(t.msg),r.unblock()}})})),t(".wsn-tabs").on("click","a.wsn-send-email-all-users",(function(a){a.preventDefault();var e=t(this).data("product_id"),n=t(document).find("#wsn-tab-table-"+e);n.block({message:null,overlayCSS:{background:"#fff no-repeat center",opacity:.5,cursor:"none"}}),t.ajax({url:_wsn_waitlist.ajax_url,dataType:"json",data:{action:"wsn_waitlist_send_mail",product:e,type:"all"},success:function(t){n.html(t.msg),n.unblock()}})}));t(document).find("form.variations_form").on("woocommerce_variation_has_changed",(function(){var a=t(document).find("#wsn_waitlist_email"),e=a.parents(".wsn_waitlist_form").find("a.btn");a.on("input",(function(n){var s=e.attr("href"),i=a.val(),r=t(".variation_id").val(),o=a.attr("name");e.prop("href",s+"&"+o+"="+i+"&var_id="+r)}))}))}))},function(t,a,e){}]); 1 jQuery(document).ready((function(a){a("ul.wsn-tabs-nav li.wsn-tabs-nav-item").click((function(){var t=a(this).attr("data-tab"),e=a(this).attr("data-type");a(this).closest(".wsn-tabs").find(".wsn-tabs-nav-item").removeClass("wsn-tabs-nav-item--current"),a(this).closest(".wsn-tabs").find(".wsn-tabs__content").removeClass("wsn-tabs__content--current"),a(this).addClass("wsn-tabs-nav-item--current"),a("#"+t).addClass("wsn-tabs__content--current ");var n=a(this).closest(".wsn-tabs").find(".wsn-tabs__action");"archived"===e?n.addClass("wsn-hidden"):n.removeClass("wsn-hidden")})),a(".wsn-archived-list").on("click","a.removeArchivedUser",(function(t){t.preventDefault();var e=a(this),n=e.data("uid"),s=e.data("pid"),i=e.closest(".wsn-tab-table-item"),d=e.closest(".wsn-tab-table"),l={action:"archive_function",product:s,user_id:n,type:"_remove"};jQuery.post(ajaxurl,l,(function(){l&&i.fadeOut(1e3,(function(){i.remove(),d.find(".wsn-tab-table-body .wsn-tab-table-item").length<=0&&d.find(".wsn-notice").removeClass("wsn-hidden")}))}))})),a(".wsn-archived-list").on("click","a.restoreEmail",(function(t){t.preventDefault();var e=a(this),n=e.data("uid"),s=e.data("pid"),i=e.closest(".wsn-tab-table-item"),d=e.closest(".wsn-tab-table"),l={action:"archive_function",product:s,user_id:n,type:"_restore"};jQuery.post(ajaxurl,l,(function(a){a&&i.fadeOut(1e3,(function(){i.remove(),d.find(".wsn-tab-table-body .wsn-tab-table-item").length<=0&&d.find(".wsn-notice").removeClass("wsn-hidden")}))}))})),a("a.close_archived").click((function(t){t.preventDefault();var e=a(this),n=e.attr("id");a("#form"+n).hide(),e.parents().find(".waitlist_data#"+n).show(),e.parents().find(".archived_data_panel#"+n).find("._archive_userlist").html(""),e.parents().find(".archived_data_panel#"+n).hide()})),a(".wsn-tab-table").on("click","a.removeUser",(function(t){t.preventDefault();var e=a(this),n=e.data("product_id"),s=e.data("email"),i=e.data("uid"),d=e.data("total"),l=e.data("wp_nonce"),o=e.data("action"),r=a("#row-"+i+"-"+n),c=r.closest(".wsn-tab-table"),u={action:"removeUser",security:l,p_id:n,wsn_email:s,inc:d,wp_action:o};jQuery.post(ajaxurl,u,(function(){r.fadeOut(1e3,(function(){r.remove(),c.find(".wsn-tab-table-body .wsn-tab-table-item").length<=0&&c.find(".wsn-notice").removeClass("wsn-hidden")}))}))})),a("a#wsn_add_new_user").on("click",(function(t){t.preventDefault();var e=a(this).data("product_id");a("#wsn-add-user-"+e).show(),a("#wsn-add-tabs-"+e).hide(),a(this).parent().find(".usrEmail#"+e).focus()})),a("a#wsn_hide_add_new_user").on("click",(function(t){t.preventDefault();var e=a(this).data("product_id");a("#wsn-add-user-"+e).hide(),a("#wsn-add-tabs-"+e).show()})),a("button#wsn_add_btn").on("click",(function(t){t.preventDefault();var e=a(this),n=e.data("product_id"),s=e.closest(".wsn-form").find("#user-email-field-"+n);s.addClass("disabled"),e.addClass("disabled");var i=e.closest(".wsn-form").find("#wsn_hide_add_new_user"),d=s.val(),l=e.data("total"),o=l+1,r=e.data("nonce"),c=a("#wsn-tab-table-"+n);s.val("");var u={action:"addNewUser",security:r,p_id:n,inc:o,email:d};return d?/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(d)?void jQuery.post(ajaxurl,u,(function(t){var o=JSON.parse(t);switch(s.removeClass("disabled"),e.removeClass("disabled"),o.status){case"success":l+=1,e.data("total",l),e.parents().find(".no_user#"+n).hide(),a("#wsn-tab-table-"+n+" > .wsn-tab-table-body").append('<div class="wsn-tab-table-item" id="row-'+o.currentId+"-"+n+'">\n<div class="wsn-tab-table-item-col">'+o.email+'</div>\n<div class="wsn-tab-table-item-col">\n<div class="wsn-tab-table-item-col-actions">\n<div class="wsn-tab-table-item-col-action">'+o.emailLink+'</div>\n<div class="wsn-tab-table-item-col-action">'+o.removeLink+"</div>\n</div>\n</div>\n</div>"),c.find(".wsn-notice").addClass("wsn-hidden"),i.click(),a("#wsn-tab-table-"+n+" .wsn-tab-table-item:last").animate({backgroundColor:"rgb(247, 255, 176)"},"slow").animate({backgroundColor:"#fff"},"slow");break;case"exists":alert(d+" is already exist! "),s.focus()}})):(alert("Please enter valid email address"),s.focus(),!1):(alert("Please enter email address."),!1)})),a(".wsn-tab-table").on("click","a.wsn_waitlist_send_mail_btn",(function(t){t.preventDefault();var e=a(this),n=e.data("product_id"),s=e.data("user_email"),i=e.data("type"),d="all"==i?e.parent(".wsn-tab-table"):e.parents(".wsn-tab-table-item-col-action");"all"==i&&a(document).find("#waitlists-"+n).find("tr.old").addClass("unclickable"),d.block({message:null,overlayCSS:{background:"#fff no-repeat center",opacity:.5,cursor:"none"}}),a.ajax({url:_wsn_waitlist.ajax_url,dataType:"json",data:{action:"wsn_waitlist_send_mail",product:n,email:s,type:i},success:function(a){d.html(a.msg),d.unblock()}})})),a(".wsn-tabs").on("click","a.wsn-send-email-all-users",(function(t){t.preventDefault();var e=a(this).data("product_id"),n=a(document).find("#wsn-tab-table-"+e);n.block({message:null,overlayCSS:{background:"#fff no-repeat center",opacity:.5,cursor:"none"}}),a.ajax({url:_wsn_waitlist.ajax_url,dataType:"json",data:{action:"wsn_waitlist_send_mail",product:e,type:"all"},success:function(a){n.html(a.msg),n.unblock()}})})),a(document).find("form.variations_form").on("woocommerce_variation_has_changed",(function(){var t=a(document).find("#wsn_waitlist_email"),e=t.parents(".wsn_waitlist_form").find("a.btn");t.on("input",(function(n){var s=e.attr("href"),i=t.val(),d=a(".variation_id").val(),l=t.attr("name");e.prop("href",s+"&"+l+"="+i+"&var_id="+d)}))}))})); 2 //# sourceMappingURL=admin.min.js.map -
woo-in-stock-notifier/trunk/assets/js/front.min.js
r2414662 r2626150 1 !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([,,,function(t,e,n){n(4),t.exports=n(5)},function(t,e){jQuery(document).ready((function(t){t(".product").on("keyup",".wsn-waitlist-email-field",(function(e){var n=t(this).val(),r=t(this).closest(".wsn-form").find(".wsn-submit-form");!function(t){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)}(n)?r.addClass("wsn-submit-form--disabled"):r.removeClass("wsn-submit-form--disabled")})),t(".product").on("click",".wsn-submit-form",(function(e){e.preventDefault();var n=t(this).closest(".wsn-form").find(".wsn-waitlist-email-field"),r=t(this).attr("href");window.location=r+"&wsn_email="+n.val()}))}))},function(t,e,n){}]); 1 jQuery(document).ready((function(s){s(".product").on("keyup",".wsn-waitlist-email-field",(function(t){var i=s(this).val(),n=s(this).closest(".wsn-form").find(".wsn-submit-form");!function(s){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(s)}(i)?n.addClass("wsn-submit-form--disabled"):n.removeClass("wsn-submit-form--disabled")})),s(".product").on("click",".wsn-submit-form",(function(t){t.preventDefault();var i=s(this).closest(".wsn-form").find(".wsn-waitlist-email-field"),n=s(this).attr("href");window.location=n+"&wsn_email="+i.val()}))})); 2 //# sourceMappingURL=front.min.js.map -
woo-in-stock-notifier/trunk/inc/classes/class-wsn-options.php
r2425295 r2626150 447 447 $waitlist = wsn_get_waitlist( $pid ); 448 448 449 $total_waitlist_user = count( get_post_meta( $pid, WSN_USERS_META_KEY, true ) ); 449 // get users list 450 $users_list = get_post_meta( $pid, WSN_USERS_META_KEY, true ) ; 451 $total_waitlist_user = count( is_countable( $users_list ) ? $users_list : [] ); 450 452 451 453 ?> … … 715 717 716 718 // Get the product type. 717 $product_type = $wsn_product-> product_type;719 $product_type = $wsn_product->get_type(); 718 720 719 721 $pid = intval( $wsn_product->get_id() ); … … 738 740 $variations = $wsn_product->get_available_variations(); 739 741 740 for ( $i = 0; $i < count( $variations); $i ++ ) {742 for ( $i = 0; $i < count( is_countable( $variations ) ? $variations : [] ); $i ++ ) { 741 743 $pid = intval( $variations[ $i ]['variation_id'] ); 742 744 -
woo-in-stock-notifier/trunk/inc/classes/class-wsn-product.php
r2414720 r2626150 47 47 48 48 /** 49 * Product id of the current product.50 *51 * @var integer product_id52 */53 private $product_id;54 55 /**56 49 * Current product type 57 50 * … … 103 96 104 97 // @todo Add grouped product support. 105 if ( 'grouped' === $this->current_product-> product_type) {98 if ( 'grouped' === $this->current_product->get_type() ) { 106 99 return; 107 100 } … … 111 104 112 105 // Set the number of argument according to product type. 113 $args_num = ( 'variable' === $this->current_product-> product_type) ? 3 : 2;114 add_action( 'woocommerce_ stock_html', array( $this, 'output_form' ), 20, $args_num );106 $args_num = ( 'variable' === $this->current_product->get_type() ) ? 3 : 2; 107 add_action( 'woocommerce_get_stock_html', array( $this, 'output_form' ), 20, $args_num ); 115 108 } 116 109 } … … 144 137 * Generate the waitlist form for different product type. 145 138 * 146 * @param object $product Product Object.139 * @param \WC_Product $product Product Object. 147 140 * @param string $html HTML content. 148 141 * … … 157 150 158 151 // Product type. 159 $product_type = $product-> product_type;152 $product_type = $product->get_type(); 160 153 161 154 // Product id. 162 $product_id = ( 'simple' === $product_type ) ? $product->id : $product->variation_id;155 $product_id = $product->get_id(); 163 156 164 157 // Get the product url. 165 $product_url = ( 'simple' === $product_type || 'grouped' === $product_type ) ? get_permalink( $product-> id ) : get_permalink( $product->parent->id);158 $product_url = ( 'simple' === $product_type || 'grouped' === $product_type ) ? get_permalink( $product->get_id() ) : get_permalink( $product->get_parent_id() ); 166 159 167 160 $this->product_id = $product_id; -
woo-in-stock-notifier/trunk/instock-init.php
r2425295 r2626150 2 2 /** 3 3 * Plugin Name: Woo In-Stock Notifier 4 * Version: 1.0. 44 * Version: 1.0.5 5 5 * Plugin URI: http://govind.js.org/ 6 6 * Author: Govind Kumar … … 12 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 13 * WC requires at least: 2.5.0 14 * WC tested up to: 4.6.214 * WC tested up to: 5.8.0 15 15 **/ 16 16 -
woo-in-stock-notifier/trunk/readme.txt
r2425295 r2626150 1 1 === Woo In-Stock Notifier === 2 2 Contributors: gk.loveweb 3 Donate link: http ://emgk.github.io3 Donate link: https://govind.js.org 4 4 Tags: woocommerce plugin, woocommerce,in-stock, out-of-stock, stock management, notify user, userlist, waitlist, notify. 5 Requires at least: 5.3 6 Tested up to: 5.5.3 7 Requires PHP: 7.0 5 Requires at least: 5.2 6 Tested up to: 5.8 8 7 Stable tag: woo-in-stock-notifier 9 8 License: GPLv2 or later … … 41 40 == Changelog == 42 41 42 = 1.0.5 = 43 * Fix issues with latest version of WP and WooCommerce 44 43 45 = 1.0.4 = 44 46 * Make translatable
Note: See TracChangeset
for help on using the changeset viewer.