Plugin Directory

Changeset 3369498


Ignore:
Timestamp:
09/29/2025 07:56:55 AM (5 months ago)
Author:
inpost
Message:

Version 1.0.6

Location:
inpost-international/trunk
Files:
24 edited

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  
    1313            let inpost_intl_geowidget_modal;
    1414            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';
    1616            let coords                      = null;
    1717            let selected_country            = null;
     
    10051005                                    if ( typeof map_button != 'undefined' && map_button !== null) {
    10061006                                        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);
    10091009                                            if ( 'need_map' in map_config_settings ) {
    10101010                                                console.log('need_map');
  • inpost-international/trunk/blocks/src/js/inpost-intl-block/block.js

    r3353688 r3369498  
    66export const Block = ( { checkoutExtensionData, extensions } ) => {
    77
    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    }, []);
    2797
    2898    function useInpostConfiguredMethods() {
     
    34104
    35105    const configured_shipping_methods = useInpostConfiguredMethods();
    36 
    37106
    38107    if (typeof shippingRates != 'undefined' && shippingRates !== null) {
     
    98167
    99168
    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.checked
    161                             };
    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                }
    198267
    199268                let is_inpost_method_checked = false;
     
    203272                        const [shipping_method, instance_id] = method.value.split(':');
    204273                        if (shipping_method.indexOf('inpost_international_automated_locker_point') !== -1) {
    205 
    206274                            if (method.checked) {
    207275                                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);
    224276                            }
    225277                        }
     
    233285                    }
    234286                }
    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    };
    254333
    255334    return (
  • inpost-international/trunk/changelog.txt

    r3353688 r3369498  
    2525### Feat
    2626- 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  
    55 * Description: InPost International to oficjalna bezpłatna aplikacja InPost dla obsługi międzynarodowej dostawy
    66 * Tags: woocommerce, inpost, shipments
    7  * Version: 1.0.5
     7 * Version: 1.0.6
    88 * Tested up to: 6.8
    99 * Requires PHP: 7.4
     
    3636}
    3737
    38 define( 'INPOST_INTL_PLUGIN_VERSION', '1.0.5' );
     38define( 'INPOST_INTL_PLUGIN_VERSION', '1.0.6' );
    3939define( 'INPOST_INTL_PLUGIN_SLUG', 'inpost_international' );
    4040define( 'INPOST_INTL_PLUGIN_FILE', __FILE__ );
  • inpost-international/trunk/lang/inpost-international-de_DE.po

    r3353688 r3369498  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-11-18T15:04:40+02:00\n"
    6 "PO-Revision-Date: 2025-07-23 14:52+0200\n"
     6"PO-Revision-Date: 2025-09-18 11:20+0200\n"
    77"Last-Translator: Aleksander Sikirytski <[email protected]>\n"
    88"Language-Team: Aleksander Sikirytski <[email protected]>\n"
     
    848848msgid "InPost International Courier"
    849849msgstr "InPost International Kurier"
     850
     851msgid "Map button text for buyers from Italy"
     852msgstr "Kartenbutton-Text für Käufer aus Italien"
     853
     854msgid "Map button text for buyers from Spain"
     855msgstr "Kartenbutton-Text für Käufer aus Spanien"
     856
     857msgid "Map button text for buyers from Portugal"
     858msgstr "Kartenbutton-Text für Käufer aus Portugal"
     859
     860msgid "Map button text for buyers from the Netherlands"
     861msgstr "Kartenbutton-Text für Käufer aus den Niederlanden"
     862
     863msgid "Map button text for buyers from France"
     864msgstr "Kartenbutton-Text für Käufer aus Frankreich"
     865
     866msgid "Map button text for buyers from Belgium"
     867msgstr "Kartenbutton-Text für Käufer aus Belgien"
     868
     869msgid "Map button text for buyers from Luxembourg"
     870msgstr "Kartenbutton-Text für Käufer aus Luxemburg"
     871
     872msgid "Map button text for buyers from Austria"
     873msgstr "Kartenbutton-Text für Käufer aus Österreich"
     874
     875msgid "Map button text for buyers from Hungary"
     876msgstr "Kartenbutton-Text für Käufer aus Ungarn"
  • inpost-international/trunk/lang/inpost-international-es_ES.po

    r3334052 r3369498  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-11-18T15:04:40+02:00\n"
    6 "PO-Revision-Date: 2025-07-23 14:52+0200\n"
     6"PO-Revision-Date: 2025-09-18 11:21+0200\n"
    77"Last-Translator: Aleksander Sikirytski <[email protected]>\n"
    88"Language-Team: Aleksander Sikirytski <[email protected]>\n"
     
    833833msgid "Supported mobile phone numbers for countries Poland, Italy, Spain, Portugal, France, Netherlands, Luxembourg, Belgium."
    834834msgstr "Números de teléfono móvil compatibles: Polonia, Italia, España, Portugal, Francia, Países Bajos, Luxemburgo y Bélgica."
     835
     836msgid "Map button text for buyers from Italy"
     837msgstr "Texto del botón del mapa para compradores de Italia"
     838
     839msgid "Map button text for buyers from Spain"
     840msgstr "Texto del botón del mapa para compradores de España"
     841
     842msgid "Map button text for buyers from Portugal"
     843msgstr "Texto del botón del mapa para compradores de Portugal"
     844
     845msgid "Map button text for buyers from the Netherlands"
     846msgstr "Texto del botón del mapa para compradores de los Países Bajos"
     847
     848msgid "Map button text for buyers from France"
     849msgstr "Texto del botón del mapa para compradores de Francia"
     850
     851msgid "Map button text for buyers from Belgium"
     852msgstr "Texto del botón del mapa para compradores de Bélgica"
     853
     854msgid "Map button text for buyers from Luxembourg"
     855msgstr "Texto del botón del mapa para compradores de Luxemburgo"
     856
     857msgid "Map button text for buyers from Austria"
     858msgstr "Texto del botón del mapa para compradores de Austria"
     859
     860msgid "Map button text for buyers from Hungary"
     861msgstr "Texto del botón del mapa para compradores de Hungría"
  • inpost-international/trunk/lang/inpost-international-fr_FR.po

    r3334052 r3369498  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-11-18T15:04:40+02:00\n"
    6 "PO-Revision-Date: 2025-07-23 14:53+0200\n"
     6"PO-Revision-Date: 2025-09-18 11:21+0200\n"
    77"Last-Translator: Aleksander Sikirytski <[email protected]>\n"
    88"Language-Team: Aleksander Sikirytski <[email protected]>\n"
     
    833833msgid "Supported mobile phone numbers for countries Poland, Italy, Spain, Portugal, France, Netherlands, Luxembourg, Belgium."
    834834msgstr "Numéros de téléphone mobile pris en charge: Pologne, Italie, Espagne, Portugal, France, Pays-Bas, Luxembourg et Belgique."
     835
     836msgid "Map button text for buyers from Italy"
     837msgstr "Texte du bouton carte pour les acheteurs d'Italie"
     838
     839msgid "Map button text for buyers from Spain"
     840msgstr "Texte du bouton carte pour les acheteurs d'Espagne"
     841
     842msgid "Map button text for buyers from Portugal"
     843msgstr "Texte du bouton carte pour les acheteurs du Portugal"
     844
     845msgid "Map button text for buyers from the Netherlands"
     846msgstr "Texte du bouton carte pour les acheteurs des Pays-Bas"
     847
     848msgid "Map button text for buyers from France"
     849msgstr "Texte du bouton carte pour les acheteurs de France"
     850
     851msgid "Map button text for buyers from Belgium"
     852msgstr "Texte du bouton carte pour les acheteurs de Belgique"
     853
     854msgid "Map button text for buyers from Luxembourg"
     855msgstr "Texte du bouton carte pour les acheteurs du Luxembourg"
     856
     857msgid "Map button text for buyers from Austria"
     858msgstr "Texte du bouton carte pour les acheteurs d'Autriche"
     859
     860msgid "Map button text for buyers from Hungary"
     861msgstr "Texte du bouton carte pour les acheteurs de Hongrie"
  • inpost-international/trunk/lang/inpost-international-it_IT.po

    r3353688 r3369498  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-11-18T15:04:40+02:00\n"
    6 "PO-Revision-Date: 2025-08-19 12:17+0200\n"
     6"PO-Revision-Date: 2025-09-18 11:21+0200\n"
    77"Last-Translator: Aleksander Sikirytski <[email protected]>\n"
    88"Language-Team: Aleksander Sikirytski <[email protected]>\n"
     
    848848msgid "InPost International Courier"
    849849msgstr "InPost International Corriere"
     850
     851msgid "Map button text for buyers from Italy"
     852msgstr "Testo del pulsante mappa per acquirenti dall'Italia"
     853
     854msgid "Map button text for buyers from Spain"
     855msgstr "Testo del pulsante mappa per acquirenti dalla Spagna"
     856
     857msgid "Map button text for buyers from Portugal"
     858msgstr "Testo del pulsante mappa per acquirenti dal Portogallo"
     859
     860msgid "Map button text for buyers from the Netherlands"
     861msgstr "Testo del pulsante mappa per acquirenti dai Paesi Bassi"
     862
     863msgid "Map button text for buyers from France"
     864msgstr "Testo del pulsante mappa per acquirenti dalla Francia"
     865
     866msgid "Map button text for buyers from Belgium"
     867msgstr "Testo del pulsante mappa per acquirenti dal Belgio"
     868
     869msgid "Map button text for buyers from Luxembourg"
     870msgstr "Testo del pulsante mappa per acquirenti dal Lussemburgo"
     871
     872msgid "Map button text for buyers from Austria"
     873msgstr "Testo del pulsante mappa per acquirenti dall'Austria"
     874
     875msgid "Map button text for buyers from Hungary"
     876msgstr "Testo del pulsante mappa per acquirenti dall'Ungheria"
  • inpost-international/trunk/lang/inpost-international-nl_BE.po

    r3334052 r3369498  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-11-18T15:04:40+02:00\n"
    6 "PO-Revision-Date: 2025-07-23 14:53+0200\n"
     6"PO-Revision-Date: 2025-09-18 11:22+0200\n"
    77"Last-Translator: Aleksander Sikirytski <[email protected]>\n"
    88"Language-Team: Aleksander Sikirytski <[email protected]>\n"
     
    833833msgid "Supported mobile phone numbers for countries Poland, Italy, Spain, Portugal, France, Netherlands, Luxembourg, Belgium."
    834834msgstr "Ondersteunde mobiele telefoonnummers voor landen als Polen, Italië, Spanje, Portugal, Frankrijk, Nederland, Luxemburg en België."
     835
     836msgid "Map button text for buyers from Italy"
     837msgstr "Kaarttekst voor kopers uit Italië"
     838
     839msgid "Map button text for buyers from Spain"
     840msgstr "Kaarttekst voor kopers uit Spanje"
     841
     842msgid "Map button text for buyers from Portugal"
     843msgstr "Kaarttekst voor kopers uit Portugal"
     844
     845msgid "Map button text for buyers from the Netherlands"
     846msgstr "Kaarttekst voor kopers uit Nederland"
     847
     848msgid "Map button text for buyers from France"
     849msgstr "Kaarttekst voor kopers uit Frankrijk"
     850
     851msgid "Map button text for buyers from Belgium"
     852msgstr "Kaarttekst voor kopers uit België"
     853
     854msgid "Map button text for buyers from Luxembourg"
     855msgstr "Kaarttekst voor kopers uit Luxemburg"
     856
     857msgid "Map button text for buyers from Austria"
     858msgstr "Kaarttekst voor kopers uit Oostenrijk"
     859
     860msgid "Map button text for buyers from Hungary"
     861msgstr "Kaarttekst voor kopers uit Hongarije"
  • inpost-international/trunk/lang/inpost-international-nl_NL.po

    r3334052 r3369498  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-11-18T15:04:40+02:00\n"
    6 "PO-Revision-Date: 2025-07-23 14:53+0200\n"
     6"PO-Revision-Date: 2025-09-18 11:22+0200\n"
    77"Last-Translator: Aleksander Sikirytski <[email protected]>\n"
    88"Language-Team: Aleksander Sikirytski <[email protected]>\n"
     
    833833msgid "Supported mobile phone numbers for countries Poland, Italy, Spain, Portugal, France, Netherlands, Luxembourg, Belgium."
    834834msgstr "Ondersteunde mobiele telefoonnummers voor landen als Polen, Italië, Spanje, Portugal, Frankrijk, Nederland, Luxemburg en België."
     835
     836msgid "Map button text for buyers from Italy"
     837msgstr "Kaartknoptekst voor kopers uit Italië"
     838
     839msgid "Map button text for buyers from Spain"
     840msgstr "Kaartknoptekst voor kopers uit Spanje"
     841
     842msgid "Map button text for buyers from Portugal"
     843msgstr "Kaartknoptekst voor kopers uit Portugal"
     844
     845msgid "Map button text for buyers from the Netherlands"
     846msgstr "Kaartknoptekst voor kopers uit Nederland"
     847
     848msgid "Map button text for buyers from France"
     849msgstr "Kaartknoptekst voor kopers uit Frankrijk"
     850
     851msgid "Map button text for buyers from Belgium"
     852msgstr "Kaartknoptekst voor kopers uit België"
     853
     854msgid "Map button text for buyers from Luxembourg"
     855msgstr "Kaartknoptekst voor kopers uit Luxemburg"
     856
     857msgid "Map button text for buyers from Austria"
     858msgstr "Kaartknoptekst voor kopers uit Oostenrijk"
     859
     860msgid "Map button text for buyers from Hungary"
     861msgstr "Kaartknoptekst voor kopers uit Hongarije"
  • inpost-international/trunk/lang/inpost-international-pl_PL.po

    r3353688 r3369498  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-11-18T15:04:40+02:00\n"
    6 "PO-Revision-Date: 2025-08-19 12:16+0200\n"
     6"PO-Revision-Date: 2025-09-18 11:22+0200\n"
    77"Last-Translator: Aleksander Sikirytski <[email protected]>\n"
    88"Language-Team: Aleksander Sikirytski <[email protected]>\n"
     
    894894msgstr "Tekst przycisku mapy dla kupujących z Francji"
    895895
    896 msgid "Tekst przycisku mapy dla kupujących z Belgii"
     896msgid "Map button text for buyers from Belgium"
    897897msgstr "Tekst przycisku mapy dla kupujących z Włoch"
    898898
     
    900900msgstr "Tekst przycisku mapy dla kupujących z Luksemburga"
    901901
     902msgid "Map button text for buyers from Austria"
     903msgstr "Tekst przycisku mapy dla kupujących z Austrii"
     904
     905msgid "Map button text for buyers from Hungary"
     906msgstr "Tekst przycisku mapy dla kupujących z Węgier"
     907
    902908msgid "Country"
    903909msgstr "Kraj"
  • inpost-international/trunk/readme.txt

    r3353688 r3369498  
    44Requires at least: 6.0
    55Tested up to: 6.8
    6 Stable tag: 1.0.5
     6Stable tag: 1.0.6
    77Requires PHP: 7.4
    88License: GPLv3 or later
     
    7373== Changelog ==
    7474
     75= 1.0.6 =
     76* Fix: JS conflict with InPost PL
     77
    7578= 1.0.5 =
    7679* Feat: settings for Italy
  • inpost-international/trunk/src/Backend/Backend.php

    r3353688 r3369498  
    163163        }
    164164
     165        $fs_inpost_linked = false;
     166        $fs_method_name   = '';
     167        static $alert_phone_shown;
     168
    165169        foreach ( $order->get_items( 'shipping' ) as $item_id => $item ) {
    166170            $shipping_method_id          = $item->get_method_id();
     
    168172        }
    169173
    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        }
    174190
    175191        $request_body = json_decode( $request->get_body(), true );
     
    199215            $order->save();
    200216
    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
    217218        } elseif ( 0 === strpos( $shipping_method_id, 'inpost_international_automated_locker_point' ) || 0 === strpos( $fs_method_name, 'inpost_international_automated_locker_point' ) ) {
    218219
     
    246247        }
    247248    }
     249   
    248250
    249251    /**
  • inpost-international/trunk/src/Helpers/Helper.php

    r3353688 r3369498  
    155155
    156156                        $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;
    158158
    159159                        if ( 0 === strpos( $configured_method->id, 'inpost_international_automated_locker_point' ) ) {
     
    201201     */
    202202    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    }
    229231
    230232
     
    14891491            case 'PT':
    14901492                return '351';
     1493            case 'AT':
     1494                return '43';
     1495            case 'HU':
     1496                return '36';
    14911497            default:
    14921498                return '';
     
    15661572            case 'NL':
    15671573                return 'nl_NL';
     1574            case 'AT':
     1575                return 'de_AT';
     1576            case 'HU':
     1577                return 'hu_HU';
    15681578            default:
    15691579                return 'pl_PL';
     
    15921602            'LU' => array( '/^\(\?((\+)|00)352\)?/', 9, 9 ),
    15931603            'PT' => array( '/^\(\?((\+)|00)351\)?/', 9, 9 ),
    1594             // 'AT' => ['/^\(\?((\+)|00)43\)?/', 7, 13],
     1604            'AT' => ['/^\(\?((\+)|00)43\)?/', 7, 13],
    15951605            // 'GB' => ['/^\(\?((\+)|00)44\)?/', 10, 10],
    15961606            'IT' => array( '/^\(\?((\+)|00)39\)?/', 9, 10 ),
     
    16081618            // 'FI' => ['/^\(\?((\+)|00)358\)?/', 8, 10],
    16091619            // 'GR' => ['/^\(\?((\+)|00)30\)?/', 10, 10],
    1610             // 'HU' => ['/^\(\?((\+)|00)36\)?/', 9, 9],
     1620            'HU' => ['/^\(\?((\+)|00)36\)?/', 9, 9],
    16111621            // 'LT' => ['/^\(\?((\+)|00)370\)?/', 8, 8],
    16121622            // 'LV' => ['/^\(\?((\+)|00)371\)?/', 8, 8],
     
    16241634            'LU' => array( '352', 9, 9 ),
    16251635            'PT' => array( '351', 9, 9 ),
    1626             // 'AT' => ['43', 7, 13],
     1636            'AT' => ['43', 7, 13],
    16271637            // 'GB' => ['44', 10, 10],
    16281638            'IT' => array( '39', 9, 10 ),
     
    16401650            // 'FI' => ['358', 8, 10],
    16411651            // 'GR' => ['30', 10, 10],
    1642             // 'HU' => ['36', 9, 9],
     1652            'HU' => ['36', 9, 9],
    16431653            // 'LT' => ['370', 8, 8],
    16441654            // 'LV' => ['371', 8, 8],
     
    16921702            'IT' => array( '39', 9, 10 ),
    16931703            'NL' => array( '31', 10, 10 ),
     1704            'AT' => array( '43', 7, 13 ),
     1705            'HU' => array( '36', 9, 9 ),
    16941706        );
    16951707
     
    17451757                return 'InPost International:' . '<br>' .
    17461758                        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' );
    17481760
    17491761            case 'BE':
     
    17511763                return 'InPost International:' . '<br>' .
    17521764                        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' );
    17541766
    17551767            case 'ES':
    17561768                return 'InPost International:' . '<br>' .
    17571769                        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' );
    17591771
    17601772            case 'IT':
    17611773                return 'InPost International:' . '<br>' .
    17621774                        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' );
    17641776
    17651777            case 'LU':
    17661778                return 'InPost International:' . '<br>' .
    17671779                        esc_html__( 'Bitte geben Sie die Telefonnummer im Format „Landesvorwahl und Telefonnummer" ein.', 'inpost-international' ) . '<br>' .
    1768                         esc_html__( 'Unterstützte Mobilfunknummern 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' );
    17691781
    17701782            case 'NL':
    17711783                return 'InPost International:' . '<br>' .
    17721784                        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' );
    17741786
    17751787            case 'PT':
    17761788                return 'InPost International:' . '<br>' .
    17771789                        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' );
    17791801
    17801802            default:
    17811803                return 'InPost International:' . '<br>' .
    17821804                        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' );
    17841806        }
    17851807    }
  • inpost-international/trunk/src/Plugin.php

    r3353688 r3369498  
    139139
    140140            $geowidget_token = $this->get_geowidget_token();
     141           
     142            if ( empty( $geowidget_token ) ) {
     143                return;
     144            }
     145           
    141146            $this->enqueue_geowidget_assets();
    142147
     
    206211        } elseif ( ! empty( $plugin_geowidget_settings['geowidget_sandbox_token'] ) ) {
    207212            $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' );
    208217        }
    209218
Note: See TracChangeset for help on using the changeset viewer.