Changeset 3369498
- Timestamp:
- 09/29/2025 07:56:55 AM (5 months ago)
- Location:
- inpost-international/trunk
- Files:
-
- 24 edited
-
assets/build/inpost-intl-block-frontend.asset.php (modified) (1 diff)
-
assets/build/inpost-intl-block-frontend.js (modified) (1 diff)
-
assets/js/front.js (modified) (2 diffs)
-
blocks/src/js/inpost-intl-block/block.js (modified) (5 diffs)
-
changelog.txt (modified) (1 diff)
-
inpost-international.php (modified) (2 diffs)
-
lang/inpost-international-de_DE.mo (modified) (previous)
-
lang/inpost-international-de_DE.po (modified) (2 diffs)
-
lang/inpost-international-es_ES.mo (modified) (previous)
-
lang/inpost-international-es_ES.po (modified) (2 diffs)
-
lang/inpost-international-fr_FR.mo (modified) (previous)
-
lang/inpost-international-fr_FR.po (modified) (2 diffs)
-
lang/inpost-international-it_IT.mo (modified) (previous)
-
lang/inpost-international-it_IT.po (modified) (2 diffs)
-
lang/inpost-international-nl_BE.mo (modified) (previous)
-
lang/inpost-international-nl_BE.po (modified) (2 diffs)
-
lang/inpost-international-nl_NL.mo (modified) (previous)
-
lang/inpost-international-nl_NL.po (modified) (2 diffs)
-
lang/inpost-international-pl_PL.mo (modified) (previous)
-
lang/inpost-international-pl_PL.po (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
src/Backend/Backend.php (modified) (4 diffs)
-
src/Helpers/Helper.php (modified) (11 diffs)
-
src/Plugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
inpost-international/trunk/assets/build/inpost-intl-block-frontend.asset.php
r3353688 r3369498 1 <?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => ' e2c8e8317842087f67fd');1 <?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'd3fdd3d12512670dd01d'); -
inpost-international/trunk/assets/build/inpost-intl-block-frontend.js
r3353688 r3369498 1 (()=>{"use strict";const t=window.wc.blocksCheckout,e=window.React,n=window.wp.element,i=window.wp.i18n,o=window.wp.data,{ExperimentalOrderMeta:l}=wc.blocksCheckout;function s({handleDeliveryPointChange:t,handleDeliveryPointDescChange:n,inpostDeliveryPoint:i,inpostDeliveryPointDesc:o}){return(0,e.createElement)("div",{className:"inpost-parcel-locker-wrap",style:{display:"none"}},(0,e.createElement)("input",{value:i,type:"text",id:"inpost-international-locker-id",onChange:t}),(0,e.createElement)("input",{value:o,type:"text",id:"inpost-international-locker-description",onChange:n}))}const a=JSON.parse('{"apiVersion":2,"name":"inpost-international/block","version":"1.0.0","title":"Inpost International Map Button","category":"woocommerce","description":"Adds map button and add input to save delivery point data.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-shipping-methods-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}},"text":{"type":"string","source":"html","selector":".wp-block-inpost-international","default":""}},"textdomain":"inpost-international","editorStyle":""}');(0,t.registerCheckoutBlock)({metadata:a,component:({checkoutExtensionData:t,extensions:a})=>{let c=!1,r=null;const[d,p]=(0,n.useState)(""),[u,_]=(0,n.useState)(""),{setExtensionData:f}=t,m="inpost-international-delivery-point-error",{setValidationErrors:h,clearValidationError:w}=(0,o.useDispatch)("wc/store/validation");let g=(0,o.useSelect)((function(t){return t("wc/store/cart").getShippingRates()}));if(null!=g){let t=g[Object.keys(g)[0]];if(null!=t&&t.hasOwnProperty("shipping_rates")){const e=t.shipping_rates,n=[];if(null!=e){for(let t of e)if("pickup_location"!==t.method_id){if(!0===t.selected){const e=wcSettings.inpost_intl_block_data&&wcSettings.inpost_intl_block_data.configured_methods?wcSettings.inpost_intl_block_data.configured_methods:[];if(r=t.instance_id,-1!==t.method_id.indexOf("inpost_international_automated_locker_point"))c=!0;else{let t=e[r];null!=t&&t.hasOwnProperty("need_map")&&(c=!0)}}n.push(t)}if(!r&&n.length>0){const t=document.getElementsByClassName("wc-block-components-shipping-rates-control")[0];if(null!=t){const e=t.querySelector('input[name^="radio-control-"]:checked');if(null!=e){let t=e.getAttribute("id");if(null!=t){let e=t.split(":");if(r=e[e.length-1],-1!==e[0].indexOf("inpost_international_automated_locker_point"))c=!0;else{let t=configured_shipping_methods[r];null!=t&&t.hasOwnProperty("need_map")&&(c=!0)}}}}}}}}const k=(0,n.useCallback)((function(){c&&!d&&h({[m]:{message:(0,i.__)("Parcel locker must be chosen.","inpost-international"),hidden:!0}})}),[d,h,w,c]),y=(0,n.useCallback)((function(){if(d||!c)return w(m),!0}),[d,h,w,c]);(0,n.useEffect)((function(){k(),y(),f("inpost_intl","inpost-international-locker-id",d),f("inpost_intl","inpost-international-locker-description",u)}),[d,u,f,y]);const[b,v]=(0,n.useState)([]);return(0,n.useEffect)((function(){const t=function(){v(function(){const t=document.querySelector(".wc-block-components-shipping-rates-control");if(t){const e=t.querySelectorAll('input[name^="radio-control-"]');return Array.from(e).map((function(t){return{id:t.id,value:t.value,checked:t.checked}}))}return[]}())};t();const e=new MutationObserver(t);return e.observe(document.body,{subtree:!0,childList:!0}),()=>e.disconnect()}),[]),(0,n.useEffect)((function(){(()=>{let t=[];void 0!==window.inpost_intl_frontend&&null!==window.inpost_intl_frontend&&window.inpost_intl_frontend.inpost_methods&&(t=window.inpost_intl_frontend.inpost_methods);let e=!1;if(b.forEach((function(n){if(n.value&&n.value.indexOf(":")>-1){const[i,o]=n.value.split(":");if(-1!==i.indexOf("inpost_international_")){let e="";if(null!=t){let n=t[o].inpost_icon;null!=n&&(e=n)}const i=document.querySelector(`span[id="${n.id}__label"]`);if(i&&!i.querySelector(".inpost_icon")){const t=`<img class="inpost_icon" src="${e}" alt="inpost icon" style="height:35px;width:auto;display:block">`;i.insertAdjacentHTML("beforeend",t)}}-1!==i.indexOf("inpost_international_automated_locker_point")&&n.checked&&(e=!0)}})),e){const t=document.getElementById("inpost_intl_show_geowidget");t&&(t.style.display="block")}})()}),[b]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:"button alt inpost_intl_show_geowidget",id:"inpost_intl_show_geowidget"},(0,i.__)("Select Parcel Locker","inpost-international")),(0,e.createElement)("div",{id:"inpost_intl_selected_point_data_wrap",className:"inpost_intl_selected_point_data_wrap",style:{display:"none"}}),(0,e.createElement)(l,null,(0,e.createElement)(s,{inpostDeliveryPoint:d,inpostDeliveryPointDesc:u,handleDeliveryPointChange:function(t){const e=t.target.value;p(e)},handleDeliveryPointDescChange:function(t){const e=t.target.value;_(e)}}))))}})})();1 (()=>{"use strict";const e=window.wc.blocksCheckout,t=window.React,n=window.wp.element,o=window.wp.i18n,i=window.wp.data,{ExperimentalOrderMeta:l}=wc.blocksCheckout;function s({handleDeliveryPointChange:e,handleDeliveryPointDescChange:n,inpostDeliveryPoint:o,inpostDeliveryPointDesc:i}){return(0,t.createElement)("div",{className:"inpost-parcel-locker-wrap",style:{display:"none"}},(0,t.createElement)("input",{value:o,type:"text",id:"inpost-international-locker-id",onChange:e}),(0,t.createElement)("input",{value:i,type:"text",id:"inpost-international-locker-description",onChange:n}))}const c=JSON.parse('{"apiVersion":2,"name":"inpost-international/block","version":"1.0.0","title":"Inpost International Map Button","category":"woocommerce","description":"Adds map button and add input to save delivery point data.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-shipping-methods-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}},"text":{"type":"string","source":"html","selector":".wp-block-inpost-international","default":""}},"textdomain":"inpost-international","editorStyle":""}');(0,e.registerCheckoutBlock)({metadata:c,component:({checkoutExtensionData:e,extensions:c})=>{let a=!1,r=null;const[p,d]=(0,n.useState)(""),[u,f]=(0,n.useState)(""),{setExtensionData:_}=e,h="inpost-international-delivery-point-error",{setValidationErrors:m,clearValidationError:g}=(0,i.useDispatch)("wc/store/validation");let w=(0,i.useSelect)((function(e){return e("wc/store/cart").getShippingRates()}));const[k,y]=(0,n.useState)(!1),b=(0,i.useSelect)((e=>e("wc/store/checkout").prefersCollection()),[]);(0,n.useEffect)((()=>{y(b)}),[b]),(0,n.useEffect)((()=>{const e=()=>{const e=document.getElementById("shipping-method");if(!e)return;const t=e.querySelectorAll(".wc-block-checkout__shipping-method-option"),n=e.querySelector(".wc-block-checkout__shipping-method-option--selected");if(n&&t.length>0){const e=Array.from(t).indexOf(n),o=1===e;console.log("Selected shipping method index:",e),console.log("isPickup shipping method:",o),o&&g(h),y(o)}};e();const t=document.getElementById("shipping-method");if(t){t.addEventListener("click",(t=>{setTimeout(e,300)}));const n=new MutationObserver((()=>{e()}));return n.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),()=>{n.disconnect()}}}),[]);const v=wcSettings.inpost_intl_block_data&&wcSettings.inpost_intl_block_data.configured_methods?wcSettings.inpost_intl_block_data.configured_methods:[];if(null!=w){let e=w[Object.keys(w)[0]];if(null!=e&&e.hasOwnProperty("shipping_rates")){const t=e.shipping_rates,n=[];if(null!=t){for(let e of t)if("pickup_location"!==e.method_id){if(!0===e.selected)if(r=e.instance_id,-1!==e.method_id.indexOf("inpost_international_"))a=!0;else{let e=v[r];null!=e&&e.hasOwnProperty("need_map")&&(a=!0)}n.push(e)}if(!r&&n.length>0){const e=document.getElementsByClassName("wc-block-components-shipping-rates-control")[0];if(null!=e){const t=e.querySelector('input[name^="radio-control-"]:checked');if(null!=t){let e=t.getAttribute("id");if(null!=e){let t=e.split(":");if(r=t[t.length-1],-1!==t[0].indexOf("inpost_international_"))a=!0;else{let e=v[r];null!=e&&e.hasOwnProperty("need_map")&&(a=!0)}}}}}}}}const E=(0,n.useCallback)((function(){a&&!p&&m({[h]:{message:(0,o.__)("Parcel locker must be chosen.","inpost-international"),hidden:!0}})}),[p,m,g,a]),S=(0,n.useCallback)((function(){if(p||!a)return g(h),!0}),[p,m,g,a]);(0,n.useEffect)((function(){E(),S(),_("inpost_intl","inpost-international-locker-id",p),_("inpost_intl","inpost-international-locker-description",u)}),[p,u,_,S]);const[x,D]=(0,n.useState)([]);return(0,n.useEffect)((function(){const e=function(){D(function(){const e=document.querySelector(".wc-block-components-shipping-rates-control");if(e){const t=e.querySelectorAll('input[name^="radio-control-"]');return Array.from(t).map((function(e){return{id:e.id,value:e.value,checked:e.checked}}))}return[]}())};e();const t=new MutationObserver(e);return t.observe(document.body,{subtree:!0,childList:!0}),()=>t.disconnect()}),[]),(0,n.useEffect)((function(){(()=>{let e=[];void 0!==window.inpost_intl_frontend&&null!==window.inpost_intl_frontend&&window.inpost_intl_frontend.inpost_methods&&(e=window.inpost_intl_frontend.inpost_methods);let t=!1;if(x.forEach((function(e){if(e.value&&e.value.indexOf(":")>-1){const[n,o]=e.value.split(":");-1!==n.indexOf("inpost_international_automated_locker_point")&&e.checked&&(t=!0)}})),t){const e=document.getElementById("inpost_intl_show_geowidget");e&&(e.style.display="block")}x.forEach((function(t){if(t.value&&t.value.indexOf(":")>-1){const[n,o]=t.value.split(":");let i=!1;if(null!=e){let t=e[o];if(null!=t&&"inpost_icon"in t){let e=t.inpost_icon;e&&null!=e&&(i=e)}}const l=document.querySelector(`span[id="${t.id}__label"]`);if(i&&l&&!l.querySelector(".inpost_icon")){const e=`<img class="inpost_icon" src="${i}" alt="inpost icon" style="height:35px;width:auto;display:block">`;l.insertAdjacentHTML("beforeend",e)}}}))})()}),[x]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(t.Fragment,null,(0,t.createElement)("button",{className:"button alt inpost_intl_show_geowidget",id:"inpost_intl_show_geowidget"},(0,o.__)("Choose pick-up point","inpost-international")),(0,t.createElement)("div",{id:"inpost_intl_selected_point_data_wrap",className:"inpost_intl_selected_point_data_wrap",style:{display:"none"}}),(0,t.createElement)(l,null,(0,t.createElement)(s,{inpostDeliveryPoint:p,inpostDeliveryPointDesc:u,handleDeliveryPointChange:function(e){const t=e.target.value;d(t)},handleDeliveryPointDescChange:function(e){const t=e.target.value;f(t)}}))))}})})(); -
inpost-international/trunk/assets/js/front.js
r3353688 r3369498 13 13 let inpost_intl_geowidget_modal; 14 14 let inpost_global_geowidget_api = null; 15 let geowidget_countries = 'PL,BE,IT,FR,LU,PT,ES,NL ';15 let geowidget_countries = 'PL,BE,IT,FR,LU,PT,ES,NL,HU,AT'; 16 16 let coords = null; 17 17 let selected_country = null; … … 1005 1005 if ( typeof map_button != 'undefined' && map_button !== null) { 1006 1006 if ( typeof map_config_settings != 'undefined' && map_config_settings !== null) { 1007 console.log("Exact SM map_config_settings:");1008 console.log(map_config_settings);1007 //console.log("Exact SM map_config_settings:"); 1008 //console.log(map_config_settings); 1009 1009 if ( 'need_map' in map_config_settings ) { 1010 1010 console.log('need_map'); -
inpost-international/trunk/blocks/src/js/inpost-intl-block/block.js
r3353688 r3369498 6 6 export const Block = ( { checkoutExtensionData, extensions } ) => { 7 7 8 let isInpostShippingMethod = false; 9 let selectedShippingInstanceID = null; 10 11 const [inpostDeliveryPoint, setInpostDeliveryPoint] = useState( "" ); 12 const [inpostDeliveryPointDesc, setInpostDeliveryPointDesc] = useState( "" ); 13 const { setExtensionData } = checkoutExtensionData; 14 const validationErrorId = 'inpost-international-delivery-point-error'; 15 const { setValidationErrors, clearValidationError } = useDispatch( 16 'wc/store/validation' 17 ); 18 19 // Get current shipping options. 20 let shippingRates = useSelect( 21 function (select) { 22 const store = select( 'wc/store/cart' ); 23 return store.getShippingRates(); 24 } 25 ); 26 8 let isInpostShippingMethod = false; 9 let selectedShippingInstanceID = null; 10 11 const [inpostDeliveryPoint, setInpostDeliveryPoint] = useState( "" ); 12 const [inpostDeliveryPointDesc, setInpostDeliveryPointDesc] = useState( "" ); 13 const { setExtensionData } = checkoutExtensionData; 14 const validationErrorId = 'inpost-international-delivery-point-error'; 15 const { setValidationErrors, clearValidationError } = useDispatch( 16 'wc/store/validation' 17 ); 18 19 // Get current shipping options. 20 let shippingRates = useSelect( 21 function (select) { 22 const store = select( 'wc/store/cart' ); 23 return store.getShippingRates(); 24 } 25 ); 26 27 // State to track pickup selection with both store and DOM monitoring. 28 const [isPickupSelected, setIsPickupSelected] = useState(false); 29 30 // Get pickup selection status from store. 31 const storePickupSelected = useSelect( 32 (select) => { 33 const checkoutStore = select('wc/store/checkout'); 34 const prefersCollection = checkoutStore.prefersCollection(); 35 return prefersCollection; 36 }, 37 [] // Dependencies array - will re-run when store changes. 38 ); 39 40 // Update local state when store changes. 41 useEffect(() => { 42 setIsPickupSelected(storePickupSelected); 43 }, [storePickupSelected]); 44 45 // DOM listener for immediate Ship/Pickup changes. 46 useEffect(() => { 47 const handleShippingMethodChange = () => { 48 const container = document.getElementById('shipping-method'); 49 if ( ! container ) return; 50 51 const allOptions = container.querySelectorAll('.wc-block-checkout__shipping-method-option'); 52 const selectedOption = container.querySelector('.wc-block-checkout__shipping-method-option--selected'); 53 54 if (selectedOption && allOptions.length > 0) { 55 // Find the index of the selected option 56 const selectedIndex = Array.from(allOptions).indexOf(selectedOption); 57 const isPickup = selectedIndex === 1; // Ship = 0, Pickup = 1 58 59 console.log('Selected shipping method index:', selectedIndex); 60 console.log('isPickup shipping method:', isPickup); 61 62 if (isPickup) { 63 clearValidationError(validationErrorId); 64 } 65 setIsPickupSelected(isPickup); 66 } 67 }; 68 69 // Initial check. 70 handleShippingMethodChange(); 71 72 // Listen for clicks on shipping method container. 73 const container = document.getElementById('shipping-method'); 74 if (container) { 75 container.addEventListener('click', (event) => { 76 // Small delay to allow DOM to update. 77 setTimeout( handleShippingMethodChange, 300 ); 78 }); 79 80 // Also listen for any changes in the container. 81 const observer = new MutationObserver(() => { 82 handleShippingMethodChange(); 83 }); 84 85 observer.observe(container, { 86 childList: true, 87 subtree: true, 88 attributes: true, 89 attributeFilter: ['class'] 90 }); 91 92 return () => { 93 observer.disconnect(); 94 }; 95 } 96 }, []); 27 97 28 98 function useInpostConfiguredMethods() { … … 34 104 35 105 const configured_shipping_methods = useInpostConfiguredMethods(); 36 37 106 38 107 if (typeof shippingRates != 'undefined' && shippingRates !== null) { … … 98 167 99 168 100 // Initial validation error - prevent to place order after Checkout page loaded, and we have empty value in inpost hidden input (no point code yet).101 const initialValiadtion = useCallback(102 function () {103 if (isInpostShippingMethod && ! inpostDeliveryPoint) {104 setValidationErrors(105 {106 [validationErrorId]: {107 message: __( 'Parcel locker must be chosen.', 'inpost-international' ),108 hidden: true,109 },110 }111 );112 }113 },114 [inpostDeliveryPoint, setValidationErrors, clearValidationError, isInpostShippingMethod]115 );116 117 118 // Additional validation: clear validation error if we have value for inpost hidden input with point code.119 const validateInput = useCallback(120 function () {121 if (inpostDeliveryPoint || ! isInpostShippingMethod) {122 clearValidationError( validationErrorId );123 return true; // Allow order placement.124 }125 },126 [inpostDeliveryPoint, setValidationErrors, clearValidationError, isInpostShippingMethod]127 );128 129 130 // Effect to validate input whenever Delivery Point input value changes.131 useEffect(132 function () {133 initialValiadtion();134 validateInput();135 setExtensionData( "inpost_intl", "inpost-international-locker-id", inpostDeliveryPoint );136 setExtensionData( "inpost_intl", "inpost-international-locker-description", inpostDeliveryPointDesc );137 },138 [inpostDeliveryPoint, inpostDeliveryPointDesc, setExtensionData, validateInput]139 );140 141 142 const [ shippingMethods, setShippingMethods ] = useState( [] );143 144 useEffect(145 function () {146 // Function to get shipping methods from the DOM.147 const getShippingMethods = function () {148 const shipping_block_html = document.querySelector(149 '.wc-block-components-shipping-rates-control'150 );151 if (shipping_block_html) {152 const shipping_radio_buttons = shipping_block_html.querySelectorAll(153 'input[name^="radio-control-"]'154 );155 return Array.from( shipping_radio_buttons ).map(156 function (radio) {157 return {158 id: radio.id,159 value: radio.value,160 checked: radio.checked161 };162 }163 );164 }165 return [];166 };167 168 // Update shipping methods.169 const updateShippingMethods = function () {170 setShippingMethods( getShippingMethods() );171 };172 173 // Initial update.174 updateShippingMethods();175 176 // Set up a MutationObserver to watch for DOM changes.177 const observer = new MutationObserver( updateShippingMethods );178 observer.observe( document.body, { subtree: true, childList: true } );179 180 // Cleanup function.181 return () => observer.disconnect();182 },183 []184 );185 186 useEffect(187 function () {188 // Function to add Inpost icons.189 const addInpostIcons= () => {190 191 let inpost_methods = [];192 193 if (typeof window.inpost_intl_frontend != 'undefined' && window.inpost_intl_frontend !== null) {194 if ( window.inpost_intl_frontend.inpost_methods ) {195 inpost_methods = window.inpost_intl_frontend.inpost_methods;196 }197 }169 // Initial validation error - prevent to place order after Checkout page loaded, and we have empty value in inpost hidden input (no point code yet). 170 const initialValiadtion = useCallback( 171 function () { 172 if ( isInpostShippingMethod && ! inpostDeliveryPoint ) { 173 setValidationErrors( 174 { 175 [validationErrorId]: { 176 message: __( 'Parcel locker must be chosen.', 'inpost-international' ), 177 hidden: true, 178 }, 179 } 180 ); 181 } 182 }, 183 [inpostDeliveryPoint, setValidationErrors, clearValidationError, isInpostShippingMethod] 184 ); 185 186 187 // Additional validation: clear validation error if we have value for inpost hidden input with point code. 188 const validateInput = useCallback( 189 function () { 190 if (inpostDeliveryPoint || ! isInpostShippingMethod) { 191 clearValidationError( validationErrorId ); 192 return true; // Allow order placement. 193 } 194 }, 195 [inpostDeliveryPoint, setValidationErrors, clearValidationError, isInpostShippingMethod] 196 ); 197 198 199 // Effect to validate input whenever Delivery Point input value changes. 200 useEffect( 201 function () { 202 initialValiadtion(); 203 validateInput(); 204 setExtensionData( "inpost_intl", "inpost-international-locker-id", inpostDeliveryPoint ); 205 setExtensionData( "inpost_intl", "inpost-international-locker-description", inpostDeliveryPointDesc ); 206 }, 207 [inpostDeliveryPoint, inpostDeliveryPointDesc, setExtensionData, validateInput] 208 ); 209 210 211 const [ shippingMethods, setShippingMethods ] = useState( [] ); 212 213 useEffect( 214 function () { 215 // Function to get shipping methods from the DOM. 216 const getShippingMethods = function () { 217 const shipping_block_html = document.querySelector( 218 '.wc-block-components-shipping-rates-control' 219 ); 220 if (shipping_block_html) { 221 const shipping_radio_buttons = shipping_block_html.querySelectorAll( 222 'input[name^="radio-control-"]' 223 ); 224 return Array.from( shipping_radio_buttons ).map( 225 function (radio) { 226 return { 227 id: radio.id, 228 value: radio.value, 229 checked: radio.checked 230 }; 231 } 232 ); 233 } 234 return []; 235 }; 236 237 // Update shipping methods. 238 const updateShippingMethods = function () { 239 setShippingMethods( getShippingMethods() ); 240 }; 241 242 // Initial update. 243 updateShippingMethods(); 244 245 // Set up a MutationObserver to watch for DOM changes. 246 const observer = new MutationObserver( updateShippingMethods ); 247 observer.observe( document.body, { subtree: true, childList: true } ); 248 249 // Cleanup function. 250 return () => observer.disconnect(); 251 }, 252 [] 253 ); 254 255 useEffect( 256 function () { 257 // Function to add Inpost icons. 258 const showInpostButton = () => { 259 260 let inpost_methods = []; 261 262 if (typeof window.inpost_intl_frontend != 'undefined' && window.inpost_intl_frontend !== null) { 263 if ( window.inpost_intl_frontend.inpost_methods ) { 264 inpost_methods = window.inpost_intl_frontend.inpost_methods; 265 } 266 } 198 267 199 268 let is_inpost_method_checked = false; … … 203 272 const [shipping_method, instance_id] = method.value.split(':'); 204 273 if (shipping_method.indexOf('inpost_international_automated_locker_point') !== -1) { 205 206 274 if (method.checked) { 207 275 is_inpost_method_checked = true; 208 }209 210 let inpost_logo = '';211 if (typeof inpost_methods != 'undefined' && inpost_methods !== null) {212 let inpost_method_data = inpost_methods[instance_id];213 let logo_src = inpost_method_data.inpost_icon;214 if (typeof logo_src != 'undefined' && logo_src !== null) {215 inpost_logo = logo_src;216 }217 }218 const title_span = document.querySelector(219 `span[id="${method.id}__label"]`220 );221 if (title_span && !title_span.querySelector('.inpost_icon')) {222 const icon = `<img class="inpost_icon" src="${inpost_logo}" alt="inpost icon" style="height:35px;width:auto;display:block">`;223 title_span.insertAdjacentHTML('beforeend', icon);224 276 } 225 277 } … … 233 285 } 234 286 } 235 }; 236 237 addInpostIcons(); 238 }, 239 [ shippingMethods ] 240 ); 241 242 // Change Delivery Point input value. 243 const handleDeliveryPointChange = function (event) { 244 const selectedId = event.target.value; 245 setInpostDeliveryPoint( selectedId ); 246 }; 247 248 249 // Change Delivery Point Description input value. 250 const handleDeliveryPointDescChange = function (event) { 251 const pointDescription = event.target.value; 252 setInpostDeliveryPointDesc( pointDescription ); 253 }; 287 288 289 shippingMethods.forEach(function(method) { 290 if (method.value && method.value.indexOf(':') > -1) { 291 const [shipping_method, instance_id] = method.value.split(':'); 292 let inpost_logo = false; 293 if (typeof inpost_methods != 'undefined' && inpost_methods !== null) { 294 let inpost_method_data = inpost_methods[instance_id]; 295 if (typeof inpost_method_data != 'undefined' && inpost_method_data !== null) { 296 if( 'inpost_icon' in inpost_method_data ) { 297 let logo_src = inpost_method_data.inpost_icon; 298 299 if ( logo_src && typeof logo_src != 'undefined' && logo_src !== null ) { 300 inpost_logo = logo_src; 301 } 302 } 303 } 304 } 305 const title_span = document.querySelector( 306 `span[id="${method.id}__label"]` 307 ); 308 if (inpost_logo && title_span && !title_span.querySelector('.inpost_icon')) { 309 const icon = `<img class="inpost_icon" src="${inpost_logo}" alt="inpost icon" style="height:35px;width:auto;display:block">`; 310 title_span.insertAdjacentHTML('beforeend', icon); 311 } 312 } 313 }); 314 }; 315 316 showInpostButton(); 317 }, 318 [ shippingMethods ] 319 ); 320 321 // Change Delivery Point input value. 322 const handleDeliveryPointChange = function (event) { 323 const selectedId = event.target.value; 324 setInpostDeliveryPoint( selectedId ); 325 }; 326 327 328 // Change Delivery Point Description input value. 329 const handleDeliveryPointDescChange = function (event) { 330 const pointDescription = event.target.value; 331 setInpostDeliveryPointDesc( pointDescription ); 332 }; 254 333 255 334 return ( -
inpost-international/trunk/changelog.txt
r3353688 r3369498 25 25 ### Feat 26 26 - settings for Italy 27 28 ## [1.0.6] - 2025-09-29 29 ### Fix 30 - JS conflict with InPost PL -
inpost-international/trunk/inpost-international.php
r3353688 r3369498 5 5 * Description: InPost International to oficjalna bezpłatna aplikacja InPost dla obsługi międzynarodowej dostawy 6 6 * Tags: woocommerce, inpost, shipments 7 * Version: 1.0. 57 * Version: 1.0.6 8 8 * Tested up to: 6.8 9 9 * Requires PHP: 7.4 … … 36 36 } 37 37 38 define( 'INPOST_INTL_PLUGIN_VERSION', '1.0. 5' );38 define( 'INPOST_INTL_PLUGIN_VERSION', '1.0.6' ); 39 39 define( 'INPOST_INTL_PLUGIN_SLUG', 'inpost_international' ); 40 40 define( 'INPOST_INTL_PLUGIN_FILE', __FILE__ ); -
inpost-international/trunk/lang/inpost-international-de_DE.po
r3353688 r3369498 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-11-18T15:04:40+02:00\n" 6 "PO-Revision-Date: 2025-0 7-23 14:52+0200\n"6 "PO-Revision-Date: 2025-09-18 11:20+0200\n" 7 7 "Last-Translator: Aleksander Sikirytski <[email protected]>\n" 8 8 "Language-Team: Aleksander Sikirytski <[email protected]>\n" … … 848 848 msgid "InPost International Courier" 849 849 msgstr "InPost International Kurier" 850 851 msgid "Map button text for buyers from Italy" 852 msgstr "Kartenbutton-Text für Käufer aus Italien" 853 854 msgid "Map button text for buyers from Spain" 855 msgstr "Kartenbutton-Text für Käufer aus Spanien" 856 857 msgid "Map button text for buyers from Portugal" 858 msgstr "Kartenbutton-Text für Käufer aus Portugal" 859 860 msgid "Map button text for buyers from the Netherlands" 861 msgstr "Kartenbutton-Text für Käufer aus den Niederlanden" 862 863 msgid "Map button text for buyers from France" 864 msgstr "Kartenbutton-Text für Käufer aus Frankreich" 865 866 msgid "Map button text for buyers from Belgium" 867 msgstr "Kartenbutton-Text für Käufer aus Belgien" 868 869 msgid "Map button text for buyers from Luxembourg" 870 msgstr "Kartenbutton-Text für Käufer aus Luxemburg" 871 872 msgid "Map button text for buyers from Austria" 873 msgstr "Kartenbutton-Text für Käufer aus Österreich" 874 875 msgid "Map button text for buyers from Hungary" 876 msgstr "Kartenbutton-Text für Käufer aus Ungarn" -
inpost-international/trunk/lang/inpost-international-es_ES.po
r3334052 r3369498 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-11-18T15:04:40+02:00\n" 6 "PO-Revision-Date: 2025-0 7-23 14:52+0200\n"6 "PO-Revision-Date: 2025-09-18 11:21+0200\n" 7 7 "Last-Translator: Aleksander Sikirytski <[email protected]>\n" 8 8 "Language-Team: Aleksander Sikirytski <[email protected]>\n" … … 833 833 msgid "Supported mobile phone numbers for countries Poland, Italy, Spain, Portugal, France, Netherlands, Luxembourg, Belgium." 834 834 msgstr "Números de teléfono móvil compatibles: Polonia, Italia, España, Portugal, Francia, Países Bajos, Luxemburgo y Bélgica." 835 836 msgid "Map button text for buyers from Italy" 837 msgstr "Texto del botón del mapa para compradores de Italia" 838 839 msgid "Map button text for buyers from Spain" 840 msgstr "Texto del botón del mapa para compradores de España" 841 842 msgid "Map button text for buyers from Portugal" 843 msgstr "Texto del botón del mapa para compradores de Portugal" 844 845 msgid "Map button text for buyers from the Netherlands" 846 msgstr "Texto del botón del mapa para compradores de los Países Bajos" 847 848 msgid "Map button text for buyers from France" 849 msgstr "Texto del botón del mapa para compradores de Francia" 850 851 msgid "Map button text for buyers from Belgium" 852 msgstr "Texto del botón del mapa para compradores de Bélgica" 853 854 msgid "Map button text for buyers from Luxembourg" 855 msgstr "Texto del botón del mapa para compradores de Luxemburgo" 856 857 msgid "Map button text for buyers from Austria" 858 msgstr "Texto del botón del mapa para compradores de Austria" 859 860 msgid "Map button text for buyers from Hungary" 861 msgstr "Texto del botón del mapa para compradores de Hungría" -
inpost-international/trunk/lang/inpost-international-fr_FR.po
r3334052 r3369498 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-11-18T15:04:40+02:00\n" 6 "PO-Revision-Date: 2025-0 7-23 14:53+0200\n"6 "PO-Revision-Date: 2025-09-18 11:21+0200\n" 7 7 "Last-Translator: Aleksander Sikirytski <[email protected]>\n" 8 8 "Language-Team: Aleksander Sikirytski <[email protected]>\n" … … 833 833 msgid "Supported mobile phone numbers for countries Poland, Italy, Spain, Portugal, France, Netherlands, Luxembourg, Belgium." 834 834 msgstr "Numéros de téléphone mobile pris en charge: Pologne, Italie, Espagne, Portugal, France, Pays-Bas, Luxembourg et Belgique." 835 836 msgid "Map button text for buyers from Italy" 837 msgstr "Texte du bouton carte pour les acheteurs d'Italie" 838 839 msgid "Map button text for buyers from Spain" 840 msgstr "Texte du bouton carte pour les acheteurs d'Espagne" 841 842 msgid "Map button text for buyers from Portugal" 843 msgstr "Texte du bouton carte pour les acheteurs du Portugal" 844 845 msgid "Map button text for buyers from the Netherlands" 846 msgstr "Texte du bouton carte pour les acheteurs des Pays-Bas" 847 848 msgid "Map button text for buyers from France" 849 msgstr "Texte du bouton carte pour les acheteurs de France" 850 851 msgid "Map button text for buyers from Belgium" 852 msgstr "Texte du bouton carte pour les acheteurs de Belgique" 853 854 msgid "Map button text for buyers from Luxembourg" 855 msgstr "Texte du bouton carte pour les acheteurs du Luxembourg" 856 857 msgid "Map button text for buyers from Austria" 858 msgstr "Texte du bouton carte pour les acheteurs d'Autriche" 859 860 msgid "Map button text for buyers from Hungary" 861 msgstr "Texte du bouton carte pour les acheteurs de Hongrie" -
inpost-international/trunk/lang/inpost-international-it_IT.po
r3353688 r3369498 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-11-18T15:04:40+02:00\n" 6 "PO-Revision-Date: 2025-0 8-19 12:17+0200\n"6 "PO-Revision-Date: 2025-09-18 11:21+0200\n" 7 7 "Last-Translator: Aleksander Sikirytski <[email protected]>\n" 8 8 "Language-Team: Aleksander Sikirytski <[email protected]>\n" … … 848 848 msgid "InPost International Courier" 849 849 msgstr "InPost International Corriere" 850 851 msgid "Map button text for buyers from Italy" 852 msgstr "Testo del pulsante mappa per acquirenti dall'Italia" 853 854 msgid "Map button text for buyers from Spain" 855 msgstr "Testo del pulsante mappa per acquirenti dalla Spagna" 856 857 msgid "Map button text for buyers from Portugal" 858 msgstr "Testo del pulsante mappa per acquirenti dal Portogallo" 859 860 msgid "Map button text for buyers from the Netherlands" 861 msgstr "Testo del pulsante mappa per acquirenti dai Paesi Bassi" 862 863 msgid "Map button text for buyers from France" 864 msgstr "Testo del pulsante mappa per acquirenti dalla Francia" 865 866 msgid "Map button text for buyers from Belgium" 867 msgstr "Testo del pulsante mappa per acquirenti dal Belgio" 868 869 msgid "Map button text for buyers from Luxembourg" 870 msgstr "Testo del pulsante mappa per acquirenti dal Lussemburgo" 871 872 msgid "Map button text for buyers from Austria" 873 msgstr "Testo del pulsante mappa per acquirenti dall'Austria" 874 875 msgid "Map button text for buyers from Hungary" 876 msgstr "Testo del pulsante mappa per acquirenti dall'Ungheria" -
inpost-international/trunk/lang/inpost-international-nl_BE.po
r3334052 r3369498 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-11-18T15:04:40+02:00\n" 6 "PO-Revision-Date: 2025-0 7-23 14:53+0200\n"6 "PO-Revision-Date: 2025-09-18 11:22+0200\n" 7 7 "Last-Translator: Aleksander Sikirytski <[email protected]>\n" 8 8 "Language-Team: Aleksander Sikirytski <[email protected]>\n" … … 833 833 msgid "Supported mobile phone numbers for countries Poland, Italy, Spain, Portugal, France, Netherlands, Luxembourg, Belgium." 834 834 msgstr "Ondersteunde mobiele telefoonnummers voor landen als Polen, Italië, Spanje, Portugal, Frankrijk, Nederland, Luxemburg en België." 835 836 msgid "Map button text for buyers from Italy" 837 msgstr "Kaarttekst voor kopers uit Italië" 838 839 msgid "Map button text for buyers from Spain" 840 msgstr "Kaarttekst voor kopers uit Spanje" 841 842 msgid "Map button text for buyers from Portugal" 843 msgstr "Kaarttekst voor kopers uit Portugal" 844 845 msgid "Map button text for buyers from the Netherlands" 846 msgstr "Kaarttekst voor kopers uit Nederland" 847 848 msgid "Map button text for buyers from France" 849 msgstr "Kaarttekst voor kopers uit Frankrijk" 850 851 msgid "Map button text for buyers from Belgium" 852 msgstr "Kaarttekst voor kopers uit België" 853 854 msgid "Map button text for buyers from Luxembourg" 855 msgstr "Kaarttekst voor kopers uit Luxemburg" 856 857 msgid "Map button text for buyers from Austria" 858 msgstr "Kaarttekst voor kopers uit Oostenrijk" 859 860 msgid "Map button text for buyers from Hungary" 861 msgstr "Kaarttekst voor kopers uit Hongarije" -
inpost-international/trunk/lang/inpost-international-nl_NL.po
r3334052 r3369498 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-11-18T15:04:40+02:00\n" 6 "PO-Revision-Date: 2025-0 7-23 14:53+0200\n"6 "PO-Revision-Date: 2025-09-18 11:22+0200\n" 7 7 "Last-Translator: Aleksander Sikirytski <[email protected]>\n" 8 8 "Language-Team: Aleksander Sikirytski <[email protected]>\n" … … 833 833 msgid "Supported mobile phone numbers for countries Poland, Italy, Spain, Portugal, France, Netherlands, Luxembourg, Belgium." 834 834 msgstr "Ondersteunde mobiele telefoonnummers voor landen als Polen, Italië, Spanje, Portugal, Frankrijk, Nederland, Luxemburg en België." 835 836 msgid "Map button text for buyers from Italy" 837 msgstr "Kaartknoptekst voor kopers uit Italië" 838 839 msgid "Map button text for buyers from Spain" 840 msgstr "Kaartknoptekst voor kopers uit Spanje" 841 842 msgid "Map button text for buyers from Portugal" 843 msgstr "Kaartknoptekst voor kopers uit Portugal" 844 845 msgid "Map button text for buyers from the Netherlands" 846 msgstr "Kaartknoptekst voor kopers uit Nederland" 847 848 msgid "Map button text for buyers from France" 849 msgstr "Kaartknoptekst voor kopers uit Frankrijk" 850 851 msgid "Map button text for buyers from Belgium" 852 msgstr "Kaartknoptekst voor kopers uit België" 853 854 msgid "Map button text for buyers from Luxembourg" 855 msgstr "Kaartknoptekst voor kopers uit Luxemburg" 856 857 msgid "Map button text for buyers from Austria" 858 msgstr "Kaartknoptekst voor kopers uit Oostenrijk" 859 860 msgid "Map button text for buyers from Hungary" 861 msgstr "Kaartknoptekst voor kopers uit Hongarije" -
inpost-international/trunk/lang/inpost-international-pl_PL.po
r3353688 r3369498 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-11-18T15:04:40+02:00\n" 6 "PO-Revision-Date: 2025-0 8-19 12:16+0200\n"6 "PO-Revision-Date: 2025-09-18 11:22+0200\n" 7 7 "Last-Translator: Aleksander Sikirytski <[email protected]>\n" 8 8 "Language-Team: Aleksander Sikirytski <[email protected]>\n" … … 894 894 msgstr "Tekst przycisku mapy dla kupujących z Francji" 895 895 896 msgid " Tekst przycisku mapy dla kupujących z Belgii"896 msgid "Map button text for buyers from Belgium" 897 897 msgstr "Tekst przycisku mapy dla kupujących z Włoch" 898 898 … … 900 900 msgstr "Tekst przycisku mapy dla kupujących z Luksemburga" 901 901 902 msgid "Map button text for buyers from Austria" 903 msgstr "Tekst przycisku mapy dla kupujących z Austrii" 904 905 msgid "Map button text for buyers from Hungary" 906 msgstr "Tekst przycisku mapy dla kupujących z Węgier" 907 902 908 msgid "Country" 903 909 msgstr "Kraj" -
inpost-international/trunk/readme.txt
r3353688 r3369498 4 4 Requires at least: 6.0 5 5 Tested up to: 6.8 6 Stable tag: 1.0. 56 Stable tag: 1.0.6 7 7 Requires PHP: 7.4 8 8 License: GPLv3 or later … … 73 73 == Changelog == 74 74 75 = 1.0.6 = 76 * Fix: JS conflict with InPost PL 77 75 78 = 1.0.5 = 76 79 * Feat: settings for Italy -
inpost-international/trunk/src/Backend/Backend.php
r3353688 r3369498 163 163 } 164 164 165 $fs_inpost_linked = false; 166 $fs_method_name = ''; 167 static $alert_phone_shown; 168 165 169 foreach ( $order->get_items( 'shipping' ) as $item_id => $item ) { 166 170 $shipping_method_id = $item->get_method_id(); … … 168 172 } 169 173 170 $fs_inpost_linked = false; 171 $fs_method_name = ''; 172 173 static $alert_phone_shown; 174 if ( $this->helper->is_flexible_shipping_activated() ) { 175 foreach ( $order->get_shipping_methods() as $shipping_method ) { 176 $fs_instance_id = $shipping_method->get_instance_id(); 177 } 178 179 $fs_method_name = $this->helper->get_method_linked_to_fs_by_instance_id( $fs_instance_id ); 180 if ( ! empty( $fs_method_name ) ) { 181 $fs_inpost_linked = true; 182 } 183 } 184 185 if ( $fs_inpost_linked ) { 186 // save meta in metadata to show later required metabox in order details. 187 $order->update_meta_data( 'inpost_international_fs_linked', $fs_method_name ); 188 $order->save(); 189 } 174 190 175 191 $request_body = json_decode( $request->get_body(), true ); … … 199 215 $order->save(); 200 216 201 if ( $this->helper->is_flexible_shipping_activated() ) { 202 foreach ( $order->get_shipping_methods() as $shipping_method ) { 203 $fs_instance_id = $shipping_method->get_instance_id(); 204 } 205 206 $fs_method_name = $this->helper->get_method_linked_to_fs_by_instance_id( $fs_instance_id ); 207 if ( ! empty( $fs_method_name ) ) { 208 $fs_inpost_linked = true; 209 } 210 } 211 212 if ( $fs_inpost_linked ) { 213 // save meta in metadata to show later required metabox in order details. 214 $order->update_meta_data( 'inpost_international_fs_linked', $fs_method_name ); 215 $order->save(); 216 } 217 217 218 } elseif ( 0 === strpos( $shipping_method_id, 'inpost_international_automated_locker_point' ) || 0 === strpos( $fs_method_name, 'inpost_international_automated_locker_point' ) ) { 218 219 … … 246 247 } 247 248 } 249 248 250 249 251 /** -
inpost-international/trunk/src/Helpers/Helper.php
r3353688 r3369498 155 155 156 156 $logo_src = $this->get_shipping_method_logo_src( $configured_method->id, $configured_method->instance_id ); 157 $configured_shipping_methods[ $configured_method->instance_id ]['inpost_icon'] = $logo_src;157 $configured_shipping_methods[ $configured_method->instance_id ]['inpost_icon'] = ! empty( $logo_src ) ? $logo_src : false; 158 158 159 159 if ( 0 === strpos( $configured_method->id, 'inpost_international_automated_locker_point' ) ) { … … 201 201 */ 202 202 public function get_shipping_method_logo_src( $shipping_method_id, $shipping_method_instance_id ) { 203 $shipping_method_settings_name = 'woocommerce_' . $shipping_method_id . '_' . $shipping_method_instance_id . '_settings'; 204 $shipping_method_settings = get_option( $shipping_method_settings_name ); 205 206 $logo_src = inpost_intl_core()->get_plugin_images_url() . '/white.png'; 207 if ( ! empty( $shipping_method_settings['logo_selected'] ) ) { 208 $chosen_logo = $shipping_method_settings['logo_selected']; 209 if ( 'white' === $chosen_logo ) { 210 return $logo_src; 211 } elseif ( 'yellow' === $chosen_logo ) { 212 return inpost_intl_core()->get_plugin_images_url() . '/yellow.png'; 213 214 } elseif ( 'black' === $chosen_logo ) { 215 return inpost_intl_core()->get_plugin_images_url() . '/black.png'; 216 217 } elseif ( 'mondial' === $chosen_logo ) { 218 return inpost_intl_core()->get_plugin_images_url() . '/mondial.png'; 219 220 } elseif ( 'custom' === $chosen_logo ) { 221 if ( ! empty( $shipping_method_settings['logo_custom'] ) ) { 222 return esc_url( $shipping_method_settings['logo_custom'] ); 223 } 224 } 225 } 226 227 return $logo_src; 228 } 203 $shipping_method_settings_name = 'woocommerce_' . $shipping_method_id . '_' . $shipping_method_instance_id . '_settings'; 204 $shipping_method_settings = get_option( $shipping_method_settings_name ); 205 206 $logo_src = inpost_intl_core()->get_plugin_images_url() . '/white.png'; 207 if ( ! empty( $shipping_method_settings['logo_selected'] ) ) { 208 $chosen_logo = $shipping_method_settings['logo_selected']; 209 if ( 'white' === $chosen_logo ) { 210 return $logo_src; 211 } elseif ( 'yellow' === $chosen_logo ) { 212 return inpost_intl_core()->get_plugin_images_url() . '/yellow.png'; 213 214 } elseif ( 'black' === $chosen_logo ) { 215 return inpost_intl_core()->get_plugin_images_url() . '/black.png'; 216 217 } elseif ( 'mondial' === $chosen_logo ) { 218 return inpost_intl_core()->get_plugin_images_url() . '/mondial.png'; 219 220 } elseif ( 'custom' === $chosen_logo ) { 221 if ( ! empty( $shipping_method_settings['logo_custom'] ) ) { 222 return esc_url( $shipping_method_settings['logo_custom'] ); 223 } else { 224 return ''; 225 } 226 } 227 } 228 229 return $logo_src; 230 } 229 231 230 232 … … 1489 1491 case 'PT': 1490 1492 return '351'; 1493 case 'AT': 1494 return '43'; 1495 case 'HU': 1496 return '36'; 1491 1497 default: 1492 1498 return ''; … … 1566 1572 case 'NL': 1567 1573 return 'nl_NL'; 1574 case 'AT': 1575 return 'de_AT'; 1576 case 'HU': 1577 return 'hu_HU'; 1568 1578 default: 1569 1579 return 'pl_PL'; … … 1592 1602 'LU' => array( '/^\(\?((\+)|00)352\)?/', 9, 9 ), 1593 1603 'PT' => array( '/^\(\?((\+)|00)351\)?/', 9, 9 ), 1594 //'AT' => ['/^\(\?((\+)|00)43\)?/', 7, 13],1604 'AT' => ['/^\(\?((\+)|00)43\)?/', 7, 13], 1595 1605 // 'GB' => ['/^\(\?((\+)|00)44\)?/', 10, 10], 1596 1606 'IT' => array( '/^\(\?((\+)|00)39\)?/', 9, 10 ), … … 1608 1618 // 'FI' => ['/^\(\?((\+)|00)358\)?/', 8, 10], 1609 1619 // 'GR' => ['/^\(\?((\+)|00)30\)?/', 10, 10], 1610 //'HU' => ['/^\(\?((\+)|00)36\)?/', 9, 9],1620 'HU' => ['/^\(\?((\+)|00)36\)?/', 9, 9], 1611 1621 // 'LT' => ['/^\(\?((\+)|00)370\)?/', 8, 8], 1612 1622 // 'LV' => ['/^\(\?((\+)|00)371\)?/', 8, 8], … … 1624 1634 'LU' => array( '352', 9, 9 ), 1625 1635 'PT' => array( '351', 9, 9 ), 1626 //'AT' => ['43', 7, 13],1636 'AT' => ['43', 7, 13], 1627 1637 // 'GB' => ['44', 10, 10], 1628 1638 'IT' => array( '39', 9, 10 ), … … 1640 1650 // 'FI' => ['358', 8, 10], 1641 1651 // 'GR' => ['30', 10, 10], 1642 //'HU' => ['36', 9, 9],1652 'HU' => ['36', 9, 9], 1643 1653 // 'LT' => ['370', 8, 8], 1644 1654 // 'LV' => ['371', 8, 8], … … 1692 1702 'IT' => array( '39', 9, 10 ), 1693 1703 'NL' => array( '31', 10, 10 ), 1704 'AT' => array( '43', 7, 13 ), 1705 'HU' => array( '36', 9, 9 ), 1694 1706 ); 1695 1707 … … 1745 1757 return 'InPost International:' . '<br>' . 1746 1758 esc_html__( 'Proszę wpisać numer telefonu w formacie kod kraju i numer telefonu.', 'inpost-international' ) . '<br>' . 1747 esc_html__( 'Obsługiwane numery telefonów dla następujących krajów: Polska, Włochy, Hiszpania, Portugalia, Francja, Holandia, Luksemburg, Belgia.', 'inpost-international' );1759 esc_html__( 'Obsługiwane numery telefonów komórkowych dla następujących krajów: Polska, Włochy, Hiszpania, Portugalia, Francja, Holandia, Luksemburg, Belgia, Austria, Węgry.', 'inpost-international' ); 1748 1760 1749 1761 case 'BE': … … 1751 1763 return 'InPost International:' . '<br>' . 1752 1764 esc_html__( 'Veuillez saisir le numéro de téléphone au format indicatif pays et numéro de téléphone.', 'inpost-international' ) . '<br>' . 1753 esc_html__( 'Numéros de téléphone mobile pris en charge : Pologne, Italie, Espagne, Portugal, France, Pays-Bas, Luxembourg et Belgique.', 'inpost-international' );1765 esc_html__( 'Numéros de téléphone mobile pris en charge pour les pays Pologne, Italie, Espagne, Portugal, France, Pays-Bas, Luxembourg, Belgique, Autriche, Hongrie.', 'inpost-international' ); 1754 1766 1755 1767 case 'ES': 1756 1768 return 'InPost International:' . '<br>' . 1757 1769 esc_html__( 'Ingrese el número de teléfono con el formato de código de país y número de teléfono.', 'inpost-international' ) . '<br>' . 1758 esc_html__( 'Números de teléfono móvil compatibles: Polonia, Italia, España, Portugal, Francia, Países Bajos, Luxemburgo y Bélgica.', 'inpost-international' );1770 esc_html__( 'Números de teléfono móviles admitidos para los países Polonia, Italia, España, Portugal, Francia, Países Bajos, Luxemburgo, Bélgica, Austria y Hungría.', 'inpost-international' ); 1759 1771 1760 1772 case 'IT': 1761 1773 return 'InPost International:' . '<br>' . 1762 1774 esc_html__( 'Inserisci il numero di telefono nel formato prefisso internazionale e numero di telefono.', 'inpost-international' ) . '<br>' . 1763 esc_html__( 'Numeri di cellulare supportati per Polonia, Italia, Spagna, Portogallo, Francia, Paesi Bassi, Lussemburgo e Belgio.', 'inpost-international' );1775 esc_html__( 'Numeri di cellulare supportati per i seguenti paesi: Polonia, Italia, Spagna, Portogallo, Francia, Paesi Bassi, Lussemburgo, Belgio, Austria, Ungheria.', 'inpost-international' ); 1764 1776 1765 1777 case 'LU': 1766 1778 return 'InPost International:' . '<br>' . 1767 1779 esc_html__( 'Bitte geben Sie die Telefonnummer im Format „Landesvorwahl und Telefonnummer" ein.', 'inpost-international' ) . '<br>' . 1768 esc_html__( 'Unterstützte Mobil funknummern für die Länder Polen, Italien, Spanien, Portugal, Frankreich, Niederlande, Luxemburg und Belgien.', 'inpost-international' );1780 esc_html__( 'Unterstützte Mobiltelefonnummern für die Länder Polen, Italien, Spanien, Portugal, Frankreich, Niederlande, Luxemburg, Belgien, Österreich, Ungarn.', 'inpost-international' ); 1769 1781 1770 1782 case 'NL': 1771 1783 return 'InPost International:' . '<br>' . 1772 1784 esc_html__( 'Voer het telefoonnummer in de notatie landcode en telefoonnummer in.', 'inpost-international' ) . '<br>' . 1773 esc_html__( 'Ondersteunde mobiele telefoonnummers voor landen als Polen, Italië, Spanje, Portugal, Frankrijk, Nederland, Luxemburg en België.', 'inpost-international' );1785 esc_html__( 'Ondersteunde mobiele telefoonnummers voor landen: Polen, Italië, Spanje, Portugal, Frankrijk, Nederland, Luxemburg, België, Oostenrijk en Hongarije.', 'inpost-international' ); 1774 1786 1775 1787 case 'PT': 1776 1788 return 'InPost International:' . '<br>' . 1777 1789 esc_html__( 'Introduza o número de telefone no formato indicativo do país e número de telefone.', 'inpost-international' ) . '<br>' . 1778 esc_html__( 'Números de telemóvel suportados para os países: Polónia, Itália, Espanha, Portugal, França, Países Baixos, Luxemburgo e Bélgica.', 'inpost-international' ); 1790 esc_html__( 'Números de telemóvel suportados para os seguintes países: Polónia, Itália, Espanha, Portugal, França, Países Baixos, Luxemburgo, Bélgica, Áustria e Hungria.', 'inpost-international' ); 1791 1792 case 'AT': 1793 return 'InPost International:' . '<br>' . 1794 esc_html__( 'Geben Sie die Telefonnummer im Landesvorwahl- und Telefonnummernformat ein.', 'inpost-international' ) . '<br>' . 1795 esc_html__( 'Unterstützte Mobiltelefonnummern für die Länder Polen, Italien, Spanien, Portugal, Frankreich, Niederlande, Luxemburg, Belgien, Österreich, Ungarn.', 'inpost-international' ); 1796 1797 case 'HU': 1798 return 'InPost International:' . '<br>' . 1799 esc_html__( 'Kérjük, a telefonszámot országkód és telefonszám formátumban adja meg.', 'inpost-international' ) . '<br>' . 1800 esc_html__( 'Támogatott mobiltelefonszámok a következő országokból: Lengyelország, Olaszország, Spanyolország, Portugália, Franciaország, Hollandia, Luxemburg, Belgium, Ausztria, Magyarország.', 'inpost-international' ); 1779 1801 1780 1802 default: 1781 1803 return 'InPost International:' . '<br>' . 1782 1804 esc_html__( 'Please enter the phone number in the format country code and phone number.', 'inpost-international' ) . '<br>' . 1783 esc_html__( 'Supported mobile phone numbers for countries Poland, Italy, Spain, Portugal, France, Netherlands, Luxembourg, Belgium .', 'inpost-international' );1805 esc_html__( 'Supported mobile phone numbers for countries Poland, Italy, Spain, Portugal, France, Netherlands, Luxembourg, Belgium, Austria, Hungary.', 'inpost-international' ); 1784 1806 } 1785 1807 } -
inpost-international/trunk/src/Plugin.php
r3353688 r3369498 139 139 140 140 $geowidget_token = $this->get_geowidget_token(); 141 142 if ( empty( $geowidget_token ) ) { 143 return; 144 } 145 141 146 $this->enqueue_geowidget_assets(); 142 147 … … 206 211 } elseif ( ! empty( $plugin_geowidget_settings['geowidget_sandbox_token'] ) ) { 207 212 $geowidget_token = $plugin_geowidget_settings['geowidget_sandbox_token']; 213 } elseif ( ! empty( get_option( 'easypack_geowidget_production_token' ) ) ) { 214 $geowidget_token = get_option( 'easypack_geowidget_production_token' ); 215 } elseif ( ! empty( get_option( 'easypack_geowidget_sandbox_token' ) ) ) { 216 $geowidget_token = get_option( 'easypack_geowidget_sandbox_token' ); 208 217 } 209 218
Note: See TracChangeset
for help on using the changeset viewer.