Changeset 2729562
- Timestamp:
- 05/24/2022 03:22:44 PM (2 years ago)
- Location:
- product-quotation-for-woocommerce/trunk
- Files:
-
- 12 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
product-quotation-for-woocommerce/trunk/README.txt
r2719764 r2729562 4 4 Requires at least: 4.0 5 5 Tested up to: 5.9 6 Stable tag: 2.0. 36 Stable tag: 2.0. 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 40 40 * Automatically list each quotation submission on Dashboard. 41 41 * No complicated settings. All is set up to go. Simply install it and it works. 42 43 42 44 43 45 [See the Live Demo](http://wpdiscountx.com/shop/) … … 70 72 71 73 == Changelog == 74 75 76 77 78 79 80 72 81 73 82 = 2.0.3 - 07-05-2022 = -
product-quotation-for-woocommerce/trunk/assets/js/pqfw-cart.js
r2719227 r2729562 12 12 this.initialize(); 13 13 14 15 16 17 18 19 14 20 $(document).on('click', '.pqfw-remove-product', function () { 15 21 var $hash = $(this).data( 'id' ); 16 17 22 pqfwCart.removeProduct( $hash ); 18 23 }); … … 41 46 pqfwCart.showLoader(); 42 47 43 $.ajax({ 44 url : PQFW_OBJECT.ajaxurl, 45 data : { action: 'pqfw_load_cart_data' }, 46 success : function( response ) { 47 pqfwCart.dataLoaded(response); 48 }, 49 error : function( response ) { 50 console.error(response); 48 wp.ajax.send( 49 'pqfw_load_cart_data', 50 { 51 data : { 52 nonce : PQFW_OBJECT.nonce 53 }, 54 success : function( response ) { 55 pqfwCart.dataLoaded(response); 56 }, 57 error : function( response ) { 58 console.error(response); 59 } 51 60 } 52 }); 53 }, 61 ) 62 }, 63 sendData : function(button) { 64 if( pqfwCart.variationAlert() ) { 65 pqfwCart.setLoading(button); 66 67 wp.ajax.send( 68 'pqfw_add_product', 69 { 70 data : { 71 productID : $(button).data('id'), 72 variationID : pqfwCart.getVariationID(), 73 variationDetails : pqfwCart.getVariationDetails(), 74 quantity : pqfwCart.getQuantity(), 75 nonce : PQFW_OBJECT.nonce 76 }, 77 success : function( response ) { 78 pqfwCart.addToQuotationCart(button); 79 }, 80 error : function( error ) { 81 console.log( error ) 82 } 83 } 84 ) 85 } 86 }, 87 addToQuotationCart : function (button) { 88 $(button).removeClass('loading'); 89 $(button).addClass('added'); 90 pqfwCart.viewQuotationCart(button); 91 }, 92 viewQuotationCart : function (button) { 93 var url = PQFW_OBJECT.cartPageUrl; 94 if (url != false) { 95 $(".pqfw-view-quotation-cart").remove(); 96 $(button).after('<a class="pqfw-view-quotation-cart" href="' + url + '">' + PQFW_OBJECT.ViewCartLabel + '</a>'); 97 } 98 }, 99 setLoading : function (button) { 100 $(button).addClass('loading'); 101 }, 102 getVariationID : function () { 103 var variation = $("form.variations_form input[name='variation_id']").val(); 104 return typeof variation != "undefined" && variation != 0 ? parseInt(variation) : 0; 105 }, 106 getVariationDetails : function () { 107 var variation = $("form.variations_form input[name='variation_id']").val(), 108 details = {}; 109 110 if (typeof variation != "undefined" && variation != 0) { 111 jQuery('select[name^=attribute_]').each(function (ind, obj) { 112 details[jQuery(this).attr('name')] = jQuery(this).val(); 113 }); 114 } 115 116 if ($.isEmptyObject(details)) { 117 return 0; 118 } 119 120 return details; 121 }, 122 getQuantity : function (id) { 123 var quantity = $('form.cart input[name="quantity"]').val(); 124 return typeof quantity != "undefined" ? quantity : 1; 125 }, 126 variationAlert : function () { 127 if ( jQuery('.variation_id').length > 0 && jQuery('.variation_id').val() == '' || jQuery('.variation_id').val() == 0 ) { 128 alert('Variation not selected'); 129 return false; 130 } 131 return true; 132 }, 54 133 dataLoaded: function(response) { 55 var $parsed = JSON.parse( response ); 56 $('#pqfw-quotations-list-row').html( $parsed.html ); 57 window.pqfwProducts = $parsed.products; 134 $('#pqfw-quotations-list-row').html( response.html ); 135 window.pqfwProducts = response.products; 58 136 this.hideLoader(); 59 this.visibleForm( $parsed.products);137 this.visibleForm(.products); 60 138 }, 61 139 hideLoader: function () { … … 64 142 showLoader: function() { 65 143 $('#pqfw-quotations-list-row').block({ 66 message: '<img src="' + PQFW_OBJECT.loader + '" />', 67 css: { 68 width: '40px', 69 height: '40px', 70 top: '50%', 71 left: '50%', 72 border: '0px', 73 backgroundColor: "transparent" 74 }, 75 overlayCSS: { 76 background: "#fff", 77 opacity: .7 78 } 79 }); 144 message: '' 145 }); 146 // $('#pqfw-quotations-list-row').block({ 147 // message: '<img src="' + PQFW_OBJECT.loader + '" />', 148 // css: { 149 // width: '40px', 150 // height: '40px', 151 // top: '50%', 152 // left: '50%', 153 // border: '0px', 154 // backgroundColor: "transparent" 155 // }, 156 // overlayCSS: { 157 // background: "#fff", 158 // opacity: .7 159 // } 160 // }); 80 161 }, 81 162 removeProduct: function($hash) { 82 163 pqfwCart.showLoader(); 83 164 84 $.ajax({ 85 url : PQFW_OBJECT.ajaxurl, 86 type : 'POST', 87 data : { action: 'pqfw_remove_product', hash: $hash }, 88 success : function( response ) { 89 pqfwCart.dataLoaded(response); 90 }, 91 error : function( response ) { 92 console.error(response); 165 wp.ajax.send( 166 'pqfw_remove_product', 167 { 168 data : { 169 hash : $hash, 170 nonce : PQFW_OBJECT.nonce 171 }, 172 success : function( response ) { 173 pqfwCart.dataLoaded(response); 174 }, 175 error : function( error ) { 176 console.error(error); 177 } 93 178 } 94 });179 ); 95 180 }, 96 181 visibleForm:function( products ) { … … 104 189 pqfwCart.showLoader(); 105 190 106 $.ajax({ 107 url : PQFW_OBJECT.ajaxurl, 108 type : 'POST', 109 data : { 110 action: 'pqfw_update_products', 111 products: products 112 }, 113 success : function( response ) { 114 pqfwCart.dataLoaded(response); 115 }, 116 error : function( response ) { 117 console.error(response); 191 wp.ajax.send( 192 'pqfw_update_products', 193 { 194 data : { 195 products : products, 196 nonce : PQFW_OBJECT.nonce 197 }, 198 success : function( response ) { 199 pqfwCart.dataLoaded(response); 200 }, 201 error : function( error ) { 202 console.error(error); 203 } 118 204 } 119 });205 120 206 }, 121 207 }; 122 208 123 124 209 pqfwCart.init(); 125 126 210 window.pqfwCart = pqfwCart; 127 211 -
product-quotation-for-woocommerce/trunk/assets/js/pqfw-frontend.js
r2719227 r2729562 8 8 9 9 jQuery(function ( $ ) { 10 11 var PQFW = {12 init : function() {13 $(document)14 .on('click', '.pqfw-add-to-quotation-single', function (ev) {15 ev.preventDefault();16 PQFW.sendData(this);17 });18 },19 20 sendData : function(button) {21 var data = {22 productID : $(button).data('id'),23 action : PQFW_OBJECT.actions.addToQuotations,24 variationID : PQFW.getVariationID(),25 variationDetails : PQFW.getVariationDetails(),26 quantity : PQFW.getQuantity()27 };28 29 if( PQFW.variationAlert() ) {30 PQFW.setLoading(button);31 32 $.post( PQFW_OBJECT.ajaxurl, data,33 function (response) {34 PQFW.addToQuotationCart(button);35 }36 );37 }38 },39 addToQuotationCart : function (button) {40 $(button).removeClass('loading');41 $(button).addClass('added');42 PQFW.viewQuotationCart(button);43 },44 viewQuotationCart : function (button) {45 var url = PQFW_OBJECT.cartPageUrl;46 if (url != false) {47 $(".pqfw-view-quotation-cart").remove();48 $(button).after('<a class="pqfw-view-quotation-cart" href="' + url + '">' + PQFW_OBJECT.ViewCartLabel + '</a>');49 }50 },51 setLoading : function (button) {52 $(button).addClass('loading');53 },54 getVariationID : function () {55 var variation = $("form.variations_form input[name='variation_id']").val();56 return typeof variation != "undefined" && variation != 0 ? parseInt(variation) : 0;57 },58 getVariationDetails : function () {59 var variation = $("form.variations_form input[name='variation_id']").val(),60 details = {};61 62 if (typeof variation != "undefined" && variation != 0) {63 jQuery('select[name^=attribute_]').each(function (ind, obj) {64 details[jQuery(this).attr('name')] = jQuery(this).val();65 });66 }67 68 if ($.isEmptyObject(details)) {69 return 0;70 }71 72 return details;73 },74 getQuantity : function (id) {75 var quantity = $('form.cart input[name="quantity"]').val();76 return typeof quantity != "undefined" ? quantity : 1;77 },78 variationAlert : function () {79 if ( jQuery('.variation_id').length > 0 && jQuery('.variation_id').val() == '' || jQuery('.variation_id').val() == 0 ) {80 alert('Variation not selected');81 return false;82 }83 return true;84 },85 }86 87 PQFW.init();88 10 89 11 $( document ) -
product-quotation-for-woocommerce/trunk/build/index.asset.php
r2719764 r2729562 1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-components', 'wp-element'), 'version' => ' 7ceefa0643906d2d14268d422fd6cc43');1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-components', 'wp-element'), 'version' => ''); -
product-quotation-for-woocommerce/trunk/build/index.js
r2719764 r2729562 1 !function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var t;e.g.importScripts&&(t=e.g.location+"");var n=e.g.document;if(!t&&n&&(n.currentScript&&(t=n.currentScript.src),!t)){var o=n.getElementsByTagName("script");o.length&&(t=o[o.length-1].src)}if(!t)throw new O("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=t}();var t=window.wp.element,n=window.React,o=e.n(n),a=window.ReactDOM,r=e.n(a);function l(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=l(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function s(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=l(e))&&(o&&(o+=" "),o+=t);return o}function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i.apply(this,arguments)}function c(e,t){if(null==e)return{};var n,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(a[n]=e[n]);return a}function u(e){return"number"==typeof e&&!isNaN(e)}function m(e){return"boolean"==typeof e}function d(e){return"string"==typeof e}function p(e){return"function"==typeof e}function g(e){return d(e)||p(e)?e:null}function f(e){return 0===e||e}var v=!("undefined"==typeof window||!window.document||!window.document.createElement);function h(e){return(0,n.isValidElement)(e)||d(e)||p(e)||u(e)}var E={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},b={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function w(e){var t=e.enter,a=e.exit,r=e.appendPosition,l=void 0!==r&&r,s=e.collapse,i=void 0===s||s,c=e.collapseDuration,u=void 0===c?300:c;return function(e){var r=e.children,s=e.position,c=e.preventExitTransition,m=e.done,d=e.nodeRef,p=e.isIn,g=l?t+"--"+s:t,f=l?a+"--"+s:a,v=(0,n.useRef)(),h=(0,n.useRef)(0);function E(e){if(e.target===d.current){var t=d.current;t.dispatchEvent(new Event("d")),t.removeEventListener("animationend",E),t.removeEventListener("animationcancel",E),0===h.current&&(t.className=v.current)}}function b(){var e=d.current;e.removeEventListener("animationend",b),i?function(e,t,n){void 0===n&&(n=300);var o=e.scrollHeight,a=e.style;requestAnimationFrame((function(){a.minHeight="initial",a.height=o+"px",a.transition="all "+n+"ms",requestAnimationFrame((function(){a.height="0",a.padding="0",a.margin="0",setTimeout(t,n)}))}))}(e,m,u):m()}return(0,n.useLayoutEffect)((function(){var e;e=d.current,v.current=e.className,e.className+=" "+g,e.addEventListener("animationend",E),e.addEventListener("animationcancel",E)}),[]),(0,n.useEffect)((function(){p||(c?b():function(){h.current=1;var e=d.current;e.className+=" "+f,e.addEventListener("animationend",b)}())}),[p]),o().createElement(o().Fragment,null,r)}}var y={list:new Map,emitQueue:new Map,on:function(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off:function(e,t){if(t){var n=this.list.get(e).filter((function(e){return e!==t}));return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit:function(e){var t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit:function(e){for(var t=this,n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];this.list.has(e)&&this.list.get(e).forEach((function(n){var a=setTimeout((function(){n.apply(void 0,o)}),0);t.emitQueue.has(e)||t.emitQueue.set(e,[]),t.emitQueue.get(e).push(a)}))}},_=["delay","staleId"];function C(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function L(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function M(e){var t=e.closeToast,o=e.theme,a=e.ariaLabel,r=void 0===a?"close":a;return(0,n.createElement)("button",{className:"Toastify__close-button Toastify__close-button--"+o,type:"button",onClick:function(e){e.stopPropagation(),t(e)},"aria-label":r},(0,n.createElement)("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},(0,n.createElement)("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function N(e){var t,o,a=e.delay,r=e.isRunning,l=e.closeToast,c=e.type,u=e.hide,m=e.className,d=e.style,g=e.controlledProgress,f=e.progress,v=e.rtl,h=e.isIn,E=e.theme,b=i({},d,{animationDuration:a+"ms",animationPlayState:r?"running":"paused",opacity:u?0:1});g&&(b.transform="scaleX("+f+")");var w=s("Toastify__progress-bar",g?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+E,"Toastify__progress-bar--"+c,((t={})["Toastify__progress-bar--rtl"]=v,t)),y=p(m)?m({rtl:v,type:c,defaultClassName:w}):s(w,m),_=((o={})[g&&f>=1?"onTransitionEnd":"onAnimationEnd"]=g&&f<1?null:function(){h&&l()},o);return(0,n.createElement)("div",Object.assign({role:"progressbar","aria-hidden":u?"true":"false","aria-label":"notification timer",className:y,style:b},_))}N.defaultProps={type:b.DEFAULT,hide:!1};var T=["theme","type"],S=function(e){var t=e.theme,o=e.type,a=c(e,T);return(0,n.createElement)("svg",Object.assign({viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===t?"currentColor":"var(--toastify-icon-color-"+o+")"},a))};function O(e){return(0,n.createElement)(S,Object.assign({},e),(0,n.createElement)("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}var D={info:function(e){return(0,n.createElement)(S,Object.assign({},e),(0,n.createElement)("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return(0,n.createElement)(S,Object.assign({},e),(0,n.createElement)("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return(0,n.createElement)(S,Object.assign({},e),(0,n.createElement)("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:O,spinner:function(){return(0,n.createElement)("div",{className:"Toastify__spinner"})}},k=function(e){var t,o,a=function(e){var t=(0,n.useState)(!1),o=t[0],a=t[1],r=(0,n.useState)(!1),l=r[0],s=r[1],i=(0,n.useRef)(null),c=(0,n.useRef)({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,u=(0,n.useRef)(e),m=e.autoClose,d=e.pauseOnHover,g=e.closeToast,f=e.onClick,v=e.closeOnClick;function h(t){if(e.draggable){c.didMove=!1,document.addEventListener("mousemove",y),document.addEventListener("mouseup",_),document.addEventListener("touchmove",y),document.addEventListener("touchend",_);var n=i.current;c.canCloseOnClick=!0,c.canDrag=!0,c.boundingRect=n.getBoundingClientRect(),n.style.transition="",c.x=C(t.nativeEvent),c.y=L(t.nativeEvent),"x"===e.draggableDirection?(c.start=c.x,c.removalDistance=n.offsetWidth*(e.draggablePercent/100)):(c.start=c.y,c.removalDistance=n.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent/100))}}function E(){if(c.boundingRect){var t=c.boundingRect,n=t.top,o=t.bottom,a=t.left,r=t.right;e.pauseOnHover&&c.x>=a&&c.x<=r&&c.y>=n&&c.y<=o?w():b()}}function b(){a(!0)}function w(){a(!1)}function y(t){var n=i.current;c.canDrag&&n&&(c.didMove=!0,o&&w(),c.x=C(t),c.y=L(t),"x"===e.draggableDirection?c.delta=c.x-c.start:c.delta=c.y-c.start,c.start!==c.x&&(c.canCloseOnClick=!1),n.style.transform="translate"+e.draggableDirection+"("+c.delta+"px)",n.style.opacity=""+(1-Math.abs(c.delta/c.removalDistance)))}function _(){document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",y),document.removeEventListener("touchend",_);var t=i.current;if(c.canDrag&&c.didMove&&t){if(c.canDrag=!1,Math.abs(c.delta)>c.removalDistance)return s(!0),void e.closeToast();t.style.transition="transform 0.2s, opacity 0.2s",t.style.transform="translate"+e.draggableDirection+"(0)",t.style.opacity="1"}}(0,n.useEffect)((function(){u.current=e})),(0,n.useEffect)((function(){return i.current&&i.current.addEventListener("d",b,{once:!0}),p(e.onOpen)&&e.onOpen((0,n.isValidElement)(e.children)&&e.children.props),function(){var e=u.current;p(e.onClose)&&e.onClose((0,n.isValidElement)(e.children)&&e.children.props)}}),[]),(0,n.useEffect)((function(){return e.pauseOnFocusLoss&&(document.hasFocus()||w(),window.addEventListener("focus",b),window.addEventListener("blur",w)),function(){e.pauseOnFocusLoss&&(window.removeEventListener("focus",b),window.removeEventListener("blur",w))}}),[e.pauseOnFocusLoss]);var M={onMouseDown:h,onTouchStart:h,onMouseUp:E,onTouchEnd:E};return m&&d&&(M.onMouseEnter=w,M.onMouseLeave=b),v&&(M.onClick=function(e){f&&f(e),c.canCloseOnClick&&g()}),{playToast:b,pauseToast:w,isRunning:o,preventExitTransition:l,toastRef:i,eventHandlers:M}}(e),r=a.isRunning,l=a.preventExitTransition,i=a.toastRef,c=a.eventHandlers,u=e.closeButton,m=e.children,g=e.autoClose,f=e.onClick,v=e.type,h=e.hideProgressBar,E=e.closeToast,b=e.transition,w=e.position,y=e.className,_=e.style,M=e.bodyClassName,T=e.bodyStyle,S=e.progressClassName,O=e.progressStyle,k=e.updateId,j=e.role,I=e.progress,q=e.rtl,x=e.toastId,A=e.deleteToast,P=e.isIn,R=e.isLoading,z=e.icon,F=e.theme,B=s("Toastify__toast","Toastify__toast-theme--"+F,"Toastify__toast--"+v,((t={})["Toastify__toast--rtl"]=q,t)),Q=p(y)?y({rtl:q,position:w,type:v,defaultClassName:B}):s(B,y),Y=!!I,H=D[v],U={theme:F,type:v},G=H&&H(U);return!1===z?G=void 0:p(z)?G=z(U):(0,n.isValidElement)(z)?G=(0,n.cloneElement)(z,U):d(z)?G=z:R&&(G=D.spinner()),(0,n.createElement)(b,{isIn:P,done:A,position:w,preventExitTransition:l,nodeRef:i},(0,n.createElement)("div",Object.assign({id:x,onClick:f,className:Q},c,{style:_,ref:i}),(0,n.createElement)("div",Object.assign({},P&&{role:j},{className:p(M)?M({type:v}):s("Toastify__toast-body",M),style:T}),G&&(0,n.createElement)("div",{className:s("Toastify__toast-icon",(o={},o["Toastify--animate-icon Toastify__zoom-enter"]=!R,o))},G),(0,n.createElement)("div",null,m)),function(e){if(e){var t={closeToast:E,type:v,theme:F};return p(e)?e(t):(0,n.isValidElement)(e)?(0,n.cloneElement)(e,t):void 0}}(u),(g||Y)&&(0,n.createElement)(N,Object.assign({},k&&!Y?{key:"pb-"+k}:{},{rtl:q,theme:F,delay:g,isRunning:r,isIn:P,closeToast:E,hide:h,type:v,style:O,className:S,controlledProgress:Y,progress:I}))))},j=function(e){var t=function(e){var t=(0,n.useReducer)((function(e){return e+1}),0)[1],o=(0,n.useState)([]),a=o[0],r=o[1],l=(0,n.useRef)(null),s=(0,n.useRef)(new Map).current,i=function(e){return-1!==a.indexOf(e)},v=(0,n.useRef)({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:i,getToast:function(e){return s.get(e)}}).current;function E(e){var t=e.containerId;!v.props.limit||t&&v.containerId!==t||(v.count-=v.queue.length,v.queue=[])}function b(e){r((function(t){return f(e)?t.filter((function(t){return t!==e})):[]}))}function w(){var e=v.queue.shift();L(e.toastContent,e.toastProps,e.staleId)}function C(e,o){var a=o.delay,r=o.staleId,i=c(o,_);if(h(e)&&!function(e){return!l.current||v.props.enableMultiContainer&&e.containerId!==v.props.containerId||s.has(e.toastId)&&null==e.updateId}(i)){var E=i.toastId,y=i.updateId,C=i.data,M=v.props,N=function(){return b(E)},T=null==y;T&&v.count++;var S,O,D={toastId:E,updateId:y,isLoading:i.isLoading,theme:i.theme||M.theme,icon:null!=i.icon?i.icon:M.icon,isIn:!1,key:i.key||v.toastKey++,type:i.type,closeToast:N,closeButton:i.closeButton,rtl:M.rtl,position:i.position||M.position,transition:i.transition||M.transition,className:g(i.className||M.toastClassName),bodyClassName:g(i.bodyClassName||M.bodyClassName),style:i.style||M.toastStyle,bodyStyle:i.bodyStyle||M.bodyStyle,onClick:i.onClick||M.onClick,pauseOnHover:m(i.pauseOnHover)?i.pauseOnHover:M.pauseOnHover,pauseOnFocusLoss:m(i.pauseOnFocusLoss)?i.pauseOnFocusLoss:M.pauseOnFocusLoss,draggable:m(i.draggable)?i.draggable:M.draggable,draggablePercent:i.draggablePercent||M.draggablePercent,draggableDirection:i.draggableDirection||M.draggableDirection,closeOnClick:m(i.closeOnClick)?i.closeOnClick:M.closeOnClick,progressClassName:g(i.progressClassName||M.progressClassName),progressStyle:i.progressStyle||M.progressStyle,autoClose:!i.isLoading&&(S=i.autoClose,O=M.autoClose,!1===S||u(S)&&S>0?S:O),hideProgressBar:m(i.hideProgressBar)?i.hideProgressBar:M.hideProgressBar,progress:i.progress,role:i.role||M.role,deleteToast:function(){s.delete(E);var e=v.queue.length;if(v.count=f(E)?v.count-1:v.count-v.displayedToast,v.count<0&&(v.count=0),e>0){var n=f(E)?1:v.props.limit;if(1===e||1===n)v.displayedToast++,w();else{var o=n>e?e:n;v.displayedToast=o;for(var a=0;a<o;a++)w()}}else t()}};p(i.onOpen)&&(D.onOpen=i.onOpen),p(i.onClose)&&(D.onClose=i.onClose),D.closeButton=M.closeButton,!1===i.closeButton||h(i.closeButton)?D.closeButton=i.closeButton:!0===i.closeButton&&(D.closeButton=!h(M.closeButton)||M.closeButton);var k=e;(0,n.isValidElement)(e)&&!d(e.type)?k=(0,n.cloneElement)(e,{closeToast:N,toastProps:D,data:C}):p(e)&&(k=e({closeToast:N,toastProps:D,data:C})),M.limit&&M.limit>0&&v.count>M.limit&&T?v.queue.push({toastContent:k,toastProps:D,staleId:r}):u(a)&&a>0?setTimeout((function(){L(k,D,r)}),a):L(k,D,r)}}function L(e,t,n){var o=t.toastId;n&&s.delete(n),s.set(o,{content:e,props:t}),r((function(e){return[].concat(e,[o]).filter((function(e){return e!==n}))}))}return(0,n.useEffect)((function(){return v.containerId=e.containerId,y.cancelEmit(3).on(0,C).on(1,(function(e){return l.current&&b(e)})).on(5,E).emit(2,v),function(){return y.emit(3,v)}}),[]),(0,n.useEffect)((function(){v.isToastActive=i,v.displayedToast=a.length,y.emit(4,a.length,e.containerId)}),[a]),(0,n.useEffect)((function(){v.props=e})),{getToastToRender:function(t){var n=new Map,o=Array.from(s.values());return e.newestOnTop&&o.reverse(),o.forEach((function(e){var t=e.props.position;n.has(t)||n.set(t,[]),n.get(t).push(e)})),Array.from(n,(function(e){return t(e[0],e[1])}))},containerRef:l,isToastActive:i}}(e),o=t.getToastToRender,a=t.containerRef,r=t.isToastActive,l=e.className,v=e.style,E=e.rtl,b=e.containerId;function w(e){var t,n=s("Toastify__toast-container","Toastify__toast-container--"+e,((t={})["Toastify__toast-container--rtl"]=E,t));return p(l)?l({position:e,rtl:E,defaultClassName:n}):s(n,g(l))}return(0,n.createElement)("div",{ref:a,className:"Toastify",id:b},o((function(e,t){var o=t.length?i({},v):i({},v,{pointerEvents:"none"});return(0,n.createElement)("div",{className:w(e),style:o,key:"container-"+e},t.map((function(e){var t=e.content,o=e.props;return(0,n.createElement)(k,Object.assign({},o,{isIn:r(o.toastId),key:"toast-"+o.key,closeButton:!0===o.closeButton?M:o.closeButton}),t)})))})))};j.defaultProps={position:E.TOP_RIGHT,transition:w({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:M,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};var I,q,x,A=new Map,P=[],R=!1;function z(){return Math.random().toString(36).substring(2,9)}function F(e){return e&&(d(e.toastId)||u(e.toastId))?e.toastId:z()}function B(e,t){return A.size>0?y.emit(0,e,t):(P.push({content:e,options:t}),R&&v&&(R=!1,q=document.createElement("div"),document.body.appendChild(q),(0,a.render)((0,n.createElement)(j,Object.assign({},x)),q))),t.toastId}function Q(e,t){return i({},t,{type:t&&t.type||e,toastId:F(t)})}function Y(e){return function(t,n){return B(t,Q(e,n))}}function H(e,t){return B(e,Q(b.DEFAULT,t))}H.loading=function(e,t){return B(e,Q(b.DEFAULT,i({isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1},t)))},H.promise=function(e,t,n){var o,a=t.pending,r=t.error,l=t.success;a&&(o=d(a)?H.loading(a,n):H.loading(a.render,i({},n,a)));var s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=function(e,t,a){if(null!=t){var r=i({type:e},s,n,{data:a}),l=d(t)?{render:t}:t;return o?H.update(o,i({},r,l)):H(l.render,i({},r,l)),a}H.dismiss(o)},u=p(e)?e():e;return u.then((function(e){return c("success",l,e)})).catch((function(e){return c("error",r,e)})),u},H.success=Y(b.SUCCESS),H.info=Y(b.INFO),H.error=Y(b.ERROR),H.warning=Y(b.WARNING),H.warn=H.warning,H.dark=function(e,t){return B(e,Q(b.DEFAULT,i({theme:"dark"},t)))},H.dismiss=function(e){return y.emit(1,e)},H.clearWaitingQueue=function(e){return void 0===e&&(e={}),y.emit(5,e)},H.isActive=function(e){var t=!1;return A.forEach((function(n){n.isToastActive&&n.isToastActive(e)&&(t=!0)})),t},H.update=function(e,t){void 0===t&&(t={}),setTimeout((function(){var n=function(e,t){var n=t.containerId,o=A.get(n||I);return o?o.getToast(e):null}(e,t);if(n){var o=n.props,a=n.content,r=i({},o,t,{toastId:t.toastId||e,updateId:z()});r.toastId!==e&&(r.staleId=e);var l=r.render||a;delete r.render,B(l,r)}}),0)},H.done=function(e){H.update(e,{progress:1})},H.onChange=function(e){return p(e)&&y.on(4,e),function(){p(e)&&y.off(4,e)}},H.configure=function(e){void 0===e&&(e={}),R=!0,x=e},H.POSITION=E,H.TYPE=b,y.on(2,(function(e){I=e.containerId||e,A.set(I,e),P.forEach((function(e){y.emit(0,e.content,e.options)})),P=[]})).on(3,(function(e){A.delete(e.containerId||e),0===A.size&&y.off(0).off(1).off(5),v&&q&&document.body.removeChild(q)}));var U=window.wp.components,G=e.p+"images/reset.3bcbcd44.png",V=e=>{let{settings:o,setSettings:a,saveSettings:r}=e;const[l,s]=(0,n.useState)(!1),[i,c]=(0,n.useState)(!1),[u,m]=(0,n.useState)(!1),[d,p]=(0,n.useState)(!1),g=(0,n.useRef)(null),f=(0,n.useRef)(null),v=(0,n.useRef)(null),h=(0,n.useRef)(null),E=e=>{g.current&&!g.current.contains(e.target)&&s(!1),f.current&&!f.current.contains(e.target)&&c(!1),v.current&&!v.current.contains(e.target)&&m(!1),h.current&&!h.current.contains(e.target)&&p(!1)};return(0,n.useEffect)((()=>(document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)})),[E]),(0,t.createElement)("div",{id:"pqfw-settings-button",className:"pqfw-settings-tab-content pqfw-settings-tab-content-active"},(0,t.createElement)("h3",{className:"pqfw-tab-title"},"Button Settings"),(0,t.createElement)("div",{className:"inside"},(0,t.createElement)("p",{className:"help"},"For better experience choose your own button settings and styles that will ensure the design compatibility with your active theme, as wel as functionality"),(0,t.createElement)("table",{className:"form-table"},(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Show Button"),(0,t.createElement)("td",null,(0,t.createElement)(U.FormToggle,{checked:null==o?void 0:o.pqfw_shop_page_button,onChange:e=>a({...o,pqfw_shop_page_button:e.target.checked})}),(0,t.createElement)("p",{className:"description"},"Show ",(0,t.createElement)("strong",null,"Add To Quotation")," button on category/shop/loop page"))),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Show Button"),(0,t.createElement)("td",null,(0,t.createElement)(U.FormToggle,{checked:null==o?void 0:o.pqfw_product_page_button,onChange:e=>a({...o,pqfw_product_page_button:e.target.checked})}),(0,t.createElement)("p",{className:"description"},"Show ",(0,t.createElement)("strong",null,"Add To Quotation")," button on product single page"))),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Button Text"),(0,t.createElement)("td",null,(0,t.createElement)("input",{type:"text",className:"regular-text",value:null==o?void 0:o.button_text,onChange:e=>a({...o,button_text:e.target.value})}),(0,t.createElement)("p",{className:"description"},"Show ",(0,t.createElement)("strong",null,"Add To Quotation")," button on product single page"))),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Button position in Loop"),(0,t.createElement)("td",null,(0,t.createElement)(U.SelectControl,{label:"Button position in Loop",value:null==o?void 0:o.button_position,hideLabelFromVision:!0,options:[{label:"At product end",value:"woocommerce_after_shop_loop_item"},{label:"At product start",value:"woocommerce_before_shop_loop_item"},{label:"Before product title",value:"woocommerce_before_shop_loop_item_title"},{label:"After product title",value:"woocommerce_after_shop_loop_item_title"}],onChange:e=>a({...o,button_position:e})}),(0,t.createElement)("p",{className:"description"},"Receive email for each user submitted quotatin from the ",(0,t.createElement)("strong",null,"Quotations Cart")," page."))),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Button position in Single Product"),(0,t.createElement)("td",null,(0,t.createElement)(U.SelectControl,{label:"Button position in Loop",value:null==o?void 0:o.button_position_single_product,hideLabelFromVision:!0,options:[{label:"Before add to cart button",value:"woocommerce_after_add_to_cart_quantity"},{label:"After add to cart button",value:"woocommerce_after_add_to_cart_button"},{label:"End of product",value:"woocommerce_share"}],onChange:e=>a({...o,button_position_single_product:e})}),(0,t.createElement)("p",{className:"description"},"Receive email for each user submitted quotatin from the ",(0,t.createElement)("strong",null,"Quotations Cart")," page."))),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Button Style"),(0,t.createElement)("td",null,(0,t.createElement)(U.TabPanel,{className:"my-tab-panel",activeClass:"active-tab",initialTabName:"normal",tabs:[{name:"normal",title:"Normal",className:"normal-color"},{name:"hover",title:"Hover",className:"hover-color"}]},(e=>(0,t.createElement)("div",{className:"pqfw-color-picker-container"},"hover"===e.name&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",{className:"color-picker-label"},"Text Color"),(0,t.createElement)(U.ColorIndicator,{colorValue:null==o?void 0:o.button_hover_color,onClick:()=>s(!l)}),l&&(0,t.createElement)("div",{className:"pqfw-hover-color-container",ref:g},(0,t.createElement)(U.ColorPicker,{color:null==o?void 0:o.button_hover_color,onChange:e=>a({...o,button_hover_color:e}),enableAlpha:!1,defaultValue:null==o?void 0:o.button_hover_color})),(0,t.createElement)("p",{className:"color-picker-label"},"Background"),(0,t.createElement)(U.ColorIndicator,{colorValue:null==o?void 0:o.button_hover_bg_color,onClick:()=>c(!i)}),i&&(0,t.createElement)("div",{className:"pqfw-hover-color-container",ref:f},(0,t.createElement)(U.ColorPicker,{color:null==o?void 0:o.button_hover_bg_color,onChange:e=>a({...o,button_hover_bg_color:e}),enableAlpha:!1,defaultValue:null==o?void 0:o.button_hover_bg_color})),(0,t.createElement)("button",{onClick:()=>{confirm("Reset the custom style and back to theme default style?")&&a({...o,button_hover_color:"",button_hover_bg_color:""})},className:"pqfw-reset-btn"},(0,t.createElement)("img",{src:G}),"Reset")),"normal"===e.name&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",{className:"color-picker-label"},"Text Color"),(0,t.createElement)(U.ColorIndicator,{colorValue:null==o?void 0:o.button_normal_color,onClick:()=>m(!u)}),u&&(0,t.createElement)("div",{className:"pqfw-normal-color-container",ref:v},(0,t.createElement)(U.ColorPicker,{color:null==o?void 0:o.button_normal_color,onChange:e=>a({...o,button_normal_color:e}),enableAlpha:!1,defaultValue:null==o?void 0:o.button_normal_color})),(0,t.createElement)("p",{className:"color-picker-label"},"Background"),(0,t.createElement)(U.ColorIndicator,{colorValue:null==o?void 0:o.button_normal_bg_color,onClick:()=>p(!d)}),d&&(0,t.createElement)("div",{className:"pqfw-normal-color-container",ref:h},(0,t.createElement)(U.ColorPicker,{color:null==o?void 0:o.button_normal_bg_color,onChange:e=>a({...o,button_normal_bg_color:e}),enableAlpha:!1,defaultValue:null==o?void 0:o.button_normal_bg_color})),(0,t.createElement)("p",{className:"color-picker-label"},"Font Size"),(0,t.createElement)(U.RangeControl,{value:null==o?void 0:o.button_font_size,onChange:e=>a({...o,button_font_size:e}),max:50}),(0,t.createElement)("p",{className:"color-picker-label"},"Width"),(0,t.createElement)(U.RangeControl,{value:null==o?void 0:o.button_width,onChange:e=>a({...o,button_width:e}),max:300}),(0,t.createElement)("button",{onClick:()=>{confirm("Reset the custom style and back to theme default style?")&&a({...o,button_normal_color:"",button_normal_bg_color:"",button_font_size:0,button_width:0})},className:"pqfw-reset-btn"},(0,t.createElement)("img",{src:G}),"Reset"))))))))),(0,t.createElement)("div",{className:"submit-wrapper"},(0,t.createElement)("button",{className:"button button-primary",onClick:r},"Save Changes")))},W=e=>{let{settings:n,setSettings:o,saveSettings:a}=e;return(0,t.createElement)("div",{id:"pqfw-settings-button",className:"pqfw-settings-tab-content pqfw-settings-tab-content-active"},(0,t.createElement)("h3",{className:"pqfw-tab-title"},"Email Settings"),(0,t.createElement)("div",{className:"inside"},(0,t.createElement)("p",{className:"help"},"Customize email settings for better experience that will ensure the ease of use as you like."),(0,t.createElement)("table",{className:"form-table"},(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Receive Email"),(0,t.createElement)("td",null,(0,t.createElement)(U.FormToggle,{checked:null==n?void 0:n.pqfw_form_send_mail,onChange:e=>o({...n,pqfw_form_send_mail:e.target.checked})}),(0,t.createElement)("p",{className:"description"},"Receive email for each user submitted quotatin from the ",(0,t.createElement)("strong",null,"Quotations Cart")," page."))),(null==n?void 0:n.pqfw_form_send_mail)&&(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Recipient"),(0,t.createElement)("td",null,(0,t.createElement)("input",{type:"text",value:null==n?void 0:n.recipient,className:"regular-text",onChange:e=>o({...n,recipient:e.target.value})}),(0,t.createElement)("p",{className:"description"},"Add recipient email ID that will receive each quotation on the email."))),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Send Email"),(0,t.createElement)("td",null,(0,t.createElement)(U.FormToggle,{checked:null==n?void 0:n.pqfw_send_mail_to_customer,onChange:e=>o({...n,pqfw_send_mail_to_customer:e.target.checked})}),(0,t.createElement)("p",{className:"description"},"Send a copy of the email to the customer as well for each submitted quotation from the ",(0,t.createElement)("strong",null,"Quotations Cart")," page."))))),(0,t.createElement)("div",{className:"submit-wrapper"},(0,t.createElement)("button",{className:"button button-primary",onClick:a},"Save Changes")))},Z=e=>{let{settings:n,setSettings:o,saveSettings:a}=e;return(0,t.createElement)("div",{id:"pqfw-settings-button",className:"pqfw-settings-tab-content pqfw-settings-tab-content-active"},(0,t.createElement)("h3",{className:"pqfw-tab-title"},"Form Settings"),(0,t.createElement)("div",{className:"inside"},(0,t.createElement)("p",{className:"help"},"For better experience choose your own form styles that will ensure the design compatibility with your active theme."),(0,t.createElement)("table",{className:"form-table"},(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Default Form Style"),(0,t.createElement)("td",null,(0,t.createElement)(U.FormToggle,{checked:null==n?void 0:n.pqfw_form_default_design,onChange:e=>o({...n,pqfw_form_default_design:e.target.checked})}),(0,t.createElement)("p",{className:"description"},"Use default form style that comes with this plugin or you can clean design your own form styles rather not overriding each css class."))),null!=n&&n.pqfw_form_default_design?(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Floated Form"),(0,t.createElement)("td",null,(0,t.createElement)(U.FormToggle,{checked:null==n?void 0:n.pqfw_floating_form,onChange:e=>o({...n,pqfw_floating_form:e.target.checked})}),(0,t.createElement)("p",{className:"description"},"Use floated or stacked styled form on the ",(0,t.createElement)("strong",null,"Quotations Cart")," Page."))):"",(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Add Privacy Policy"),(0,t.createElement)("td",null,(0,t.createElement)(U.FormToggle,{checked:null==n?void 0:n.privacy_policy,onChange:e=>o({...n,privacy_policy:e.target.checked})}),(0,t.createElement)("p",{className:"description"},"Ask user to accept terms and condition before submitting the quotation form."))),null!=n&&n.privacy_policy?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Privacy Policy Label"),(0,t.createElement)("td",null,(0,t.createElement)("input",{type:"text",className:"regular-text",value:null==n?void 0:n.privacy_policy_label,onChange:e=>o({...n,privacy_policy_label:e.target.value})}),(0,t.createElement)("p",{className:"description"},"You can use the shortcode [terms] and [privacy_policy] (from WooCommerce 3.4.0)"))),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Privacy Policy"),(0,t.createElement)("td",null,(0,t.createElement)("textarea",{cols:"30",rows:"5",className:"regular-text",onChange:e=>o({...n,privacy_policy_content:e.target.value})},null==n?void 0:n.privacy_policy_content),(0,t.createElement)("p",{className:"description"},"You can use the shortcode [terms] and [privacy_policy] (from WooCommerce 3.4.0)")))):"")),(0,t.createElement)("div",{className:"submit-wrapper"},(0,t.createElement)("button",{className:"button button-primary",onClick:a},"Save Changes")))};const X=Object.assign({},window.PQFW_OBJECT);function J(){return X.nonce}delete window.PQFW_OBJECT.ajaxurl,delete window.PQFW_OBJECT.nonce,delete window.PQFW_OBJECT.settings;var $=e=>{let{settings:o,setSettings:a,saveSettings:r}=e;const[l,s]=(0,n.useState)([...X.pages]),[i,c]=(0,n.useState)(null===(u=X.cart)||void 0===u?void 0:u.url);var u;return(0,n.useEffect)((()=>{wp.ajax.send("pqfw_cart_get_permalink",{data:{_wpnonce:J(),pageID:null==o?void 0:o.quotation_cart_page},success:e=>{let{url:t}=e;c(t)}})}),[o.quotation_cart_page]),(0,t.createElement)("div",{id:"pqfw-settings-button",className:"pqfw-settings-tab-content pqfw-settings-tab-content-active"},(0,t.createElement)("h3",{className:"pqfw-tab-title"},"General Settings"),(0,t.createElement)("div",{className:"inside"},(0,t.createElement)("p",{className:"help"},"Customize email settings for better experience that will ensure the ease of use as you like."),(0,t.createElement)("table",{className:"form-table"},(0,t.createElement)("tr",null,(0,t.createElement)("th",null,'Hide "Add to cart" Button'),(0,t.createElement)("td",null,(0,t.createElement)(U.FormToggle,{checked:null==o?void 0:o.hide_add_to_cart_button,onChange:e=>a({...o,hide_add_to_cart_button:e.target.checked})}),(0,t.createElement)("p",{className:"description"},"Receive email for each user submitted quotatin from the ",(0,t.createElement)("strong",null,"Quotations Cart")," page."))),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,"Hide product prices"),(0,t.createElement)("td",null,(0,t.createElement)(U.FormToggle,{checked:null==o?void 0:o.hide_product_prices,onChange:e=>a({...o,hide_product_prices:e.target.checked})}),(0,t.createElement)("p",{className:"description"},"Receive email for each user submitted quotatin from the ",(0,t.createElement)("strong",null,"Quotations Cart")," page."))),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,'"Quotation cart" page'),(0,t.createElement)("td",null,(0,t.createElement)(U.SelectControl,{label:"Quotation cart page",value:o.quotation_cart_page,hideLabelFromVision:!0,options:l,onChange:e=>a({...o,quotation_cart_page:e})}),(0,t.createElement)("p",{className:"description"},"Choose from this list the page on which users will see the list of products added to the quote and send the request. Visit current ",(0,t.createElement)("a",{target:"_blank",href:i},(0,t.createElement)("strong",null,"Quotation Cart Page"))))))),(0,t.createElement)("div",{className:"submit-wrapper"},(0,t.createElement)("button",{className:"button button-primary",onClick:r},"Save Changes")))},K=e.p+"images/button.3f1daf8f.png",ee=e.p+"images/form.3bf7f595.png",te=e.p+"images/email.5183ffb9.png";r().render((0,t.createElement)((()=>{const e=localStorage.getItem("pqfw_settings_active_tab")||"general",[o,a]=(0,n.useState)(e),[r,l]=(0,n.useState)(X.settings),s=e=>{localStorage.setItem("pqfw_settings_active_tab",e)},i=e=>{let t=e.target;t.classList.add("updating-message"),wp.ajax.send("pqrf_save_settings",{data:{_wpnonce:J(),settings:JSON.stringify(r)},success:function(e){H.success(e.message)},error:function(e){H.error(e.message)},complete:function(){t.classList.remove("updating-message")}})};return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("h1",{className:"pqfw-app-title"},"Settings"),(0,t.createElement)("div",{className:"pqfw-settings-tabs-warp"},(0,t.createElement)(j,{position:"top-right",autoClose:2e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,pauseOnHover:!0,theme:"colored"}),(0,t.createElement)("div",{id:"pqfw-settings-tabs"},(0,t.createElement)("a",{href:"#",className:"pqfw-settings-nav-tab"+("general"===o?" pqfw-settings-nav-tab-active":""),onClick:()=>{a("general"),s("general")}},(0,t.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMS4yNCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiM5YjU5YjZ9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkdlbmVyYWwgU2V0dGluZzwvdGl0bGU+PGcgaWQ9IkxheWVyXzIiIGRhdGEtbmFtZT0iTGF5ZXIgMiI+PGcgaWQ9IkxheWVyXzEtMiIgZGF0YS1uYW1lPSJMYXllciAxIj48cGF0aCBkPSJNMTkuNTksMTMuNThsLTEuODctMS40NGEuMjcuMjcsMCwwLDEtLjEzLS4zLDYuNTMsNi41MywwLDAsMCwwLTIuNDIuMjguMjgsMCwwLDEsLjE0LS4zM2wxLjg3LTEuNDRhLjg0Ljg0LDAsMCwwLC4yNC0xLjJsLTEuMy0yLjI2YS44Ni44NiwwLDAsMC0xLjE4LS40bC0yLjIuOTFhLjMuMywwLDAsMS0uMzYtLjA1LDcuMDYsNy4wNiwwLDAsMC0yLTEuMTguMzIuMzIsMCwwLDEtLjI0LS4zYy0uMS0uNzgtLjIxLTEuNTYtLjMtMi4zNEEuODUuODUsMCwwLDAsMTEuMzUsMFExMCwwLDguNjQsMGEuODUuODUsMCwwLDAtLjg4LjgzYy0uMS43OC0uMjEsMS41Ni0uMzEsMi4zNGEuMy4zLDAsMCwxLS4yMi4yOSw3LDcsMCwwLDAtMiwxLjE3LjMyLjMyLDAsMCwxLS4zOC4wNkwyLjY2LDMuOGEuODYuODYsMCwwLDAtMS4yMS40MkwuMiw2LjM2QS44OS44OSwwLDAsMCwuNDcsNy43MkwyLjI5LDkuMTFhLjI1LjI1LDAsMCwxLC4xMi4yOSw2LjQ1LDYuNDUsMCwwLDAsMCwyLjQuMzQuMzQsMCwwLDEtLjE3LjM4Yy0uNi40NS0xLjIuOTEtMS43OSwxLjM4YS44Ny44NywwLDAsMC0uMjYsMS4zTDEuNDUsMTdhLjg3Ljg3LDAsMCwwLDEuMi40MWwyLjE4LS45YS4zMi4zMiwwLDAsMSwuMzguMDUsNyw3LDAsMCwwLDIsMS4xNy4zNC4zNCwwLDAsMSwuMjUuMzFjLjEuNzcuMiwxLjU0LjMsMi4zMWEuODYuODYsMCwwLDAsLjkyLjg0aDIuNjZhLjg1Ljg1LDAsMCwwLC45LS44NGMuMS0uNzguMjEtMS41Ni4zMS0yLjM0YS4zLjMsMCwwLDEsLjIyLS4yOCw3LDcsMCwwLDAsMi0xLjE4LjMyLjMyLDAsMCwxLC4zOC0uMDVsMi4yLjkxYTIuMTgsMi4xOCwwLDAsMCwuMzEuMDkuODguODgsMCwwLDAsLjg0LS40NmwxLjMtMi4yNkEuODUuODUsMCwwLDAsMTkuNTksMTMuNThabS02LjE2LTIuODNhMy40NCwzLjQ0LDAsMCwxLTYuODgtLjEzLDMuNDQsMy40NCwwLDEsMSw2Ljg4LjEzWiIgY2xhc3M9ImNscy0xIi8+PC9nPjwvZz48L3N2Zz4="})," General Settings"),(0,t.createElement)("a",{href:"#",className:"pqfw-settings-nav-tab"+("button"===o?" pqfw-settings-nav-tab-active":""),onClick:()=>{a("button"),s("button")}},(0,t.createElement)("img",{src:K})," Button"),(0,t.createElement)("a",{href:"#",className:"pqfw-settings-nav-tab"+("form"===o?" pqfw-settings-nav-tab-active":""),onClick:()=>{a("form"),s("form")}},(0,t.createElement)("img",{src:ee})," Form"),(0,t.createElement)("a",{href:"#",className:"pqfw-settings-nav-tab"+("email"===o?" pqfw-settings-nav-tab-active":""),onClick:()=>{a("email"),s("email")}},(0,t.createElement)("img",{src:te})," Email")),(0,t.createElement)("div",{id:"pqfw-settings-tabs-contents"},"general"===o&&(0,t.createElement)($,{settings:r,setSettings:l,saveSettings:i}),"button"===o&&(0,t.createElement)(V,{settings:r,setSettings:l,saveSettings:i}),"email"===o&&(0,t.createElement)(W,{settings:r,setSettings:l,saveSettings:i}),"form"===o&&(0,t.createElement)(Z,{settings:r,setSettings:l,saveSettings:i}))))}),null),document.getElementById("pqfw-app"))}();1 !function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var ,{settings:r,setSettings:l,saveSettings:i}))))}),null),document.getElementById("pqfw-app"))}(); -
product-quotation-for-woocommerce/trunk/includes/Classes/class-admin.php
r2719764 r2729562 44 44 add_submenu_page( 45 45 'edit.php?post_type=pqfw_quotations', 46 __( 'Help', ' PQFW' ),46 __( 'Help', '' ), 47 47 '<span style="color:#f18500">Help</span>', 48 48 'manage_options', … … 64 64 */ 65 65 public function addFooterText() { 66 $linkText = esc_html__( 'Give us a 5-star rating!', ' PQFW' );66 $linkText = esc_html__( 'Give us a 5-star rating!', '' ); 67 67 $href = 'https://wordpress.org/support/plugin/product-quotation-for-woocommerce/reviews/#new-post'; 68 68 … … 81 81 printf( 82 82 // Translators: 1 - The plugin name ("PageSpeed Optimizer for Elementor"), - 2 - This placeholder will be replaced with star icons. 83 esc_html__( 'Please rate %1$s %2$s on %3$s to help us spread the word. Thank you!', ' PQFW' ),83 esc_html__( 'Please rate %1$s %2$s on %3$s to help us spread the word. Thank you!', '' ), 84 84 sprintf( '<strong>%1$s</strong>', esc_html( PQFW_PLUGIN_NAME ) ), 85 85 wp_kses_post( $link1 ), -
product-quotation-for-woocommerce/trunk/includes/Classes/class-form.php
r2717061 r2729562 60 60 'pqfw-quotation-cart', 61 61 PQFW_PLUGIN_URL . 'assets/js/pqfw-cart.js', 62 [ 'jquery' ], '1.0.0', true62 [ 'jquery' ], '1.0.0', true 63 63 ); 64 64 … … 78 78 'cartPageUrl' => get_permalink( $cartPageId ), 79 79 'loader' => PQFW_PLUGIN_URL . 'assets/images/loader.gif', 80 'actions' => [ 81 'addToQuotations' => 'pqfw_add_product' 82 ] 80 'nonce' => wp_create_nonce( 'pqfw_cart_actions' ), 83 81 ] 84 82 ); -
product-quotation-for-woocommerce/trunk/includes/Classes/class-helpers.php
r2719227 r2729562 93 93 [ 94 94 'value' => 0, 95 'label' => __( 'Select page for Enquirycart', 'pqfw' )95 'label' => __( 'Select page for cart', 'pqfw' ) 96 96 ] 97 97 ]; -
product-quotation-for-woocommerce/trunk/includes/Classes/class-request.php
r2719227 r2729562 27 27 public function __construct() { 28 28 add_action( 'wp_ajax_pqfw_load_cart_data', [ $this, 'InitializeCart' ] ); 29 29 30 add_action( 'wp_ajax_pqfw_add_product', [ $this, 'addProduct' ] ); 31 30 32 add_action( 'wp_ajax_pqfw_remove_product', [ $this, 'removeProduct' ] ); 33 31 34 add_action( 'wp_ajax_pqfw_update_products', [ $this, 'updateProducts' ] ); 35 32 36 } 33 37 … … 38 42 */ 39 43 public function InitializeCart() { 44 45 46 47 48 49 40 50 $products = pqfw()->quotations->getProducts(); 41 51 $cart = ''; … … 46 56 ob_end_clean(); 47 57 48 echo wp_json_encode([58 ([ 49 59 'html' => $cart, 50 60 'products' => $products 51 ], JSON_UNESCAPED_SLASHES ); 52 53 die(); 61 ]); 54 62 } 55 63 … … 60 68 */ 61 69 public function addProduct() { 70 71 72 73 74 75 62 76 if ( isset( $_POST['productID'] ) && isset( $_POST['variationID'] ) ) { 63 77 $id = absint( $_POST['productID'] ); … … 69 83 $price = pqfw()->cart->getSimpleVariationPrice( $product, $variation ); 70 84 $products = pqfw()->quotations->addProduct( $id, $quantity, $variation, $variationDetail, $price ); 85 86 87 88 89 90 91 92 93 71 94 } 72 73 die;74 95 } 75 96 … … 80 101 */ 81 102 public function removeProduct() { 103 104 105 106 107 108 82 109 $hash = sanitize_text_field( $_POST['hash'] ); 83 110 $cart = ''; … … 89 116 ob_end_clean(); 90 117 91 echo wp_json_encode([118 ([ 92 119 'html' => $cart, 93 120 'products' => $products 94 ], JSON_UNESCAPED_SLASHES ); 95 96 die; 121 ]); 97 122 } 98 123 … … 103 128 */ 104 129 public function updateProducts() { 130 131 132 133 134 135 105 136 $cart = ''; 106 137 $products = pqfw()->quotations->addProducts( $_POST['products'] ); … … 111 142 ob_end_clean(); 112 143 113 echo wp_json_encode([144 ([ 114 145 'html' => $cart, 115 146 'products' => $products 116 ], JSON_UNESCAPED_SLASHES ); 117 118 die; 147 ]); 119 148 } 120 149 } -
product-quotation-for-woocommerce/trunk/includes/Classes/class-settings.php
r2719764 r2729562 145 145 ); 146 146 147 wp_ enqueue_script(147 wp__script( 148 148 'pqfw-app', 149 149 PQFW_PLUGIN_URL . 'build/index.js', … … 168 168 'url' => pqfw()->helpers->getCart( 'url' ) 169 169 ], 170 170 171 ] 171 172 ); 173 174 175 172 176 } 173 177 } -
product-quotation-for-woocommerce/trunk/includes/PQFW.php
r2719227 r2729562 97 97 private function loader() { 98 98 $this->helpers = new \PQFW\Classes\Helpers(); 99 99 100 $this->settings = new \PQFW\Classes\Settings(); 100 101 $this->form = new \PQFW\Classes\Form(); … … 109 110 $this->product = new \PQFW\Classes\Product(); 110 111 $this->mailer = new \PQFW\Classes\Mailer(); 112 111 113 112 114 if ( ! function_exists( 'WC' ) ) { … … 116 118 add_action( 'plugin_action_links_' . PQFW_PLUGIN_BASENAME, [ $this, 'addPluginActionLinks' ] ); 117 119 add_action( 'admin_init', [ $this, 'redirect' ] ); 120 121 122 123 118 124 } 119 125 … … 192 198 193 199 printf( '<div class="error"><p>%1$s</p>%2$s</div>', $message, $button ); 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 194 227 } 195 228 } -
product-quotation-for-woocommerce/trunk/includes/Views/pqfw-cart-shortcode.php
r2716683 r2729562 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 22 2 <div class="woocommerce"> 3 <form class="woocommerce-cart-form"> 4 <table class="shop_table shop_table_responsive cart woocommerce-cart-form__contents" cellspacing="0"> 5 <thead> 6 <tr> 7 <th class="product-remove"> </th> 8 <th class="product-thumbnail"> </th> 9 <th class="product-name"> 10 <?php esc_html_e( 'Product', 'woocommerce' ); ?> 11 </th> 12 <th class="product-price"><?php esc_html_e( 'Price', 'woocommerce' ); ?></th> 13 <th class="product-quantity"> 14 <?php esc_html_e( 'Quantity', 'woocommerce' ); ?> 15 </th> 16 <th class="product-subtotal"> 17 <?php esc_html_e( 'Message', 'woocommerce' ); ?> 18 </th> 19 </tr> 20 </thead> 21 <tbody id="pqfw-quotations-list-row"></tbody> 22 </table> 23 24 <!-- Put form here. --> 25 <?php pqfw()->form->form(); ?> 26 </form> 23 <!-- Put form here. --> 24 <?php pqfw()->form->form(); ?> 25 </form> 27 26 </div> -
product-quotation-for-woocommerce/trunk/product-quotation-for-woocommerce.php
r2719764 r2729562 4 4 * Plugin URI: https://github.com/mahafuz/product-quotation-for-woocommerce 5 5 * Description: Removes the 'Add to cart' button from WooCommerce and adds a simple 'Request for quotation' form on all product pages instead of it. 6 * Version: 2.0. 36 * Version: 2.0. 7 7 * Author: Mahafuz <m.mahfuz.me@gmail.com> 8 8 * Author URI: https://github.com/mahafuz/ … … 22 22 */ 23 23 define( 'PQFW_PLUGIN_FILE', __FILE__ ); 24 define( 'PQFW_PLUGIN_NAME', __( 'Products Quotation For WooCommerce', ' PQFW' ) );24 define( 'PQFW_PLUGIN_NAME', __( 'Products Quotation For WooCommerce', '' ) ); 25 25 define( 'PQFW_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); 26 26 define( 'PQFW_PLUGIN_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) ); 27 27 28 define( 'PQFW_PLUGIN_VIEWS', trailingslashit( plugin_dir_path( __FILE__ ) . 'includes/Views' ) ); 28 29 define( 'PQFW_PLUGIN_URL', trailingslashit( plugins_url( '/', __FILE__ ) ) ); 29 define( 'PQFW_PLUGIN_VERSION', '2.0. 3' );30 define( 'PQFW_PLUGIN_VERSION', '2.0.' ); 30 31 31 32 /**
Note: See TracChangeset
for help on using the changeset viewer.