From ea4ec1a6aeafd036b76898bf2fb4febef3a1dd6b Mon Sep 17 00:00:00 2001 From: kousikmukherjee Date: Sun, 9 Jun 2024 00:18:33 +0530 Subject: [PATCH] v2.11.2 --- block.json | 2 +- ...ocommerce-checkout-eu-vat-field-block-frontend.asset.php | 2 +- ...-for-woocommerce-checkout-eu-vat-field-block-frontend.js | 2 +- ...at-for-woocommerce-checkout-eu-vat-field-block.asset.php | 2 +- build/eu-vat-for-woocommerce-checkout-eu-vat-field-block.js | 2 +- build/index.asset.php | 2 +- build/index.js | 2 +- build/js/checkout-eu-vat-field-block/block.json | 2 +- eu-vat-for-woocommerce.php | 6 +++--- langs/eu-vat-for-woocommerce.pot | 4 ++-- readme.txt | 5 ++++- src/js/checkout-eu-vat-field-block/block.json | 2 +- src/js/filters.js | 6 +++--- 13 files changed, 21 insertions(+), 18 deletions(-) diff --git a/block.json b/block.json index 769afb5..4924812 100644 --- a/block.json +++ b/block.json @@ -2,7 +2,7 @@ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "create-block/eu-vat-for-woocommerce", - "version": "2.11.0", + "version": "2.11.2", "title": "Eu Vat For Woocommerce", "category": "widgets", "textdomain": "eu-vat-for-woocommerce", diff --git a/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block-frontend.asset.php b/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block-frontend.asset.php index 699612d..d058ae4 100644 --- a/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block-frontend.asset.php +++ b/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block-frontend.asset.php @@ -1 +1 @@ - array('react', 'wc-blocks-checkout', 'wc-settings', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'dd3fc1cad8bee2da7aea'); + array('react', 'wc-blocks-checkout', 'wc-settings', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'e42b5d0273c570e1bc50'); diff --git a/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block-frontend.js b/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block-frontend.js index 8a2ccb6..a55ca31 100644 --- a/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block-frontend.js +++ b/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block-frontend.js @@ -1 +1 @@ -(()=>{"use strict";const e=window.wc.blocksCheckout,a=window.React,t=window.wp.element,o=window.wc.wcSettings,c=window.wp.data,l=window.wp.i18n,{optInDefaultText:i}=(0,o.getSetting)("eu-vat-for-woocommerce_data",""),{registerCheckoutBlock:s}=wc.blocksCheckout,{hasError:r}=!1,n=JSON.parse('{"apiVersion":2,"name":"eu-vat-for-woocommerce/checkout-eu-vat-field","version":"2.11.0","title":"EU VAT Field","category":"woocommerce","description":"Adds a EU VAT Field checkbox to the checkout.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-billing-address-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}},"text":{"type":"string","source":"html","selector":".wp-block-eu-vat-for-woocommerce-checkout-eu-vat-field","default":""}},"textdomain":"eu-vat-for-woocommerce","editorStyle":"file:../../../build/style-eu-vat-for-woocommerce-checkout-eu-vat-field-block.css"}');(0,e.registerCheckoutBlock)({metadata:n,component:({children:o,checkoutExtensionData:i})=>{const[s,r]=(0,t.useState)(!1),[n,d]=(0,t.useState)(""),{setExtensionData:v}=i,{setValidationErrors:u,clearValidationError:m}=(0,c.useDispatch)("wc/store/validation"),{CART_STORE_KEY:_}=window.wc.wcBlocksData,w=(0,c.select)(_).getCartData().billingAddress.country;(0,t.useEffect)((()=>{v("eu-vat-for-woocommerce-block-example","billing_eu_vat_number",n),m("billing_eu_vat_number")}),[m,u,s,v]);const g=(0,t.useCallback)((e=>{d(e),v("eu-vat-for-woocommerce-block-example","billing_eu_vat_number",e),""==e||((e,a)=>{const{CART_STORE_KEY:t}=window.wc.wcBlocksData,o=(0,c.select)(t).getCartData(),l=o.billingAddress.country,i=o.billingAddress.company;var s=document.getElementById("alg_wc_eu_vat_progress"),r=document.getElementById("alg_eu_vat_for_woocommerce_field"),n=document.getElementsByClassName("wc-block-components-checkout-place-order-button")[0];const d=document.getElementById("store_previous_country");n.disabled=!0;var v=new URLSearchParams({action:"alg_wc_eu_vat_validate_action",channel:"bloock_api",alg_wc_eu_vat_to_check:e,billing_country:l,billing_company:i});s.innerHTML=alg_wc_eu_vat_ajax_object.progress_text_validating,s.classList.remove("alg-wc-eu-vat-not-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.remove("alg-wc-eu-vat-valid"),s.classList.add("alg-wc-eu-vat-validating"),r.classList.remove("woocommerce-invalid"),r.classList.remove("woocommerce-validated"),r.classList.remove("woocommerce-invalid-mismatch"),fetch(alg_wc_eu_vat_ajax_object.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:v}).then((e=>e.json())).then((e=>{"1"==e.status?(r.classList.add("woocommerce-validated"),s.innerHTML=alg_wc_eu_vat_ajax_object.progress_text_valid,s.classList.remove("alg-wc-eu-vat-not-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.add("alg-wc-eu-vat-valid")):"0"==e.status?(r.classList.add("woocommerce-invalid"),s.innerHTML=alg_wc_eu_vat_ajax_object.progress_text_not_valid,s.classList.remove("alg-wc-eu-vat-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.add("alg-wc-eu-vat-not-valid")):"4"==e.status?(r.classList.add("woocommerce-invalid"),s.innerHTML=alg_wc_eu_vat_ajax_object.text_shipping_billing_countries,s.classList.remove("alg-wc-eu-vat-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.add("alg-wc-eu-vat-not-valid")):"5"==e.status?(r.classList.add("woocommerce-invalid"),r.classList.add("woocommerce-invalid-mismatch"),s.innerHTML=alg_wc_eu_vat_ajax_object.company_name_mismatch,s.classList.remove("alg-wc-eu-vat-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.add("alg-wc-eu-vat-not-valid")):"6"==e.status?(r.classList.remove("woocommerce-invalid"),r.classList.remove("woocommerce-validated"),s.innerHTML=alg_wc_eu_vat_ajax_object.progress_text_validation_failed,s.classList.remove("alg-wc-eu-vat-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.remove("alg-wc-eu-vat-not-valid")):(r.classList.add("woocommerce-invalid"),s.innerHTML=alg_wc_eu_vat_ajax_object.progress_text_validation_failed,s.classList.remove("alg-wc-eu-vat-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.add("alg-wc-eu-vat-not-valid")),d.value=l,wp.data.dispatch("wc/store/cart").invalidateResolutionForStore(),n.disabled=!1}))})(e)}),[d.setExtensionData]),b=(0,t.useCallback)((e=>{d(e),v("eu-vat-for-woocommerce-block-example","billing_eu_vat_number",e),wp.data.dispatch("wc/store/cart").invalidateResolutionForStore()}),[d.setExtensionData]),{validationError:p,validationErrorInput:L}=(0,c.useSelect)((e=>{const a=e("wc/store/validation");return{validationError:a.getValidationError("eu-vat-for-woocommerce"),validationErrorInput:a.getValidationError("billing_eu_vat_number")}}));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{id:"alg_eu_vat_for_woocommerce_field",className:"alg-eu-vat-for-woocommerce-fields"},(0,a.createElement)(e.ValidatedTextInput,{id:"billing_eu_vat_number",type:"text",required:!0,className:"billing-eu-vat-number",label:(0,l.__)("EU VAT Number","eu-vat-for-woocommerce"),value:n,onChange:g,onBlur:b}),(0,a.createElement)("div",{id:"alg_wc_eu_vat_progress"}),(0,a.createElement)("div",{id:"custom-checkout"}),(0,a.createElement)("input",{type:"hidden",id:"store_previous_country",name:"store_previous_country",value:w})))}})})(); \ No newline at end of file +(()=>{"use strict";const e=window.wc.blocksCheckout,a=window.React,t=window.wp.element,o=window.wc.wcSettings,c=window.wp.data,l=window.wp.i18n,{optInDefaultText:i}=(0,o.getSetting)("eu-vat-for-woocommerce_data",""),{registerCheckoutBlock:s}=wc.blocksCheckout,{hasError:r}=!1,n=JSON.parse('{"apiVersion":2,"name":"eu-vat-for-woocommerce/checkout-eu-vat-field","version":"2.11.2","title":"EU VAT Field","category":"woocommerce","description":"Adds a EU VAT Field checkbox to the checkout.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-billing-address-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}},"text":{"type":"string","source":"html","selector":".wp-block-eu-vat-for-woocommerce-checkout-eu-vat-field","default":""}},"textdomain":"eu-vat-for-woocommerce","editorStyle":"file:../../../build/style-eu-vat-for-woocommerce-checkout-eu-vat-field-block.css"}');(0,e.registerCheckoutBlock)({metadata:n,component:({children:o,checkoutExtensionData:i})=>{const[s,r]=(0,t.useState)(!1),[n,d]=(0,t.useState)(""),{setExtensionData:v}=i,{setValidationErrors:u,clearValidationError:m}=(0,c.useDispatch)("wc/store/validation"),{CART_STORE_KEY:_}=window.wc.wcBlocksData,w=(0,c.select)(_).getCartData().billingAddress.country;(0,t.useEffect)((()=>{v("eu-vat-for-woocommerce-block-example","billing_eu_vat_number",n),m("billing_eu_vat_number")}),[m,u,s,v]);const g=(0,t.useCallback)((e=>{d(e),v("eu-vat-for-woocommerce-block-example","billing_eu_vat_number",e),""==e||((e,a)=>{const{CART_STORE_KEY:t}=window.wc.wcBlocksData,o=(0,c.select)(t).getCartData(),l=o.billingAddress.country,i=o.billingAddress.company;var s=document.getElementById("alg_wc_eu_vat_progress"),r=document.getElementById("alg_eu_vat_for_woocommerce_field"),n=document.getElementsByClassName("wc-block-components-checkout-place-order-button")[0];const d=document.getElementById("store_previous_country");n.disabled=!0;var v=new URLSearchParams({action:"alg_wc_eu_vat_validate_action",channel:"bloock_api",alg_wc_eu_vat_to_check:e,billing_country:l,billing_company:i});s.innerHTML=alg_wc_eu_vat_ajax_object.progress_text_validating,s.classList.remove("alg-wc-eu-vat-not-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.remove("alg-wc-eu-vat-valid"),s.classList.add("alg-wc-eu-vat-validating"),r.classList.remove("woocommerce-invalid"),r.classList.remove("woocommerce-validated"),r.classList.remove("woocommerce-invalid-mismatch"),fetch(alg_wc_eu_vat_ajax_object.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:v}).then((e=>e.json())).then((e=>{"1"==e.status?(r.classList.add("woocommerce-validated"),s.innerHTML=alg_wc_eu_vat_ajax_object.progress_text_valid,s.classList.remove("alg-wc-eu-vat-not-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.add("alg-wc-eu-vat-valid")):"0"==e.status?(r.classList.add("woocommerce-invalid"),s.innerHTML=alg_wc_eu_vat_ajax_object.progress_text_not_valid,s.classList.remove("alg-wc-eu-vat-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.add("alg-wc-eu-vat-not-valid")):"4"==e.status?(r.classList.add("woocommerce-invalid"),s.innerHTML=alg_wc_eu_vat_ajax_object.text_shipping_billing_countries,s.classList.remove("alg-wc-eu-vat-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.add("alg-wc-eu-vat-not-valid")):"5"==e.status?(r.classList.add("woocommerce-invalid"),r.classList.add("woocommerce-invalid-mismatch"),s.innerHTML=alg_wc_eu_vat_ajax_object.company_name_mismatch,s.classList.remove("alg-wc-eu-vat-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.add("alg-wc-eu-vat-not-valid")):"6"==e.status?(r.classList.remove("woocommerce-invalid"),r.classList.remove("woocommerce-validated"),s.innerHTML=alg_wc_eu_vat_ajax_object.progress_text_validation_failed,s.classList.remove("alg-wc-eu-vat-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.remove("alg-wc-eu-vat-not-valid")):(r.classList.add("woocommerce-invalid"),s.innerHTML=alg_wc_eu_vat_ajax_object.progress_text_validation_failed,s.classList.remove("alg-wc-eu-vat-valid"),s.classList.remove("alg-wc-eu-vat-validating"),s.classList.add("alg-wc-eu-vat-not-valid")),d.value=l,wp.data.dispatch("wc/store/cart").invalidateResolutionForStore(),n.disabled=!1}))})(e)}),[d.setExtensionData]),b=(0,t.useCallback)((e=>{d(e),v("eu-vat-for-woocommerce-block-example","billing_eu_vat_number",e),wp.data.dispatch("wc/store/cart").invalidateResolutionForStore()}),[d.setExtensionData]),{validationError:p,validationErrorInput:L}=(0,c.useSelect)((e=>{const a=e("wc/store/validation");return{validationError:a.getValidationError("eu-vat-for-woocommerce"),validationErrorInput:a.getValidationError("billing_eu_vat_number")}}));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{id:"alg_eu_vat_for_woocommerce_field",className:"alg-eu-vat-for-woocommerce-fields"},(0,a.createElement)(e.ValidatedTextInput,{id:"billing_eu_vat_number",type:"text",required:!0,className:"billing-eu-vat-number",label:(0,l.__)("EU VAT Number","eu-vat-for-woocommerce"),value:n,onChange:g,onBlur:b}),(0,a.createElement)("div",{id:"alg_wc_eu_vat_progress"}),(0,a.createElement)("div",{id:"custom-checkout"}),(0,a.createElement)("input",{type:"hidden",id:"store_previous_country",name:"store_previous_country",value:w})))}})})(); \ No newline at end of file diff --git a/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block.asset.php b/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block.asset.php index e38ccda..4977eaa 100644 --- a/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block.asset.php +++ b/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block.asset.php @@ -1 +1 @@ - array('react', 'wc-blocks-checkout', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'e2775192fd59682e01ff'); + array('react', 'wc-blocks-checkout', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '330a532670f899c2cb66'); diff --git a/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block.js b/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block.js index 5ddf6bd..0724dde 100644 --- a/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block.js +++ b/build/eu-vat-for-woocommerce-checkout-eu-vat-field-block.js @@ -1 +1 @@ -(()=>{"use strict";var e,t={607:()=>{const e=window.React,t=window.wp.components,o=window.wp.blocks,r=window.wp.i18n,c=window.wp.blockEditor,l=window.wc.blocksCheckout,a=window.wc.wcSettings,{optInDefaultText:n}=(0,a.getSetting)("eu-vat-for-woocommerce_data",""),i=JSON.parse('{"apiVersion":2,"name":"eu-vat-for-woocommerce/checkout-eu-vat-field","version":"2.11.0","title":"EU VAT Field","category":"woocommerce","description":"Adds a EU VAT Field checkbox to the checkout.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-billing-address-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}},"text":{"type":"string","source":"html","selector":".wp-block-eu-vat-for-woocommerce-checkout-eu-vat-field","default":""}},"textdomain":"eu-vat-for-woocommerce","editorStyle":"file:../../../build/style-eu-vat-for-woocommerce-checkout-eu-vat-field-block.css"}');(0,o.registerBlockType)(i,{icon:{src:(0,e.createElement)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 16"},(0,e.createElement)("g",{fill:"none",fillRule:"evenodd"},(0,e.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",d:"M2 .75h16c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"}),(0,e.createElement)("path",{fill:"currentColor",d:"M7.667 7.667A2.34 2.34 0 0010 5.333 2.34 2.34 0 007.667 3a2.34 2.34 0 00-2.334 2.333 2.34 2.34 0 002.334 2.334zM11.556 3H17v3.889h-5.444V3zm2.722 2.916l1.944-1.36v-.779L14.278 5.14l-1.945-1.362v.778l1.945 1.361zm-5.834-.583a.78.78 0 00-.777-.777.78.78 0 00-.778.777c0 .428.35.778.778.778a.78.78 0 00.777-.778zm3.89 5.904c0-1.945-3.088-2.785-4.667-2.785-1.58 0-4.667.84-4.667 2.785v1.097h9.333v-1.097zM7.666 10c-1.012 0-2.163.389-2.738.778h5.475C9.821 10.38 8.678 10 7.667 10z"}))),foreground:"#874FB9"},edit:({attributes:o,setAttributes:a})=>{const{text:n}=o,i=(0,c.useBlockProps)();return(0,e.createElement)("div",{...i},(0,e.createElement)(c.InspectorControls,null,(0,e.createElement)(t.PanelBody,{title:(0,r.__)("Block options","eu-vat-for-woocommerce")},"Options for the block go here.")),(0,e.createElement)("div",{...i},(0,e.createElement)(l.ValidatedTextInput,{id:"billing_eu_vat_number",type:"text",required:!1,className:"billing-eu-vat-number",label:(0,r.__)("EU VAT Number","eu-vat-for-woocommerce")}),(0,e.createElement)("div",{id:"alg_wc_eu_vat_progress"})))},save:({attributes:t})=>{const{text:o}=t;return(0,e.createElement)("div",{...c.useBlockProps.save()},(0,e.createElement)(c.RichText.Content,{value:o}))}})}},o={};function r(e){var c=o[e];if(void 0!==c)return c.exports;var l=o[e]={exports:{}};return t[e](l,l.exports,r),l.exports}r.m=t,e=[],r.O=(t,o,c,l)=>{if(!o){var a=1/0;for(u=0;u=l)&&Object.keys(r.O).every((e=>r.O[e](o[i])))?o.splice(i--,1):(n=!1,l0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[o,c,l]},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={143:0,58:0};r.O.j=t=>0===e[t];var t=(t,o)=>{var c,l,[a,n,i]=o,s=0;if(a.some((t=>0!==e[t]))){for(c in n)r.o(n,c)&&(r.m[c]=n[c]);if(i)var u=i(r)}for(t&&t(o);sr(607)));c=r.O(c)})(); \ No newline at end of file +(()=>{"use strict";var e,t={607:()=>{const e=window.React,t=window.wp.components,o=window.wp.blocks,r=window.wp.i18n,c=window.wp.blockEditor,l=window.wc.blocksCheckout,a=window.wc.wcSettings,{optInDefaultText:n}=(0,a.getSetting)("eu-vat-for-woocommerce_data",""),i=JSON.parse('{"apiVersion":2,"name":"eu-vat-for-woocommerce/checkout-eu-vat-field","version":"2.11.2","title":"EU VAT Field","category":"woocommerce","description":"Adds a EU VAT Field checkbox to the checkout.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-billing-address-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}},"text":{"type":"string","source":"html","selector":".wp-block-eu-vat-for-woocommerce-checkout-eu-vat-field","default":""}},"textdomain":"eu-vat-for-woocommerce","editorStyle":"file:../../../build/style-eu-vat-for-woocommerce-checkout-eu-vat-field-block.css"}');(0,o.registerBlockType)(i,{icon:{src:(0,e.createElement)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 16"},(0,e.createElement)("g",{fill:"none",fillRule:"evenodd"},(0,e.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",d:"M2 .75h16c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"}),(0,e.createElement)("path",{fill:"currentColor",d:"M7.667 7.667A2.34 2.34 0 0010 5.333 2.34 2.34 0 007.667 3a2.34 2.34 0 00-2.334 2.333 2.34 2.34 0 002.334 2.334zM11.556 3H17v3.889h-5.444V3zm2.722 2.916l1.944-1.36v-.779L14.278 5.14l-1.945-1.362v.778l1.945 1.361zm-5.834-.583a.78.78 0 00-.777-.777.78.78 0 00-.778.777c0 .428.35.778.778.778a.78.78 0 00.777-.778zm3.89 5.904c0-1.945-3.088-2.785-4.667-2.785-1.58 0-4.667.84-4.667 2.785v1.097h9.333v-1.097zM7.666 10c-1.012 0-2.163.389-2.738.778h5.475C9.821 10.38 8.678 10 7.667 10z"}))),foreground:"#874FB9"},edit:({attributes:o,setAttributes:a})=>{const{text:n}=o,i=(0,c.useBlockProps)();return(0,e.createElement)("div",{...i},(0,e.createElement)(c.InspectorControls,null,(0,e.createElement)(t.PanelBody,{title:(0,r.__)("Block options","eu-vat-for-woocommerce")},"Options for the block go here.")),(0,e.createElement)("div",{...i},(0,e.createElement)(l.ValidatedTextInput,{id:"billing_eu_vat_number",type:"text",required:!1,className:"billing-eu-vat-number",label:(0,r.__)("EU VAT Number","eu-vat-for-woocommerce")}),(0,e.createElement)("div",{id:"alg_wc_eu_vat_progress"})))},save:({attributes:t})=>{const{text:o}=t;return(0,e.createElement)("div",{...c.useBlockProps.save()},(0,e.createElement)(c.RichText.Content,{value:o}))}})}},o={};function r(e){var c=o[e];if(void 0!==c)return c.exports;var l=o[e]={exports:{}};return t[e](l,l.exports,r),l.exports}r.m=t,e=[],r.O=(t,o,c,l)=>{if(!o){var a=1/0;for(u=0;u=l)&&Object.keys(r.O).every((e=>r.O[e](o[i])))?o.splice(i--,1):(n=!1,l0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[o,c,l]},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={143:0,58:0};r.O.j=t=>0===e[t];var t=(t,o)=>{var c,l,[a,n,i]=o,s=0;if(a.some((t=>0!==e[t]))){for(c in n)r.o(n,c)&&(r.m[c]=n[c]);if(i)var u=i(r)}for(t&&t(o);sr(607)));c=r.O(c)})(); \ No newline at end of file diff --git a/build/index.asset.php b/build/index.asset.php index 9e58400..cc6f078 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('react', 'wc-blocks-checkout', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'a5ea739775155a751a21'); + array('react', 'wc-blocks-checkout', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '26929c87f32fa898c9a8'); diff --git a/build/index.js b/build/index.js index eca506c..1e038af 100644 --- a/build/index.js +++ b/build/index.js @@ -1 +1 @@ -(()=>{"use strict";var e,o={565:()=>{window.React,window.wp.plugins;const e=window.wc.blocksCheckout,o=window.wc.wcSettings,{optInDefaultText:r}=(window.wc.wcBlocksRegistry,window.wp.i18n,window.wp.element,window.wp.data,(0,o.getSetting)("eu-vat-for-woocommerce_data","")),{registerCheckoutBlock:t}=wc.blocksCheckout,{hasError:n}=!1;(0,o.getSetting)("eu-vat-for-woocommerce_data"),(0,e.registerCheckoutFilters)("eu-vat-for-woocommerce",{itemName:(e,o,r)=>(document.getElementById("billing_eu_vat_number").value,e)})}},r={};function t(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return o[e](i,i.exports,t),i.exports}t.m=o,e=[],t.O=(o,r,n,i)=>{if(!r){var c=1/0;for(u=0;u=i)&&Object.keys(t.O).every((e=>t.O[e](r[w])))?r.splice(w--,1):(a=!1,i0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[r,n,i]},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={57:0,350:0};t.O.j=o=>0===e[o];var o=(o,r)=>{var n,i,[c,a,w]=r,l=0;if(c.some((o=>0!==e[o]))){for(n in a)t.o(a,n)&&(t.m[n]=a[n]);if(w)var u=w(t)}for(o&&o(r);lt(565)));n=t.O(n)})(); \ No newline at end of file +(()=>{"use strict";var e,o={565:()=>{window.React,window.wp.plugins;const e=window.wc.blocksCheckout,o=window.wc.wcSettings,{optInDefaultText:r}=(window.wc.wcBlocksRegistry,window.wp.i18n,window.wp.element,window.wp.data,(0,o.getSetting)("eu-vat-for-woocommerce_data","")),{registerCheckoutBlock:t}=wc.blocksCheckout,{hasError:c}=!1;(0,o.getSetting)("eu-vat-for-woocommerce_data"),(0,e.registerCheckoutFilters)("eu-vat-for-woocommerce",{itemName:(e,o,r)=>e})}},r={};function t(e){var c=r[e];if(void 0!==c)return c.exports;var i=r[e]={exports:{}};return o[e](i,i.exports,t),i.exports}t.m=o,e=[],t.O=(o,r,c,i)=>{if(!r){var n=1/0;for(l=0;l=i)&&Object.keys(t.O).every((e=>t.O[e](r[w])))?r.splice(w--,1):(a=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[r,c,i]},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={57:0,350:0};t.O.j=o=>0===e[o];var o=(o,r)=>{var c,i,[n,a,w]=r,s=0;if(n.some((o=>0!==e[o]))){for(c in a)t.o(a,c)&&(t.m[c]=a[c]);if(w)var l=w(t)}for(o&&o(r);st(565)));c=t.O(c)})(); \ No newline at end of file diff --git a/build/js/checkout-eu-vat-field-block/block.json b/build/js/checkout-eu-vat-field-block/block.json index 4cd36e7..53564f3 100644 --- a/build/js/checkout-eu-vat-field-block/block.json +++ b/build/js/checkout-eu-vat-field-block/block.json @@ -1,7 +1,7 @@ { "apiVersion": 2, "name": "eu-vat-for-woocommerce/checkout-eu-vat-field", - "version": "2.11.0", + "version": "2.11.2", "title": "EU VAT Field", "category": "woocommerce", "description": "Adds a EU VAT Field checkbox to the checkout.", diff --git a/eu-vat-for-woocommerce.php b/eu-vat-for-woocommerce.php index 4409951..9fb3f07 100644 --- a/eu-vat-for-woocommerce.php +++ b/eu-vat-for-woocommerce.php @@ -3,7 +3,7 @@ Plugin Name: EU/UK VAT for WooCommerce Plugin URI: https://wpfactory.com/item/eu-vat-for-woocommerce/ Description: Manage EU VAT in WooCommerce. Beautifully. -Version: 2.11.1 +Version: 2.11.2 Author: WPFactory Author URI: https://wpfactory.com/ Text Domain: eu-vat-for-woocommerce @@ -22,7 +22,7 @@ * Main Alg_WC_EU_VAT Class * * @class Alg_WC_EU_VAT - * @version 2.10.3 + * @version 2.11.2 * @since 1.0.0 */ final class Alg_WC_EU_VAT { @@ -33,7 +33,7 @@ final class Alg_WC_EU_VAT { * @var string * @since 1.0.0 */ - public $version = '2.11.1'; + public $version = '2.11.2'; public $core = null; public $settings = array(); diff --git a/langs/eu-vat-for-woocommerce.pot b/langs/eu-vat-for-woocommerce.pot index a32b276..89111b6 100644 --- a/langs/eu-vat-for-woocommerce.pot +++ b/langs/eu-vat-for-woocommerce.pot @@ -2,14 +2,14 @@ # This file is distributed under the GNU General Public License v3.0. msgid "" msgstr "" -"Project-Id-Version: eu-vat-for-woocommerce 2.11.1\n" +"Project-Id-Version: eu-vat-for-woocommerce 2.11.2\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/eu-vat-for-woocommerce\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-06-05T13:24:48+02:00\n" +"POT-Creation-Date: 2024-06-08T20:47:41+02:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.9.0\n" "X-Domain: eu-vat-for-woocommerce\n" diff --git a/readme.txt b/readme.txt index c54c78e..6c417fc 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: wpcodefactory, omardabbas, karzin, anbinder, algoritmika, kousikmu Tags: EU VAT, UK VAT, tax, vat validation, VAT Requires at least: 6.1 Tested up to: 6.5 -Stable tag: 2.11.1 +Stable tag: 2.11.2 License: GNU General Public License v3.0 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -290,6 +290,9 @@ Once activated, access the plugin's settings by navigating to “WooCommerce > S == Changelog == += 2.11.2 - 09/06/2024 = +* Fix - Checout block error. + = 2.11.1 - 05/06/2024 = * Update condition in alg_eu_vat_update_block_order_meta_eu_vat() diff --git a/src/js/checkout-eu-vat-field-block/block.json b/src/js/checkout-eu-vat-field-block/block.json index f7844ef..8a78d7f 100644 --- a/src/js/checkout-eu-vat-field-block/block.json +++ b/src/js/checkout-eu-vat-field-block/block.json @@ -1,7 +1,7 @@ { "apiVersion": 2, "name": "eu-vat-for-woocommerce/checkout-eu-vat-field", - "version": "2.11.0", + "version": "2.11.2", "title": "EU VAT Field", "category": "woocommerce", "description": "Adds a EU VAT Field checkbox to the checkout.", diff --git a/src/js/filters.js b/src/js/filters.js index d9b62a6..c3f0e74 100644 --- a/src/js/filters.js +++ b/src/js/filters.js @@ -10,11 +10,11 @@ export const registerFilters = (pointsLabelPlural, discountRegex) => { registerCheckoutFilters('eu-vat-for-woocommerce', { itemName: ( name, extensions, args ) => { - const euvat_val = document.getElementById('billing_eu_vat_number').value; + // const euvat_val = document.getElementById('billing_eu_vat_number').value; - if( euvat_val !== '' ) { + // if( euvat_val !== '' ) { // algWcBlockEuVatValidateVat( euvat_val, false ); - } + // } // return `${name} + extra data!`; return name; },