Changeset 3132036
- Timestamp:
- 08/07/2024 08:44:11 AM (19 months ago)
- Location:
- wcboost-wishlist/trunk
- Files:
-
- 1 added
- 15 edited
-
assets/css/wishlist.css (modified) (1 diff)
-
assets/css/wishlist.scss (modified) (2 diffs)
-
assets/js/wishlist-fragments.js (modified) (1 diff)
-
assets/js/wishlist-fragments.min.js (modified) (1 diff)
-
assets/js/wishlist.js (modified) (9 diffs)
-
assets/js/wishlist.min.js (modified) (1 diff)
-
includes/ajax-handler.php (modified) (1 diff)
-
includes/data-stores/wishlist.php (modified) (3 diffs)
-
includes/frontend.php (modified) (2 diffs)
-
includes/helper.php (modified) (2 diffs)
-
includes/plugin.php (modified) (2 diffs)
-
includes/session.php (added)
-
includes/wishlist.php (modified) (5 diffs)
-
languages/wcboost-wishlist.pot (modified) (10 diffs)
-
readme.txt (modified) (2 diffs)
-
wcboost-wishlist.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wcboost-wishlist/trunk/assets/css/wishlist.css
r3122355 r3132036 1 .wcboost- wishlist-header{margin-bottom:2em}.wcboost-wishlist-title{font-size:1.5em}.wcboost-wishlist__item .product-thumbnail img{max-width:5em;height:auto}.wcboost-wishlist__item .product-remove{vertical-align:middle}.wcboost-wishlist__item .product-add-to-cart{text-align:right}.wishlist-share__buttons{list-style:none;margin:0;padding:0}.wishlist-share__buttons li{display:inline-block;margin:0 .14em .3em 0}.wishlist-share__buttons a{color:inherit;text-decoration:none;display:inline-block;padding:0.6180469716em;background-color:var(--wcboost-wishlist-color--button-background, #eee)}.wishlist-share__buttons svg{width:1em;height:auto;margin-right:.25em;vertical-align:-0.125em}.entry-content .wishlist-share__buttons li a{text-decoration:none}.wcboost-wishlist-actions{text-align:right}.wcboost-wishlist-edit-link-wrapper{margin:1.5em 0}.wcboost-wishlist-button__icon{margin-right:.4em}.wcboost-wishlist-button__icon img,.wcboost-wishlist-button__icon svg{vertical-align:-0.125em;width:1em;height:auto}.wcboost-wishlist-button__icon svg{fill:currentColor}.wcboost-wishlist-button__icon img{display:inline}.wcboost-wishlist-button.disabled{opacity:.75}.wcboost-wishlist-button--text{display:inline-block;margin:.5em}.wcboost-wishlist-button.loading .wcboost-wishlist-button__icon svg{animation:wcboost-spin .75s linear infinite}@-webkit-keyframes wcboost-spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes wcboost-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.woocommerce .wcboost-wishlist-button--custom{color:var(--wcboost-wishlist-button-color--text, #fff);border:1px solid;border-color:var(--wcboost-wishlist-button-color--border, #333);background-color:var(--wcboost-wishlist-button-color--background, #333);transition:.1s ease-in}.woocommerce .wcboost-wishlist-button--custom:hover{color:var(--wcboost-wishlist-button-hover-color--text, #fff);border-color:var(--wcboost-wishlist-button-hover-color--border, #111);background-color:var(--wcboost-wishlist-button-hover-color--background, #111)}.wcboost-wishlist-share-notice{color:#fff;display:none;position:fixed;bottom:20px;left:50%;transform:translateX(-50%);padding:10px 40px 10px 10px;background-color:rgba(0,0,0,.7);max-width:100%}.wcboost-wishlist-share-notice input[type=text]{width:300px;max-width:100%;padding:5px}.wcboost-wishlist-share-notice__close{font-size:0;position:absolute;right:10px;top:50%;transform:translateY(-50%);cursor:pointer}.wcboost-wishlist-share-notice__close::before{content:"×";display:inline-block;color:#fff;font-size:20px;padding:5px}.wcboost-wishlist-form-edit .form-row--wishlist-privacy .woocommerce-input-wrapper{display:block}.wcboost-wishlist-form-edit .form-row--wishlist-privacy .woocommerce-input-wrapper label{display:inline;margin-left:6px}.wcboost-wishlist-form-edit .form-row--wishlist-privacy .woocommerce-input-wrapper label::after{content:"";display:block;white-space:pre}.wcboost-wishlist-form-delete{padding:1rem 1.5rem;margin-top:3em;background-color:var(--wcboost-wishlist-color--delete-bg, #fcf1ef);border-left:3px solid var(--wcboost-wishlist-color--delete, #c91c00)}.wcboost-wishlist-form-delete button{color:#fff;background-color:var(--wcboost-wishlist-color--delete, #c91c00)}ul.products li.product .wcboost-wishlist-button img{display:inline;margin:0}.theme-twentytwentytwo .wishlist_table th,.theme-twentytwentytwo .wishlist_table td{padding:1rem 0 .5rem 1rem}.theme-twentytwentytwo .wcboost-wishlist-button{line-height:normal}.theme-twentytwentytwo .wcboost-wishlist-button--text{margin:1rem}.wcboost-wishlist-widget-item{position:relative;margin:1em 0}.wcboost-wishlist-widget-item::after{content:"";display:block;clear:both}.wcboost-wishlist-widget-item img{max-width:60px;margin-right:1em;float:left}.wcboost-wishlist-widget-item a.remove{line-height:1;text-decoration:none;position:absolute;left:0;top:0;min-width:1em;min-height:1em;border-radius:50%;transform:translate(-50%, -50%)}.wcboost-wishlist-widget-item__price,.wcboost-wishlist-widget-item__quantity,.wcboost-wishlist-widget-item__stock,.wcboost-wishlist-widget-item__date,.wcboost-wishlist-widget-item__add-to-cart{display:block}1 .wcboost-flyout-notices-container{position:fixed;top:0;right:0;display:flex;flex-direction:column;align-items:flex-end;gap:var(--wcboost-flyout-notices-gap, 0.625rem);z-index:9999;padding:1rem}.wcboost-flyout-notice{box-shadow:0 4px 8px rgba(0,0,0,.1)}.wcboost-flyout-notice>:first-child{margin-top:0}.wcboost-flyout-notice>:last-child{margin-bottom:0}.wcboost-wishlist-share-notice{color:#fff;background-color:rgba(0,0,0,.7);padding:.625rem;display:flex}.wcboost-wishlist-share-notice input[type=text]{width:300px;max-width:100%;padding:5px;border:0;box-shadow:none;background-color:rgba(0,0,0,0)}.wcboost-wishlist-share-notice__close{text-indent:-999em;display:inline-block;min-width:30px;overflow:hidden;cursor:pointer;position:relative}.wcboost-wishlist-share-notice__close::before{content:"×";display:block;color:#fff;font-size:20px;position:absolute;top:0;left:0;width:100%;height:100%;text-indent:0;text-align:center}.wcboost-wishlist-header{margin-bottom:2em}.wcboost-wishlist-title{font-size:1.5em}.wcboost-wishlist__item .product-thumbnail img{max-width:5em;height:auto}.wcboost-wishlist__item .product-remove{vertical-align:middle}.wcboost-wishlist__item .product-add-to-cart{text-align:right}.wishlist-share__buttons{list-style:none;margin:0;padding:0}.wishlist-share__buttons li{display:inline-block;margin:0 .14em .3em 0}.wishlist-share__buttons a{color:inherit;text-decoration:none;display:inline-block;padding:0.6180469716em;background-color:var(--wcboost-wishlist-color--button-background, #eee)}.wishlist-share__buttons svg{width:1em;height:auto;margin-right:.25em;vertical-align:-0.125em}.entry-content .wishlist-share__buttons li a{text-decoration:none}.wcboost-wishlist-actions{text-align:right}.wcboost-wishlist-edit-link-wrapper{margin:1.5em 0}.wcboost-wishlist-button__icon{margin-right:.4em}.wcboost-wishlist-button__icon img,.wcboost-wishlist-button__icon svg{vertical-align:-0.125em;width:1em;height:auto}.wcboost-wishlist-button__icon svg{fill:currentColor}.wcboost-wishlist-button__icon img{display:inline}.wcboost-wishlist-button.disabled{opacity:.75}.wcboost-wishlist-button--text{display:inline-block;margin:.5em}.wcboost-wishlist-button.loading .wcboost-wishlist-button__icon svg{animation:wcboost-spin .75s linear infinite}@-webkit-keyframes wcboost-spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes wcboost-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.woocommerce .wcboost-wishlist-button--custom{color:var(--wcboost-wishlist-button-color--text, #fff);border:1px solid;border-color:var(--wcboost-wishlist-button-color--border, #333);background-color:var(--wcboost-wishlist-button-color--background, #333);transition:.1s ease-in}.woocommerce .wcboost-wishlist-button--custom:hover{color:var(--wcboost-wishlist-button-hover-color--text, #fff);border-color:var(--wcboost-wishlist-button-hover-color--border, #111);background-color:var(--wcboost-wishlist-button-hover-color--background, #111)}.wcboost-wishlist-form-edit .form-row--wishlist-privacy .woocommerce-input-wrapper{display:block}.wcboost-wishlist-form-edit .form-row--wishlist-privacy .woocommerce-input-wrapper label{display:inline;margin-left:6px}.wcboost-wishlist-form-edit .form-row--wishlist-privacy .woocommerce-input-wrapper label::after{content:"";display:block;white-space:pre}.wcboost-wishlist-form-delete{padding:1rem 1.5rem;margin-top:3em;background-color:var(--wcboost-wishlist-color--delete-bg, #fcf1ef);border-left:3px solid var(--wcboost-wishlist-color--delete, #c91c00)}.wcboost-wishlist-form-delete button{color:#fff;background-color:var(--wcboost-wishlist-color--delete, #c91c00)}ul.products li.product .wcboost-wishlist-button img{display:inline;margin:0}.theme-twentytwentytwo .wishlist_table th,.theme-twentytwentytwo .wishlist_table td{padding:1rem 0 .5rem 1rem}.theme-twentytwentytwo .wcboost-wishlist-button{line-height:normal}.theme-twentytwentytwo .wcboost-wishlist-button--text{margin:1rem}.wcboost-wishlist-widget-item{position:relative;margin:1em 0}.wcboost-wishlist-widget-item::after{content:"";display:block;clear:both}.wcboost-wishlist-widget-item img{max-width:60px;margin-right:1em;float:left}.wcboost-wishlist-widget-item a.remove{line-height:1;text-decoration:none;position:absolute;left:0;top:0;min-width:1em;min-height:1em;border-radius:50%;transform:translate(-50%, -50%)}.wcboost-wishlist-widget-item__price,.wcboost-wishlist-widget-item__quantity,.wcboost-wishlist-widget-item__stock,.wcboost-wishlist-widget-item__date,.wcboost-wishlist-widget-item__add-to-cart{display:block} -
wcboost-wishlist/trunk/assets/css/wishlist.scss
r3122355 r3132036 1 /** Wishlist flyout notices **/ 2 .wcboost-flyout-notices-container { 3 position: fixed; 4 top: 0; 5 right: 0; 6 display: flex; 7 flex-direction: column; 8 align-items: flex-end; 9 gap: var(--wcboost-flyout-notices-gap, 0.625rem); 10 z-index: 9999; 11 padding: 1rem; 12 } 13 14 .wcboost-flyout-notice { 15 box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 16 17 > :first-child { 18 margin-top: 0; 19 } 20 21 > :last-child { 22 margin-bottom: 0; 23 } 24 } 25 26 /** Sharing notices **/ 27 .wcboost-wishlist-share-notice { 28 color: #fff; 29 background-color: rgba(0, 0, 0, 0.7); 30 padding: 0.625rem; 31 display: flex; 32 33 input[type="text"] { 34 width: 300px; 35 max-width: 100%; 36 padding: 5px; 37 border: 0; 38 box-shadow: none; 39 background-color: transparent; 40 } 41 } 42 43 .wcboost-wishlist-share-notice__close { 44 text-indent: -999em; 45 display: inline-block; 46 min-width: 30px; 47 overflow: hidden; 48 cursor: pointer; 49 position: relative; 50 51 &::before { 52 content: "\00d7"; 53 display: block; 54 color: #fff; 55 font-size: 20px; 56 position: absolute; 57 top: 0; 58 left: 0; 59 width: 100%; 60 height: 100%; 61 text-indent: 0; 62 text-align: center; 63 } 64 } 65 1 66 /** Wishlist Page **/ 2 67 .wcboost-wishlist-header { … … 117 182 border-color: var(--wcboost-wishlist-button-hover-color--border, #111); 118 183 background-color: var(--wcboost-wishlist-button-hover-color--background, #111); 119 }120 }121 122 /** Sharing notices **/123 .wcboost-wishlist-share-notice {124 color: #fff;125 display: none;126 position: fixed;127 bottom: 20px;128 left: 50%;129 transform: translateX(-50%);130 padding: 10px 40px 10px 10px;131 background-color: rgba(0, 0, 0, 0.7);132 max-width: 100%;133 134 input[type="text"] {135 width: 300px;136 max-width: 100%;137 padding: 5px;138 }139 }140 141 .wcboost-wishlist-share-notice__close {142 font-size: 0;143 position: absolute;144 right: 10px;145 top: 50%;146 transform: translateY(-50%);147 cursor: pointer;148 149 &::before {150 content: "\00d7";151 display: inline-block;152 color: #fff;153 font-size: 20px;154 padding: 5px;155 184 } 156 185 } -
wcboost-wishlist/trunk/assets/js/wishlist-fragments.js
r3122355 r3132036 56 56 cookie_hash = Cookies.get( 'wcboost_wishlist_hash' ); 57 57 58 if ( wishlist_hash !== null && wishlist_hash === cookie_hash ) {58 if ( wishlist_hash !== null && wishlist_hash !== '' && wishlist_hash === cookie_hash ) { 59 59 this.updateFragmentsFromStorage(); 60 60 this.updateButtons(); -
wcboost-wishlist/trunk/assets/js/wishlist-fragments.min.js
r3122355 r3132036 1 jQuery(function(o){if(typeof wcboost_wishlist_fragments_params==="undefined"){return false}var n=true,d=wcboost_wishlist_fragments_params.hash_name;try{n="sessionStorage"in window&&window.sessionStorage!==null;window.sessionStorage.setItem("wcboost","test");window.sessionStorage.removeItem("wcboost");window.localStorage.setItem("wcboost","test");window.localStorage.removeItem("wcboost")}catch(t){n=false}var t=function(){var t=this;this.updateFragments=this.updateFragments.bind(this);this.getProductIds=this.getProductIds.bind(this);o(document.body).on("wishlist_fragments_refresh wishlist_updated",{wishlistFragmentsHandler:this},this.refreshFragments).on("wishlist_fragments_refreshed wishlist_item_added wishlist_item_removed",{wishlistFragmentsHandler:this},this.updateStorage).on("added_to_wishlist removed_from_wishlist",{wishlistFragmentsHandler:this},this.updateFragmentsOnChanges).on("wishlist_storage_updated",{wishlistFragmentsHandler:this},this.updateButtons);o(window).on("storage onstorage",function(t){if(d===t.originalEvent.key&&localStorage.getItem(d)!==sessionStorage.getItem(d)){o(document.body).trigger("wishlist_fragments_refresh")}});if("yes"===wcboost_wishlist_fragments_params.refresh_on_load){o(document.body).trigger("wishlist_fragments_refresh")}else{o(window).on("pageshow",function(t){if(t.originalEvent.persisted){o(document.body).trigger("wishlist_fragments_refresh",[true])}});try{var s=sessionStorage.getItem(d),e=Cookies.get("wcboost_wishlist_hash");if(s!==null&&s ===e){this.updateFragmentsFromStorage();this.updateButtons()}else{throw"No wishlist fragment"}}catch(t){this.refreshFragments()}}var i="undefined"!==typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.widgetsPreview&&wp.customize.widgetsPreview.WidgetPartial;if(i){wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){t.refreshFragments()})}};t.prototype.refreshFragments=function(t,s,e){var i=t?t.data.wishlistFragmentsHandler:this;var r={time:(new Date).getTime()};if("yes"===wcboost_wishlist_fragments_params.refresh_on_load||s){r.product_ids=i.getProductIds()}o.post({url:woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","get_wishlist_fragments"),data:r,dataType:"json",timeout:wcboost_wishlist_fragments_params.request_timeout,success:function(t){if(!t.success){o(document.body).trigger("wishlist_fragments_failed");return}i.updateFragments(t.data.fragments);o(document.body).trigger("wishlist_fragments_refreshed",[t.data,e])},error:function(){o(document.body).trigger("wishlish_fragments_ajax_error")}})};t.prototype.getProductIds=function(){var e=[];o(".wcboost-wishlist-button").each(function(t,s){e.push(s.dataset.product_id)});return e};t.prototype.updateFragmentsOnChanges=function(t,s,e){var i=t.data.wishlistFragmentsHandler;i.updateFragments(e);if(!s&&!n){i.refreshFragments(t,true)}};t.prototype.updateFragmentsFromStorage=function(){if(!n){return}var t=sessionStorage.getItem(d);if(!t){return}var s=t.split("::"),e=s[0];if(e){var i=JSON.parse(sessionStorage.getItem("wcboost_wishlist_fragments_"+e));if(i!==null){this.updateFragments(i)}}else{this.refreshFragments()}};t.prototype.updateStorage=function(t,s,e){if(!n){return}var i=s.wishlist_hash?s.wishlist_hash:"";sessionStorage.setItem(d,i);localStorage.setItem(d,i);if(i){var r=i.split("::"),a=r[0];if(s.wishlist_items){sessionStorage.setItem("wcboost_wishlist_"+a,JSON.stringify(s.wishlist_items))}if(s.fragments){sessionStorage.setItem("wcboost_wishlist_fragments_"+a,JSON.stringify(s.fragments))}o(document.body).trigger("wishlist_storage_updated")}};t.prototype.updateFragments=function(t){o.each(t,function(t,s){o(t).replaceWith(s)});o(document.body).trigger("wishlist_fragments_loaded")};t.prototype.updateButtons=function(t){if(!n){return}var s=sessionStorage.getItem(d);if(!s){return}var e=s.split("::"),i=e[0];if(!i){return}var r=JSON.parse(sessionStorage.getItem("wcboost_wishlist_"+i));if(r===null){return}var a=t?t.data.wishlistFragmentsHandler:this;o(".wcboost-wishlist-button").each(function(){var t=this.dataset.product_id,s=r[t]?r[t]:null;a.updateButtonStatus(this,s);if(this.dataset.variations){a.updateButtonVariations(this,r)}})};t.prototype.updateButtonStatus=function(t,s){var e=o(t);if(!e.length){return}if(s){if(e.hasClass("added")){return}e.removeClass("loading").addClass("added");switch(wcboost_wishlist_params.exists_item_behavior){case"view_wishlist":e.attr("href",s.wishlist_url?s.wishlist_url:wcboost_wishlist_params.wishlist_url);e.find(".wcboost-wishlist-button__text").text(wcboost_wishlist_params.i18n_view_wishlist);e.find(".wcboost-wishlist-button__icon").html(wcboost_wishlist_params.icon_filled);break;case"remove":e.attr("href",s.remove_url);e.find(".wcboost-wishlist-button__text").text(wcboost_wishlist_params.i18n_remove_from_wishlist);e.find(".wcboost-wishlist-button__icon").html(wcboost_wishlist_params.icon_filled);break;case"hide":e.hide();break}}else{if(!e.hasClass("added")&&!e.hasClass("loading")){return}e.removeClass("added loading");e.attr("href","?add-to-wishlist="+e.data("product_id"));e.find(".wcboost-wishlist-button__text").text(wcboost_wishlist_params.i18n_add_to_wishlist);e.find(".wcboost-wishlist-button__icon").html(wcboost_wishlist_params.icon_normal)}};t.prototype.updateButtonVariations=function(t,s){var e=o(t);if(!e.length||!e.data("variations")){return}var i=e.data("variations");for(var r in i){i[r]=o.extend({},i[r],{added:s[i[r].variation_id]===undefined?"no":"yes"})}e.data("variations",i)};new t});1 jQuery(function(o){if(typeof wcboost_wishlist_fragments_params==="undefined"){return false}var n=true,d=wcboost_wishlist_fragments_params.hash_name;try{n="sessionStorage"in window&&window.sessionStorage!==null;window.sessionStorage.setItem("wcboost","test");window.sessionStorage.removeItem("wcboost");window.localStorage.setItem("wcboost","test");window.localStorage.removeItem("wcboost")}catch(t){n=false}var t=function(){var t=this;this.updateFragments=this.updateFragments.bind(this);this.getProductIds=this.getProductIds.bind(this);o(document.body).on("wishlist_fragments_refresh wishlist_updated",{wishlistFragmentsHandler:this},this.refreshFragments).on("wishlist_fragments_refreshed wishlist_item_added wishlist_item_removed",{wishlistFragmentsHandler:this},this.updateStorage).on("added_to_wishlist removed_from_wishlist",{wishlistFragmentsHandler:this},this.updateFragmentsOnChanges).on("wishlist_storage_updated",{wishlistFragmentsHandler:this},this.updateButtons);o(window).on("storage onstorage",function(t){if(d===t.originalEvent.key&&localStorage.getItem(d)!==sessionStorage.getItem(d)){o(document.body).trigger("wishlist_fragments_refresh")}});if("yes"===wcboost_wishlist_fragments_params.refresh_on_load){o(document.body).trigger("wishlist_fragments_refresh")}else{o(window).on("pageshow",function(t){if(t.originalEvent.persisted){o(document.body).trigger("wishlist_fragments_refresh",[true])}});try{var s=sessionStorage.getItem(d),e=Cookies.get("wcboost_wishlist_hash");if(s!==null&&s!==""&&s===e){this.updateFragmentsFromStorage();this.updateButtons()}else{throw"No wishlist fragment"}}catch(t){this.refreshFragments()}}var i="undefined"!==typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.widgetsPreview&&wp.customize.widgetsPreview.WidgetPartial;if(i){wp.customize.selectiveRefresh.bind("partial-content-rendered",function(){t.refreshFragments()})}};t.prototype.refreshFragments=function(t,s,e){var i=t?t.data.wishlistFragmentsHandler:this;var r={time:(new Date).getTime()};if("yes"===wcboost_wishlist_fragments_params.refresh_on_load||s){r.product_ids=i.getProductIds()}o.post({url:woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","get_wishlist_fragments"),data:r,dataType:"json",timeout:wcboost_wishlist_fragments_params.request_timeout,success:function(t){if(!t.success){o(document.body).trigger("wishlist_fragments_failed");return}i.updateFragments(t.data.fragments);o(document.body).trigger("wishlist_fragments_refreshed",[t.data,e])},error:function(){o(document.body).trigger("wishlish_fragments_ajax_error")}})};t.prototype.getProductIds=function(){var e=[];o(".wcboost-wishlist-button").each(function(t,s){e.push(s.dataset.product_id)});return e};t.prototype.updateFragmentsOnChanges=function(t,s,e){var i=t.data.wishlistFragmentsHandler;i.updateFragments(e);if(!s&&!n){i.refreshFragments(t,true)}};t.prototype.updateFragmentsFromStorage=function(){if(!n){return}var t=sessionStorage.getItem(d);if(!t){return}var s=t.split("::"),e=s[0];if(e){var i=JSON.parse(sessionStorage.getItem("wcboost_wishlist_fragments_"+e));if(i!==null){this.updateFragments(i)}}else{this.refreshFragments()}};t.prototype.updateStorage=function(t,s,e){if(!n){return}var i=s.wishlist_hash?s.wishlist_hash:"";sessionStorage.setItem(d,i);localStorage.setItem(d,i);if(i){var r=i.split("::"),a=r[0];if(s.wishlist_items){sessionStorage.setItem("wcboost_wishlist_"+a,JSON.stringify(s.wishlist_items))}if(s.fragments){sessionStorage.setItem("wcboost_wishlist_fragments_"+a,JSON.stringify(s.fragments))}o(document.body).trigger("wishlist_storage_updated")}};t.prototype.updateFragments=function(t){o.each(t,function(t,s){o(t).replaceWith(s)});o(document.body).trigger("wishlist_fragments_loaded")};t.prototype.updateButtons=function(t){if(!n){return}var s=sessionStorage.getItem(d);if(!s){return}var e=s.split("::"),i=e[0];if(!i){return}var r=JSON.parse(sessionStorage.getItem("wcboost_wishlist_"+i));if(r===null){return}var a=t?t.data.wishlistFragmentsHandler:this;o(".wcboost-wishlist-button").each(function(){var t=this.dataset.product_id,s=r[t]?r[t]:null;a.updateButtonStatus(this,s);if(this.dataset.variations){a.updateButtonVariations(this,r)}})};t.prototype.updateButtonStatus=function(t,s){var e=o(t);if(!e.length){return}if(s){if(e.hasClass("added")){return}e.removeClass("loading").addClass("added");switch(wcboost_wishlist_params.exists_item_behavior){case"view_wishlist":e.attr("href",s.wishlist_url?s.wishlist_url:wcboost_wishlist_params.wishlist_url);e.find(".wcboost-wishlist-button__text").text(wcboost_wishlist_params.i18n_view_wishlist);e.find(".wcboost-wishlist-button__icon").html(wcboost_wishlist_params.icon_filled);break;case"remove":e.attr("href",s.remove_url);e.find(".wcboost-wishlist-button__text").text(wcboost_wishlist_params.i18n_remove_from_wishlist);e.find(".wcboost-wishlist-button__icon").html(wcboost_wishlist_params.icon_filled);break;case"hide":e.hide();break}}else{if(!e.hasClass("added")&&!e.hasClass("loading")){return}e.removeClass("added loading");e.attr("href","?add-to-wishlist="+e.data("product_id"));e.find(".wcboost-wishlist-button__text").text(wcboost_wishlist_params.i18n_add_to_wishlist);e.find(".wcboost-wishlist-button__icon").html(wcboost_wishlist_params.icon_normal)}};t.prototype.updateButtonVariations=function(t,s){var e=o(t);if(!e.length||!e.data("variations")){return}var i=e.data("variations");for(var r in i){i[r]=o.extend({},i[r],{added:s[i[r].variation_id]===undefined?"no":"yes"})}e.data("variations",i)};new t}); -
wcboost-wishlist/trunk/assets/js/wishlist.js
r3113521 r3132036 46 46 47 47 /** 48 * Flyout notices 49 * 50 * @param {string} message 51 * @param {object} options 52 */ 53 var WCBoostNotice = function( message, options ) { 54 this.options = $.extend( { 55 duration: 3000, 56 type: 'notice', 57 }, options ); 58 59 this.$notice = null; 60 this.$wrapper = $( '#wcboost-flyout-notices-container' ); 61 62 if ( ! this.$wrapper.length ) { 63 this.$wrapper = $( '<div id="wcboost-flyout-notices-container" class="wcboost-flyout-notices-container" />' ).appendTo( document.body ); 64 } 65 66 this.$notice = $( '<div class="wcboost-flyout-notice wcboost-notice" role="alert"/>' ) 67 .addClass( 'wcboost-notice--' + this.options.type ) 68 .append( $( message ) ); 69 70 this.wait = null; 71 72 // Methods. 73 this.show = this.show.bind( this ); 74 this.hide = this.hide.bind( this ); 75 this.delayHide = this.delayHide.bind( this ); 76 this.resetDelayHide = this.resetDelayHide.bind( this ); 77 78 // Events. 79 if ( this.options.duration > 0 ) { 80 this.$notice 81 .on( 'mouseenter', this.resetDelayHide ) 82 .on( 'mouseleave', this.delayHide ); 83 } 84 } 85 86 WCBoostNotice.prototype.show = function() { 87 if ( ! this.$notice ) { 88 return; 89 } 90 91 this.$notice.hide(); 92 this.$wrapper.append( this.$notice ); 93 this.$notice.fadeIn(); 94 95 if ( this.options.duration > 0 ) { 96 this.delayHide(); 97 } 98 } 99 100 WCBoostNotice.prototype.delayHide = function() { 101 this.resetDelayHide(); 102 this.wait = setTimeout( this.hide, this.options.duration ); 103 } 104 105 WCBoostNotice.prototype.hide = function() { 106 this.$notice.fadeOut(); 107 } 108 109 WCBoostNotice.prototype.resetDelayHide = function() { 110 clearTimeout( this.wait ); 111 } 112 113 /** 48 114 * AddToWishlistHandler class 49 115 */ … … 102 168 success: function( response ) { 103 169 if ( ! response.success ) { 170 if ( response.data.redirect_url ) { 171 location.href = response.data.redirect_url; 172 } else if ( response.data.message ) { 173 var notice = new WCBoostNotice( response.data.message ); 174 notice.show(); 175 } 176 177 self.updateButton( $button, 'removed' ); 104 178 return; 105 179 } … … 250 324 case 'removed': 251 325 $button.removeClass( 'added loading' ); 252 $button.attr( 'href', data.add_url );253 326 $button.find( this.selectors.text ).text( wcboost_wishlist_params.i18n_add_to_wishlist ); 254 327 $button.find( this.selectors.icon ).html( wcboost_wishlist_params.icon_normal ); 328 329 if ( data && data.add_url ) { 330 $button.attr( 'href', data.add_url ); 331 } 255 332 break; 256 333 … … 336 413 337 414 $.ajax( { 338 url :event.currentTarget.href,339 type :'GET',415 url : event.currentTarget.href, 416 type : 'GET', 340 417 dataType: 'html', 341 418 beforeSend: function() { … … 447 524 var self = this; 448 525 449 // Notice holder.450 self.$notice = $( '<div class="wcboost-wishlist-share-notice" aria-hidden="true" style="display: none" />' );451 self.$notice.append( '<div class="wcboost-wishlist-share-notice__text" />' );452 self.$notice.append( '<a class="wcboost-wishlist-share-notice__close">' + wcboost_wishlist_params.i18n_close_button_text + '</a>' );453 self.$notice.appendTo( document.body );454 455 526 self.openSocialShareIframe = self.openSocialShareIframe.bind( self ); 456 527 self.showCopiedNotice = self.showCopiedNotice.bind( self ); … … 459 530 // Events. 460 531 $( document.body ).on( 'click.wcboost-wishlist', '.wcboost-wishlist-share-link', { wishlistShareHandler: self }, self.onClickShareLink ); 461 self.$notice.on( 'click.wcboost-wishlist', '.wcboost-wishlist-share-notice__close', { wishlistShareHandler: self }, self.closeNotice );462 532 } 463 533 … … 474 544 // Copy wishlist page URL to clipboard. 475 545 if ( 'link' === social ) { 546 event.preventDefault(); 547 476 548 try { 477 549 navigator.clipboard.writeText( url ).then( self.showCopiedNotice ); … … 479 551 self.showWishlistURLNotice( url ); 480 552 } 481 482 event.preventDefault(); 483 return; 484 } 485 486 // Open the iframe of the sharer. 487 var opened = self.openSocialShareIframe( url ); 488 489 if ( opened ) { 490 event.preventDefault(); 553 } else { 554 var opened = self.openSocialShareIframe( url ); 555 556 if ( opened ) { 557 event.preventDefault(); 558 } 491 559 } 492 560 } … … 510 578 511 579 WishlistShareHandler.prototype.showCopiedNotice = function() { 512 var self = this; 513 514 self.$notice.find( '.wcboost-wishlist-share-notice__text' ).html( '' ).text( wcboost_wishlist_params.i18n_link_copied_notice ); 515 self.$notice.fadeIn( 200 ); 516 517 setTimeout( function() { 518 self.$notice.fadeOut( 200 ); 519 }, 2000 ); 580 if ( ! this.copiedNotice ) { 581 this.copiedNotice = new WCBoostNotice( 582 $( '<div class="wcboost-wishlist-link-copied-notice wcboost-wishlist-share-notice" />' ).text( wcboost_wishlist_params.i18n_link_copied_notice ), 583 { 584 type: 'message' 585 } 586 ); 587 } 588 589 this.copiedNotice.show(); 520 590 } 521 591 522 592 WishlistShareHandler.prototype.showWishlistURLNotice = function( url ) { 523 var self = this, 524 $input = $( '<input type="text" value="' + url + '" />' ); 525 526 self.$notice.find( '.wcboost-wishlist-share-notice__text' ).html( '' ).append( $input ); 527 self.$notice.fadeIn( 200 ); 528 $input.focus(); 529 } 530 531 WishlistShareHandler.prototype.closeNotice = function( event ) { 532 event.preventDefault(); 533 534 var self = event.data.wishlistShareHandler; 535 536 self.$notice.fadeOut( 200 ); 593 if ( ! this.urlNotice ) { 594 var $notice = $( '<div class="wcboost-wishlist-share-notice" />' ); 595 596 $notice.append( '<input type="text" value="" />' ); 597 $notice.append( '<span class="wcboost-wishlist-share-notice__close" role="button">' + wcboost_wishlist_params.i18n_close_button_text + '</span>' ); 598 599 var notice = new WCBoostNotice( $notice, { 600 duration: -1, 601 type: 'info' 602 }); 603 604 $notice.on( 'click', '.wcboost-wishlist-share-notice__close', function() { 605 notice.hide(); 606 } ); 607 608 this.urlNotice = notice; 609 } 610 611 this.urlNotice.show(); 612 this.urlNotice.$notice.find( 'input' ).val( url ).focus(); 537 613 } 538 614 -
wcboost-wishlist/trunk/assets/js/wishlist.min.js
r3113521 r3132036 1 (function(n){var e=function(t){return t.is(".processing")||t.parents(".processing").length};var r=function(t){if(!n.fn.block||!t){return}if(!e(t)){t.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}};var a=function(t){if(!n.fn.unblock||!t){return}t.removeClass("processing").unblock()};var t=function(){this.selectors={text:".wcboost-wishlist-button__text",icon:".wcboost-wishlist-button__icon"};this.addToWishlist=this.addToWishlist.bind(this);this.removeFromWishlist=this.removeFromWishlist.bind(this);this.updateButton=this.updateButton.bind(this);n(document.body).on("click",".wcboost-wishlist-button--ajax",{addToWishlistHandler:this},this.onButtonClick);if("yes"===wcboost_wishlist_params.allow_adding_variations){n(".variations_form").on("found_variation",{addToWishlistHandler:this},this.onVariationFound).on("reset_data",{addToWishlistHandler:this},this.onVariationReset)}};t.prototype.onButtonClick=function(t){var e=t.data.addToWishlistHandler;var i=n(t.currentTarget);if(!i.hasClass("added")){t.preventDefault();e.addToWishlist(i)}else if("remove"===wcboost_wishlist_params.exists_item_behavior){t.preventDefault();e.removeFromWishlist(i)}};t.prototype.addToWishlist=function(i){var o=this;var t={product_id:i.data("product_id"),quantity:i.data("quantity")};if(!t.product_id){return}n.post({url:woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_wishlist"),data:t,dataType:"json",beforeSend:function(){i.removeClass("added").addClass("loading");o.updateButton(i,"loading")},success:function(t){if(!t.success){return}var e=t.data.fragments;o.updateButton(i,"added",t.data);n(document.body).trigger("added_to_wishlist",[i,e]).trigger("wishlist_item_added",[t.data]);if("yes"===wcboost_wishlist_params.wishlist_redirect_after_add){window.location=wcboost_wishlist_params.wishlist_url}},complete:function(){i.removeClass("loading")}})};t.prototype.removeFromWishlist=function(i){var o=this;var t=new URLSearchParams(i[0].search);var e={item_key:t.get("remove-wishlist-item"),_wpnonce:t.get("_wpnonce")};if(!e.item_key){return}n.post({url:woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_wishlist_item"),data:e,dataType:"json",beforeSend:function(){i.removeClass("added").addClass("loading");o.updateButton(i,"loading")},success:function(t){if(!t.success){return}var e=t.data.fragments;o.updateButton(i,"removed",t.data);n(document.body).trigger("removed_from_wishlist",[i,e]).trigger("wishlist_item_removed",[t.data])},complete:function(){i.removeClass("loading")}})};t.prototype.onVariationFound=function(t,e){var i=t.data.addToWishlistHandler;var o=n(t.target).closest(".product").find(".wcboost-wishlist-button");var s=o.data("variations");i.updateButton(o,"update_id",{product_id:e.variation_id});if("yes"===wcboost_wishlist_params.allow_adding_variations&&s){var r=s.find(function(t){return t.variation_id===e.variation_id});if(r){i.updateButton(o,r.added==="yes"?"added":"removed",r)}}};t.prototype.onVariationReset=function(t){var e=t.data.addToWishlistHandler;var i=n(t.target).closest(".product").find(".wcboost-wishlist-button");var o=i.data("variations");var s=null;e.updateButton(i,"update_id",{product_id:null});if(o){var r=o.find(function(t){return t.is_parent});if(r){s=r.variation_id}if("yes"===wcboost_wishlist_params.allow_adding_variations&&r){e.updateButton(i,r.added==="yes"?"added":"removed",r)}}if(!s){var a=new URLSearchParams(i[0].search);s=a.get("add-to-wishlist")}e.updateButton(i,"update_id",{product_id:s})};t.prototype.updateButton=function(t,e,i){switch(e){case"loading":t.addClass("loading");t.find(this.selectors.icon).html(wcboost_wishlist_params.icon_loading);break;case"added":t.removeClass("loading").addClass("added");switch(wcboost_wishlist_params.exists_item_behavior){case"view_wishlist":t.attr("href",i.wishlist_url?i.wishlist_url:wcboost_wishlist_params.wishlist_url);t.find(this.selectors.text).text(wcboost_wishlist_params.i18n_view_wishlist);t.find(this.selectors.icon).html(wcboost_wishlist_params.icon_filled);break;case"remove":t.attr("href",i.remove_url);t.find(this.selectors.text).text(wcboost_wishlist_params.i18n_remove_from_wishlist);t.find(this.selectors.icon).html(wcboost_wishlist_params.icon_filled);break;case"hide":t.hide();break}break;case"removed":t.removeClass("added loading");t.attr("href",i.add_url);t.find(this.selectors.text).text(wcboost_wishlist_params.i18n_add_to_wishlist);t.find(this.selectors.icon).html(wcboost_wishlist_params.icon_normal);break;case"update_id":t.data("product_id",i.product_id).attr("data-product_id",i.product_id);break}};var i=function(t){var e=this;e.$form=t;e.$wrapper=t.closest(".wcboost-wishlist");e.updateForm=e.updateForm.bind(e);e.showNotices=e.showNotices.bind(e);e.$wrapper.off(".wcboost-wishlist");e.$wrapper.on("click.wcboost-wishlist",".wcboost-wishlist-form .product-remove > a",{wishlist:e},e.onRemoveItem);e.$wrapper.on("click.wcboost-wishlist","a.restore-item",{wishlist:e},e.onRestoreItem);e.$wrapper.on("change.wcboost-wishlist input.wcboost-wishlist",":input",{wishlist:e},e.onInputChagne);e.$wrapper.on("submit.wcboost-wishlist","form",{wishlist:e},e.onSubmitForm);e.$form.find('button[name="update_wishlist"]').prop("disabled",true).attr("aria-disabled",true)};i.prototype.onRemoveItem=function(t){t.preventDefault();var e=t.data.wishlist;n.ajax({url:t.currentTarget.href,type:"GET",dataType:"html",beforeSend:function(){r(e.$form)},success:function(t){e.updateForm(t)},complete:function(){if(e.$form){a(e.$form)}var t=n('[role="alert"]');if(t.length){n("html, body").animate({scrollTop:t.offset().top-100},1e3)}}})};i.prototype.onRestoreItem=function(t){t.preventDefault();var e=t.data.wishlist,i=e.$form?e.$form:e.$wrapper;n.ajax({url:t.currentTarget.href,type:"GET",dataType:"html",beforeSend:function(){r(i)},success:function(t){e.updateForm(t)},complete:function(){a(i)}})};i.prototype.onInputChagne=function(t){var e=t.data.wishlist;e.$form.find('button[name="update_wishlist"]').prop("disabled",false).attr("aria-disabled",false)};i.prototype.onSubmitForm=function(t){t.preventDefault();var e=t.data.wishlist;n("<input />").attr("type","hidden").attr("name","update_wishlist").attr("value","Update Wishlist").appendTo(e.$form);n.ajax({type:e.$form.attr("method"),url:e.$form.attr("action"),data:e.$form.serialize(),dataType:"html",beforeSend:function(){r(e.$form)},success:function(t){e.updateForm(t)},complete:function(){if(e.$form){a(e.$form)}}})};i.prototype.updateForm=function(t){var e=this,i=n.parseHTML(t),o=n(".wcboost-wishlist-form",i),s=n(".woocommerce-error, .woocommerce-message, .woocommerce-info, .is-info, .is-success, .is-error",i);n(".woocommerce-error, .woocommerce-message, .woocommerce-info, .is-info, .is-success, .is-error").remove();if(!o.length){var r=n(".wishlist-empty",i).closest(".wcboost-wishlist");r.find(".woocommerce-error, .woocommerce-message, .woocommerce-info, .is-info, .is-success, .is-error").not(".wishlist-empty").remove();e.$wrapper.html(r.html());e.$form=null;s=s.not(".wishlist-empty");n(document.body).trigger("wishlist_emptied",[e])}else{if(e.$form){e.$form.replaceWith(o);e.$form=o}else{var a=o.closest(".wcboost-wishlist");e.$wrapper.html(a.html());e.$form=e.$wrapper.find(".wcboost-wishlist-form")}e.$form.find('button[name="update_wishlist"]').prop("disabled",true).attr("aria-disabled",true)}if(s&&s.length>0){e.showNotices(s)}n(document.body).trigger("wishlist_updated",[e])};i.prototype.showNotices=function(t,e){if(e){e.prepend(t)}else{this.$wrapper.prepend(t)}};var o=function(){var t=this;t.$notice=n('<div class="wcboost-wishlist-share-notice" aria-hidden="true" style="display: none" />');t.$notice.append('<div class="wcboost-wishlist-share-notice__text" />');t.$notice.append('<a class="wcboost-wishlist-share-notice__close">'+wcboost_wishlist_params.i18n_close_button_text+"</a>");t.$notice.appendTo(document.body);t.openSocialShareIframe=t.openSocialShareIframe.bind(t);t.showCopiedNotice=t.showCopiedNotice.bind(t);t.showWishlistURLNotice=t.showWishlistURLNotice.bind(t);n(document.body).on("click.wcboost-wishlist",".wcboost-wishlist-share-link",{wishlistShareHandler:t},t.onClickShareLink);t.$notice.on("click.wcboost-wishlist",".wcboost-wishlist-share-notice__close",{wishlistShareHandler:t},t.closeNotice)};o.prototype.onClickShareLink=function(t){var e=t.data.wishlistShareHandler,i=t.currentTarget.href,o=t.currentTarget.dataset.social;if("email"===o){return}if("link"===o){try{navigator.clipboard.writeText(i).then(e.showCopiedNotice)}catch(t){e.showWishlistURLNotice(i)}t.preventDefault();return}var s=e.openSocialShareIframe(i);if(s){t.preventDefault()}};o.prototype.openSocialShareIframe=function(t){var e=500,i=450,o=window.screen.height/2-(i/2+50),s=window.screen.width/2-(e/2+10),r="status=no,resizable=yes,width="+e+",height="+i+",left="+s+",top="+o+",screenX="+s+",screenY="+o+",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no";if(window.screen.width<=e){return false}var a=window.open(t,"sharer",r);a.focus();return true};o.prototype.showCopiedNotice=function(){var t=this;t.$notice.find(".wcboost-wishlist-share-notice__text").html("").text(wcboost_wishlist_params.i18n_link_copied_notice);t.$notice.fadeIn(200);setTimeout(function(){t.$notice.fadeOut(200)},2e3)};o.prototype.showWishlistURLNotice=function(t){var e=this,i=n('<input type="text" value="'+t+'" />');e.$notice.find(".wcboost-wishlist-share-notice__text").html("").append(i);e.$notice.fadeIn(200);i.focus()};o.prototype.closeNotice=function(t){t.preventDefault();var e=t.data.wishlistShareHandler;e.$notice.fadeOut(200)};var s=function(){var t=this;t.selectors={widget:".wcboost-wishlist-widget",content:".wcboost-wishlist-widget-content"};t.checkWidgetVisibility=t.checkWidgetVisibility.bind(t);n(document.body).on("click",t.selectors.content+" a.remove",{wishlistWidget:t},t.removeItem).on("wishlist_fragments_loaded",{wishlistWidget:t},t.checkWidgetVisibility);t.checkWidgetVisibility()};s.prototype.checkWidgetVisibility=function(){var t=this;var e=n(t.selectors.widget);if(!e.length){return}e.each(function(){var t=n(this);if(!t.find(".wcboost-wishlist-widget__hide-if-empty").length){return}if(t.find(".wcboost-wishlist-widget__products").length){t.show()}else{t.hide()}})};s.prototype.removeItem=function(t){t.preventDefault();var e=t.data.wishlistWidget;var i=new URLSearchParams(t.currentTarget.search);var o={item_key:i.get("remove-wishlist-item"),_wpnonce:i.get("_wpnonce")};if(!o.item_key){return}var s=n(e.selectors.widget);n.post({url:woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_wishlist_item"),data:o,dataType:"json",beforeSend:function(){r(s)},success:function(t){if(!t.success){return}var e=t.data.fragments;n(document.body).trigger("removed_from_wishlist",[null,e])},complete:function(){a(s)}})};n(function(){new t;new i(n(".wcboost-wishlist-form"));new o;new s})})(jQuery);1 (function(n){var i=function(t){return t.is(".processing")||t.parents(".processing").length};var r=function(t){if(!n.fn.block||!t){return}if(!i(t)){t.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}};var a=function(t){if(!n.fn.unblock||!t){return}t.removeClass("processing").unblock()};var d=function(t,i){this.options=n.extend({duration:3e3,type:"notice"},i);this.$notice=null;this.$wrapper=n("#wcboost-flyout-notices-container");if(!this.$wrapper.length){this.$wrapper=n('<div id="wcboost-flyout-notices-container" class="wcboost-flyout-notices-container" />').appendTo(document.body)}this.$notice=n('<div class="wcboost-flyout-notice wcboost-notice" role="alert"/>').addClass("wcboost-notice--"+this.options.type).append(n(t));this.wait=null;this.show=this.show.bind(this);this.hide=this.hide.bind(this);this.delayHide=this.delayHide.bind(this);this.resetDelayHide=this.resetDelayHide.bind(this);if(this.options.duration>0){this.$notice.on("mouseenter",this.resetDelayHide).on("mouseleave",this.delayHide)}};d.prototype.show=function(){if(!this.$notice){return}this.$notice.hide();this.$wrapper.append(this.$notice);this.$notice.fadeIn();if(this.options.duration>0){this.delayHide()}};d.prototype.delayHide=function(){this.resetDelayHide();this.wait=setTimeout(this.hide,this.options.duration)};d.prototype.hide=function(){this.$notice.fadeOut()};d.prototype.resetDelayHide=function(){clearTimeout(this.wait)};var t=function(){this.selectors={text:".wcboost-wishlist-button__text",icon:".wcboost-wishlist-button__icon"};this.addToWishlist=this.addToWishlist.bind(this);this.removeFromWishlist=this.removeFromWishlist.bind(this);this.updateButton=this.updateButton.bind(this);n(document.body).on("click",".wcboost-wishlist-button--ajax",{addToWishlistHandler:this},this.onButtonClick);if("yes"===wcboost_wishlist_params.allow_adding_variations){n(".variations_form").on("found_variation",{addToWishlistHandler:this},this.onVariationFound).on("reset_data",{addToWishlistHandler:this},this.onVariationReset)}};t.prototype.onButtonClick=function(t){var i=t.data.addToWishlistHandler;var e=n(t.currentTarget);if(!e.hasClass("added")){t.preventDefault();i.addToWishlist(e)}else if("remove"===wcboost_wishlist_params.exists_item_behavior){t.preventDefault();i.removeFromWishlist(e)}};t.prototype.addToWishlist=function(o){var s=this;var t={product_id:o.data("product_id"),quantity:o.data("quantity")};if(!t.product_id){return}n.post({url:woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_wishlist"),data:t,dataType:"json",beforeSend:function(){o.removeClass("added").addClass("loading");s.updateButton(o,"loading")},success:function(t){if(!t.success){if(t.data.redirect_url){location.href=t.data.redirect_url}else if(t.data.message){var i=new d(t.data.message);i.show()}s.updateButton(o,"removed");return}var e=t.data.fragments;s.updateButton(o,"added",t.data);n(document.body).trigger("added_to_wishlist",[o,e]).trigger("wishlist_item_added",[t.data]);if("yes"===wcboost_wishlist_params.wishlist_redirect_after_add){window.location=wcboost_wishlist_params.wishlist_url}},complete:function(){o.removeClass("loading")}})};t.prototype.removeFromWishlist=function(e){var o=this;var t=new URLSearchParams(e[0].search);var i={item_key:t.get("remove-wishlist-item"),_wpnonce:t.get("_wpnonce")};if(!i.item_key){return}n.post({url:woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_wishlist_item"),data:i,dataType:"json",beforeSend:function(){e.removeClass("added").addClass("loading");o.updateButton(e,"loading")},success:function(t){if(!t.success){return}var i=t.data.fragments;o.updateButton(e,"removed",t.data);n(document.body).trigger("removed_from_wishlist",[e,i]).trigger("wishlist_item_removed",[t.data])},complete:function(){e.removeClass("loading")}})};t.prototype.onVariationFound=function(t,i){var e=t.data.addToWishlistHandler;var o=n(t.target).closest(".product").find(".wcboost-wishlist-button");var s=o.data("variations");e.updateButton(o,"update_id",{product_id:i.variation_id});if("yes"===wcboost_wishlist_params.allow_adding_variations&&s){var r=s.find(function(t){return t.variation_id===i.variation_id});if(r){e.updateButton(o,r.added==="yes"?"added":"removed",r)}}};t.prototype.onVariationReset=function(t){var i=t.data.addToWishlistHandler;var e=n(t.target).closest(".product").find(".wcboost-wishlist-button");var o=e.data("variations");var s=null;i.updateButton(e,"update_id",{product_id:null});if(o){var r=o.find(function(t){return t.is_parent});if(r){s=r.variation_id}if("yes"===wcboost_wishlist_params.allow_adding_variations&&r){i.updateButton(e,r.added==="yes"?"added":"removed",r)}}if(!s){var a=new URLSearchParams(e[0].search);s=a.get("add-to-wishlist")}i.updateButton(e,"update_id",{product_id:s})};t.prototype.updateButton=function(t,i,e){switch(i){case"loading":t.addClass("loading");t.find(this.selectors.icon).html(wcboost_wishlist_params.icon_loading);break;case"added":t.removeClass("loading").addClass("added");switch(wcboost_wishlist_params.exists_item_behavior){case"view_wishlist":t.attr("href",e.wishlist_url?e.wishlist_url:wcboost_wishlist_params.wishlist_url);t.find(this.selectors.text).text(wcboost_wishlist_params.i18n_view_wishlist);t.find(this.selectors.icon).html(wcboost_wishlist_params.icon_filled);break;case"remove":t.attr("href",e.remove_url);t.find(this.selectors.text).text(wcboost_wishlist_params.i18n_remove_from_wishlist);t.find(this.selectors.icon).html(wcboost_wishlist_params.icon_filled);break;case"hide":t.hide();break}break;case"removed":t.removeClass("added loading");t.find(this.selectors.text).text(wcboost_wishlist_params.i18n_add_to_wishlist);t.find(this.selectors.icon).html(wcboost_wishlist_params.icon_normal);if(e&&e.add_url){t.attr("href",e.add_url)}break;case"update_id":t.data("product_id",e.product_id).attr("data-product_id",e.product_id);break}};var e=function(t){var i=this;i.$form=t;i.$wrapper=t.closest(".wcboost-wishlist");i.updateForm=i.updateForm.bind(i);i.showNotices=i.showNotices.bind(i);i.$wrapper.off(".wcboost-wishlist");i.$wrapper.on("click.wcboost-wishlist",".wcboost-wishlist-form .product-remove > a",{wishlist:i},i.onRemoveItem);i.$wrapper.on("click.wcboost-wishlist","a.restore-item",{wishlist:i},i.onRestoreItem);i.$wrapper.on("change.wcboost-wishlist input.wcboost-wishlist",":input",{wishlist:i},i.onInputChagne);i.$wrapper.on("submit.wcboost-wishlist","form",{wishlist:i},i.onSubmitForm);i.$form.find('button[name="update_wishlist"]').prop("disabled",true).attr("aria-disabled",true)};e.prototype.onRemoveItem=function(t){t.preventDefault();var i=t.data.wishlist;n.ajax({url:t.currentTarget.href,type:"GET",dataType:"html",beforeSend:function(){r(i.$form)},success:function(t){i.updateForm(t)},complete:function(){if(i.$form){a(i.$form)}var t=n('[role="alert"]');if(t.length){n("html, body").animate({scrollTop:t.offset().top-100},1e3)}}})};e.prototype.onRestoreItem=function(t){t.preventDefault();var i=t.data.wishlist,e=i.$form?i.$form:i.$wrapper;n.ajax({url:t.currentTarget.href,type:"GET",dataType:"html",beforeSend:function(){r(e)},success:function(t){i.updateForm(t)},complete:function(){a(e)}})};e.prototype.onInputChagne=function(t){var i=t.data.wishlist;i.$form.find('button[name="update_wishlist"]').prop("disabled",false).attr("aria-disabled",false)};e.prototype.onSubmitForm=function(t){t.preventDefault();var i=t.data.wishlist;n("<input />").attr("type","hidden").attr("name","update_wishlist").attr("value","Update Wishlist").appendTo(i.$form);n.ajax({type:i.$form.attr("method"),url:i.$form.attr("action"),data:i.$form.serialize(),dataType:"html",beforeSend:function(){r(i.$form)},success:function(t){i.updateForm(t)},complete:function(){if(i.$form){a(i.$form)}}})};e.prototype.updateForm=function(t){var i=this,e=n.parseHTML(t),o=n(".wcboost-wishlist-form",e),s=n(".woocommerce-error, .woocommerce-message, .woocommerce-info, .is-info, .is-success, .is-error",e);n(".woocommerce-error, .woocommerce-message, .woocommerce-info, .is-info, .is-success, .is-error").remove();if(!o.length){var r=n(".wishlist-empty",e).closest(".wcboost-wishlist");r.find(".woocommerce-error, .woocommerce-message, .woocommerce-info, .is-info, .is-success, .is-error").not(".wishlist-empty").remove();i.$wrapper.html(r.html());i.$form=null;s=s.not(".wishlist-empty");n(document.body).trigger("wishlist_emptied",[i])}else{if(i.$form){i.$form.replaceWith(o);i.$form=o}else{var a=o.closest(".wcboost-wishlist");i.$wrapper.html(a.html());i.$form=i.$wrapper.find(".wcboost-wishlist-form")}i.$form.find('button[name="update_wishlist"]').prop("disabled",true).attr("aria-disabled",true)}if(s&&s.length>0){i.showNotices(s)}n(document.body).trigger("wishlist_updated",[i])};e.prototype.showNotices=function(t,i){if(i){i.prepend(t)}else{this.$wrapper.prepend(t)}};var o=function(){var t=this;t.openSocialShareIframe=t.openSocialShareIframe.bind(t);t.showCopiedNotice=t.showCopiedNotice.bind(t);t.showWishlistURLNotice=t.showWishlistURLNotice.bind(t);n(document.body).on("click.wcboost-wishlist",".wcboost-wishlist-share-link",{wishlistShareHandler:t},t.onClickShareLink)};o.prototype.onClickShareLink=function(t){var i=t.data.wishlistShareHandler,e=t.currentTarget.href,o=t.currentTarget.dataset.social;if("email"===o){return}if("link"===o){t.preventDefault();try{navigator.clipboard.writeText(e).then(i.showCopiedNotice)}catch(t){i.showWishlistURLNotice(e)}}else{var s=i.openSocialShareIframe(e);if(s){t.preventDefault()}}};o.prototype.openSocialShareIframe=function(t){var i=500,e=450,o=window.screen.height/2-(e/2+50),s=window.screen.width/2-(i/2+10),r="status=no,resizable=yes,width="+i+",height="+e+",left="+s+",top="+o+",screenX="+s+",screenY="+o+",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no";if(window.screen.width<=i){return false}var a=window.open(t,"sharer",r);a.focus();return true};o.prototype.showCopiedNotice=function(){if(!this.copiedNotice){this.copiedNotice=new d(n('<div class="wcboost-wishlist-link-copied-notice wcboost-wishlist-share-notice" />').text(wcboost_wishlist_params.i18n_link_copied_notice),{type:"message"})}this.copiedNotice.show()};o.prototype.showWishlistURLNotice=function(t){if(!this.urlNotice){var i=n('<div class="wcboost-wishlist-share-notice" />');i.append('<input type="text" value="" />');i.append('<span class="wcboost-wishlist-share-notice__close" role="button">'+wcboost_wishlist_params.i18n_close_button_text+"</span>");var e=new d(i,{duration:-1,type:"info"});i.on("click",".wcboost-wishlist-share-notice__close",function(){e.hide()});this.urlNotice=e}this.urlNotice.show();this.urlNotice.$notice.find("input").val(t).focus()};var s=function(){var t=this;t.selectors={widget:".wcboost-wishlist-widget",content:".wcboost-wishlist-widget-content"};t.checkWidgetVisibility=t.checkWidgetVisibility.bind(t);n(document.body).on("click",t.selectors.content+" a.remove",{wishlistWidget:t},t.removeItem).on("wishlist_fragments_loaded",{wishlistWidget:t},t.checkWidgetVisibility);t.checkWidgetVisibility()};s.prototype.checkWidgetVisibility=function(){var t=this;var i=n(t.selectors.widget);if(!i.length){return}i.each(function(){var t=n(this);if(!t.find(".wcboost-wishlist-widget__hide-if-empty").length){return}if(t.find(".wcboost-wishlist-widget__products").length){t.show()}else{t.hide()}})};s.prototype.removeItem=function(t){t.preventDefault();var i=t.data.wishlistWidget;var e=new URLSearchParams(t.currentTarget.search);var o={item_key:e.get("remove-wishlist-item"),_wpnonce:e.get("_wpnonce")};if(!o.item_key){return}var s=n(i.selectors.widget);n.post({url:woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_wishlist_item"),data:o,dataType:"json",beforeSend:function(){r(s)},success:function(t){if(!t.success){return}var i=t.data.fragments;n(document.body).trigger("removed_from_wishlist",[null,i])},complete:function(){a(s)}})};n(function(){new t;new e(n(".wcboost-wishlist-form"));new o;new s})})(jQuery); -
wcboost-wishlist/trunk/includes/ajax-handler.php
r3122355 r3132036 30 30 if ( ! isset( $_POST['product_id'] ) ) { 31 31 return; 32 } 33 34 // Stop if not allowing guests to creating wishlishs. 35 if ( ! wc_string_to_bool( get_option( 'wcboost_wishlist_enable_guest_wishlist', 'yes' ) ) && ! is_user_logged_in() ) { 36 $data = []; 37 38 if ( 'redirect_to_account_page' == get_option( 'wcboost_wishlist_guest_behaviour', 'message' ) ) { 39 $data['redirect_url'] = wc_get_page_permalink( 'myaccount' ); 40 } else { 41 $message = get_option( 'wcboost_wishlist_guest_message', __( 'You need to login to add products to your wishlist', 'wcboost-wishlist' ) ); 42 43 if ( $message ) { 44 ob_start(); 45 wc_print_notice( $message, 'notice' ); 46 $data['message'] = ob_get_clean(); 47 } 48 } 49 50 wp_send_json_error( $data ); 51 exit; 32 52 } 33 53 -
wcboost-wishlist/trunk/includes/data-stores/wishlist.php
r3122355 r3132036 1 1 <?php 2 2 namespace WCBoost\Wishlist\DataStore; 3 use WCBoost\Wishlist\ Helper;3 use WCBoost\Wishlist\Session; 4 4 5 5 defined( 'ABSPATH' ) || exit; … … 303 303 if ( is_user_logged_in() ) { 304 304 $default_wishlist_id = $wpdb->get_var( $wpdb->prepare( "SELECT wishlist_id FROM {$wpdb->prefix}wcboost_wishlists WHERE user_id = %d AND status != 'trash' AND is_default = 1 LIMIT 1;", [ get_current_user_id() ] ) ); 305 } elseif ( $session_id = Helper::get_session_id() ) {305 } elseif ( $session_id = Session::get_session_id() ) { 306 306 $default_wishlist_id = $wpdb->get_var( $wpdb->prepare( "SELECT wishlist_id FROM {$wpdb->prefix}wcboost_wishlists WHERE session_id = %s AND status != 'trash' LIMIT 1;", [ $session_id ] ) ); 307 307 } … … 322 322 if ( is_user_logged_in() ) { 323 323 $ids = $wpdb->get_col( $wpdb->prepare( "SELECT wishlist_id FROM {$wpdb->prefix}wcboost_wishlists WHERE user_id = %d AND status != 'trash';", [ get_current_user_id() ] ) ); 324 } elseif ( $session_id = Helper::get_session_id() ) {324 } elseif ( $session_id = Session::get_session_id() ) { 325 325 $ids = $wpdb->get_col( $wpdb->prepare( "SELECT wishlist_id FROM {$wpdb->prefix}wcboost_wishlists WHERE session_id = %s LIMIT 1;", [ $session_id ] ) ); 326 326 } -
wcboost-wishlist/trunk/includes/frontend.php
r3122355 r3132036 19 19 add_action( 'init', [ $this, 'register_scripts' ] ); 20 20 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] ); 21 22 // Cookie events.23 add_action( 'wcboost_wishlist_add_item', [ $this, 'maybe_set_cookies' ] );24 add_action( 'wcboost_wishlist_removed_item', [ $this, 'maybe_set_cookies' ] );25 add_action( 'wp', [ $this, 'maybe_set_cookies' ], 99 );26 add_action( 'shutdown', [ $this, 'maybe_set_cookies' ], 0 );27 21 } 28 22 … … 656 650 * 657 651 * @since 1.1.1 652 * @deprecated 1.1.2 Moved to the Session class. 658 653 * 659 654 * @return void 660 655 */ 661 656 public function maybe_set_cookies() { 662 if ( headers_sent() || ! did_action( 'wp_loaded' ) ) { 663 return; 664 } 665 666 $wishlist = Helper::get_wishlist(); 667 668 if ( ! $wishlist->is_empty() ) { 669 $this->set_cookies( true ); 670 } else { 671 $this->set_cookies( false ); 672 } 673 } 674 675 /** 676 * Set the comparison cookie 677 * 678 * @since 1.1.1 679 * 680 * @param bool $set Should the cookie be set or unset. 681 * 682 * @return void 683 */ 684 private function set_cookies( $set = true ) { 685 $wishlist = Helper::get_wishlist(); 686 687 if ( $set ) { 688 wc_setcookie( 'wcboost_wishlist_hash', $wishlist->get_hash() ); 689 } else { 690 wc_setcookie( 'wcboost_wishlist_hash', '', time() - HOUR_IN_SECONDS ); 691 unset( $_COOKIE['wcboost_wishlist_hash'] ); 692 } 657 _deprecated_function( __METHOD__, '1.1.2', '\WCBoost\Wishlist\Session\maybe_set_cookies' ); 658 Session::instance()->maybe_set_cookies(); 693 659 } 694 660 } -
wcboost-wishlist/trunk/includes/helper.php
r3088050 r3132036 6 6 class Helper { 7 7 8 const COOKIE_NAME = 'wcboost_wishlist_hash';9 10 /**11 * Store session in a variable.12 * This will be useful when set the cookie on the first time.13 *14 * @var string;15 */16 protected static $session_id = '';17 18 8 /** 19 9 * Get wishlist session id of guests. 20 10 * 11 * @since 1.1.2 Moved to class \WCBoost\Wishlist\Session 12 * 21 13 * @return string 22 14 */ 23 15 public static function get_session_id() { 24 if ( ! empty( self::$session_id ) ) { 25 return self::$session_id; 26 } 27 28 if ( empty( $_COOKIE[ self::COOKIE_NAME ] ) ) { 29 return ''; 30 } 31 32 return $_COOKIE[ self::COOKIE_NAME ]; 16 return Session::get_session_id(); 33 17 } 34 18 … … 37 21 * Store the session id in cookie for 30 days. It can be changed via a hook. 38 22 * 23 * @since 1.1.2 Moved to class \WCBoost\Wishlist\Session 24 * 39 25 * @param string $session_id 40 26 */ 41 27 public static function set_session_id( $session_id ) { 42 $expire = time() + absint( apply_filters( 'wcboost_wishlist_session_expire', MONTH_IN_SECONDS ) ); 43 wc_setcookie( self::COOKIE_NAME, $session_id, $expire ); 44 45 self::$session_id = $session_id; 28 Session::set_session_id( $session_id ); 46 29 } 47 30 48 31 /** 49 32 * Clear session id in the cookie 33 * 34 * @since 1.1.2 Moved to class \WCBoost\Wishlist\Session 50 35 */ 51 36 public static function clear_session_id() { 52 wc_setcookie( self::COOKIE_NAME, '', time() - HOUR_IN_SECONDS ); 53 54 self::$session_id = ''; 37 Session::clear_session_id(); 55 38 } 56 39 -
wcboost-wishlist/trunk/includes/plugin.php
r3113521 r3132036 140 140 include_once __DIR__ . '/helper.php'; 141 141 include_once __DIR__ . '/install.php'; 142 include_once __DIR__ . '/session.php'; 142 143 include_once __DIR__ . '/query.php'; 143 144 include_once __DIR__ . '/action-scheduler.php'; … … 175 176 Customize\Customizer::instance(); 176 177 Frontend::instance(); 178 Session::instance(); 177 179 178 180 if ( is_admin() ) { -
wcboost-wishlist/trunk/includes/wishlist.php
r3122355 r3132036 615 615 616 616 if ( $this->get_session_id() ) { 617 return ( Helper::get_session_id() === $this->get_session_id() );617 return ( Session::get_session_id() === $this->get_session_id() ); 618 618 } 619 619 … … 647 647 648 648 if ( ! is_user_logged_in() ) { 649 Helper::set_session_id( $this->get_session_id() );649 Session::set_session_id( $this->get_session_id() ); 650 650 } 651 651 } … … 730 730 731 731 /** 732 * Get unique hash key for the wishlist 732 * Get unique hash key for the wishlist. 733 * For all temporary wishlists, the Key is the same. 733 734 * 734 735 * @since 1.1.1 736 * @since 1.1.2 Always generate the hash key. A fixed key is generated for temporary wishlists. 735 737 * 736 738 * @return string … … 741 743 if ( $this->get_id() ) { 742 744 $hash_key = md5( get_current_blog_id() . '_' . $this->get_id() . '_' . $this->get_wishlist_token() ); 745 } else { 746 // Generate a fixed hash for temporary wishlists. 747 $hash_key = md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) . get_template() ); 743 748 } 744 749 … … 747 752 748 753 /** 749 * Get hash content for the wishlist 754 * Get hash content for the wishlist. 755 * For all temporary wishlists, the content is the same because all params are the same, 756 * which are: { wishlist_token: '', items: [], count: 0 } 750 757 * 751 758 * @since 1.1.1 759 * @since 1.1.2 Always generate hash content 752 760 * 753 761 * @return string 754 762 */ 755 763 public function get_hash_content() { 756 $hash = $this->get_id() ? md5( $this->get_id() . wp_json_encode( $this->get_items() ) . $this->count_items() ) : '';764 $hash = md5( $this->get_wishlist_token() . wp_json_encode( $this->get_items() ) . $this->count_items() ); 757 765 758 766 return apply_filters( 'wcboost_wishlist_hash', $hash, $this ); -
wcboost-wishlist/trunk/languages/wcboost-wishlist.pot
r3122355 r3132036 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WCBoost - Wishlist 1.1. 0\n"5 "Project-Id-Version: WCBoost - Wishlist 1.1.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wcboost-wishlist\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-0 7-20T04:44:31+00:00\n"12 "POT-Creation-Date: 2024-08-07T08:39:23+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2. 9.0\n"14 "X-Generator: WP-CLI 2.10.0\n" 15 15 "X-Domain: wcboost-wishlist\n" 16 16 17 17 #. Plugin Name of the plugin 18 #: wcboost-wishlist.php 18 19 msgid "WCBoost - Wishlist" 19 20 msgstr "" 20 21 21 22 #. Plugin URI of the plugin 23 #: wcboost-wishlist.php 22 24 msgid "https://wcboost.com/plugin/woocommerce-wishlist/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash" 23 25 msgstr "" 24 26 25 27 #. Description of the plugin 28 #: wcboost-wishlist.php 26 29 msgid "Our WooCommerce Wishlist plugin enables customers to create personalized collections of products that they like but aren't ready to purchase immediately. Enhance the shopping experience by saving products for further consideration, making decisions easier than ever." 27 30 msgstr "" 28 31 29 32 #. Author of the plugin 33 #: wcboost-wishlist.php 30 34 msgid "WCBoost" 31 35 msgstr "" 32 36 33 37 #. Author URI of the plugin 38 #: wcboost-wishlist.php 34 39 msgid "https://wcboost.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash" 35 40 msgstr "" 36 41 37 42 #: includes/admin/settings.php:17 38 #: includes/helper.php:1 8743 #: includes/helper.php:170 39 44 #: includes/widgets/wishlist.php:19 40 45 #: includes/widgets/wishlist.php:23 … … 75 80 76 81 #: includes/admin/settings.php:65 82 #: includes/ajax-handler.php:41 77 83 #: includes/form-handler.php:45 78 84 msgid "You need to login to add products to your wishlist" … … 151 157 #: includes/customizer/customizer.php:326 152 158 #: includes/form-handler.php:96 153 #: includes/frontend.php:6 50154 #: includes/helper.php: 213159 #: includes/frontend.php:644 160 #: includes/helper.php:196 155 161 msgid "View wishlist" 156 162 msgstr "" … … 158 164 #: includes/admin/settings.php:131 159 165 #: includes/customizer/customizer.php:317 160 #: includes/helper.php: 212166 #: includes/helper.php:195 161 167 msgid "Remove from wishlist" 162 168 msgstr "" … … 348 354 349 355 #: includes/admin/settings.php:341 350 #: includes/helper.php: 309356 #: includes/helper.php:292 351 357 msgid "Copy link" 352 358 msgstr "" … … 361 367 362 368 #: includes/admin/settings.php:380 363 #: includes/frontend.php:3 63369 #: includes/frontend.php:357 364 370 msgid "Edit wishlist" 365 371 msgstr "" … … 375 381 376 382 #. translators: %s: product name 377 #: includes/ajax-handler.php: 67383 #: includes/ajax-handler.php:87 378 384 #: includes/form-handler.php:89 379 385 msgid "%s has been added to your wishlist" … … 434 440 435 441 #: includes/customizer/customizer.php:308 436 #: includes/helper.php: 211442 #: includes/helper.php:194 437 443 #: templates/loop/add-to-wishlist.php:26 438 444 #: templates/single-product/add-to-wishlist.php:26 … … 565 571 msgstr "" 566 572 567 #: includes/frontend.php:1 43573 #: includes/frontend.php:137 568 574 msgid "The wishlist link is copied to clipboard" 569 575 msgstr "" 570 576 571 #: includes/frontend.php:1 44577 #: includes/frontend.php:138 572 578 msgid "Close" 573 579 msgstr "" 574 580 575 #: includes/frontend.php:3 41581 #: includes/frontend.php:335 576 582 msgid "Share" 577 583 msgstr "" 578 584 585 #: includes/frontend.php:393 586 msgid "You cannot delete your default wishlist. You have to set another list as default to delete this one." 587 msgstr "" 588 589 #: includes/frontend.php:395 590 msgid "This action moves the wishlist to Trash. It will be kept in Trash for 30 days." 591 msgstr "" 592 579 593 #: includes/frontend.php:399 580 msgid "You cannot delete your default wishlist. You have to set another list as default to delete this one."581 msgstr ""582 583 #: includes/frontend.php:401584 msgid "This action moves the wishlist to Trash. It will be kept in Trash for 30 days."585 msgstr ""586 587 #: includes/frontend.php:405588 594 msgid "Delete this wishlist" 589 595 msgstr "" 590 596 591 597 #. translators: %s product name 592 #: includes/frontend.php:5 10598 #: includes/frontend.php:504 593 599 msgid "Add %s to the wishlist" 594 600 msgstr "" 595 601 596 602 #. translators: %s product name 603 #: includes/frontend.php:540 604 msgid "Remove %s from the wishlist" 605 msgstr "" 606 597 607 #: includes/frontend.php:546 598 msgid "Remove %s from the wishlist"599 msgstr ""600 601 #: includes/frontend.php:552602 608 msgid "Open the wishlist" 603 609 msgstr "" 604 610 605 #: includes/helper.php:2 83611 #: includes/helper.php:266 606 612 msgid "I have some thing to share with you" 607 613 msgstr "" 608 614 609 615 #. translators: %s social name 610 #: includes/helper.php:3 17616 #: includes/helper.php:300 611 617 msgid "Share on %s" 612 618 msgstr "" -
wcboost-wishlist/trunk/readme.txt
r3122355 r3132036 3 3 Tags: woocommerce wishlist, wishlist, products, e-commerce, woocommerce 4 4 Tested up to: 6.6 5 Stable tag: 1.1. 15 Stable tag: 1.1.2 6 6 Requires PHP: 7.0 7 7 Requires at least: 4.5 … … 95 95 == Changelog == 96 96 97 = 1.1.2 = 98 - Fix - Fix issues with guest wishlists. 99 97 100 = 1.1.1 = 98 101 - Tweak - Improve caching to dynamically update wishlist fragments. -
wcboost-wishlist/trunk/wcboost-wishlist.php
r3122355 r3132036 5 5 * Plugin URI: https://wcboost.com/plugin/woocommerce-wishlist/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash 6 6 * Author: WCBoost 7 * Version: 1.1. 17 * Version: 1.1.2 8 8 * Author URI: https://wcboost.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash 9 9 *
Note: See TracChangeset
for help on using the changeset viewer.