{"id":36197,"date":"2023-08-21T09:00:47","date_gmt":"2023-08-21T09:00:47","guid":{"rendered":"http:\/\/www.ccdrc.pt\/finalizar-compra\/"},"modified":"2024-02-02T15:17:21","modified_gmt":"2024-02-02T15:17:21","slug":"finalizar-compra","status":"publish","type":"page","link":"https:\/\/www.ccdrc.pt\/en\/finalizar-compra\/","title":{"rendered":"Complete purchase"},"content":{"rendered":"<p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-margin-top:88px;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start\" style=\"max-width:1288px;margin-left: calc(-0% \/ 2 );margin-right: calc(-0% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_2_3 2_3 fusion-flex-column desktopleft\" style=\"--awb-bg-size:cover;--awb-width-large:66.666666666667%;--awb-margin-top-large:0px;--awb-spacing-right-large:0%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:0%;--awb-width-medium:66.666666666667%;--awb-order-medium:0;--awb-spacing-right-medium:0%;--awb-spacing-left-medium:0%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:0%;--awb-spacing-left-small:0%;\" id=\"duringCheckoutBackLink\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><button onclick=\"goBack()\" id=\"back-button\" class=\"desktop\"><svg width=\"14\" height=\"12\" viewBox=\"0 0 14 12\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M1.03815 5.37239C0.690913 5.71947 0.690913 6.28314 1.03815 6.63023L5.48285 11.0729C5.83009 11.42 6.39401 11.42 6.74125 11.0729C7.08849 10.7259 7.08849 10.1622 6.74125 9.8151L3.81053 6.88846L12.3332 6.88846C12.8249 6.88846 13.2222 6.49139 13.2222 5.99992C13.2222 5.50844 12.8249 5.11138 12.3332 5.11138L3.81331 5.11138L6.73847 2.18474C7.08571 1.83766 7.08571 1.27399 6.73847 0.926901C6.39123 0.579815 5.82731 0.579815 5.48007 0.926902L1.03538 5.36961L1.03815 5.37239Z\" fill=\"#007B88\"\/><\/svg>Voltar ao seu carrinho<\/button>\n\n<script>\nfunction goBack() {\n  window.location.href=\"https:\/\/www.ccdrc.pt\/pt\/carrinho\/\";\n}\n<\/script><div class=\"fusion-text fusion-text-1 fusion-text-no-margin\" style=\"--awb-font-size:44px;--awb-margin-top:0px;--awb-margin-bottom:88px;--awb-text-font-family:&quot;Noto Sans&quot;;--awb-text-font-style:normal;--awb-text-font-weight:700;\"><p>Dados da encomenda<\/p>\n<\/div><\/div><\/div><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_2_3 2_3 fusion-flex-column desktopleft\" style=\"--awb-bg-size:cover;--awb-width-large:66.666666666667%;--awb-margin-top-large:0px;--awb-spacing-right-large:0%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:0%;--awb-width-medium:66.666666666667%;--awb-order-medium:0;--awb-spacing-right-medium:0%;--awb-spacing-left-medium:0%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:0%;--awb-spacing-left-small:0%;\" id=\"finishedCheckoutBackLink\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><button onclick=\"goBack2()\" id=\"back-button\" class=\"desktop\"><svg width=\"14\" height=\"12\" viewBox=\"0 0 14 12\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M1.03815 5.37239C0.690913 5.71947 0.690913 6.28314 1.03815 6.63023L5.48285 11.0729C5.83009 11.42 6.39401 11.42 6.74125 11.0729C7.08849 10.7259 7.08849 10.1622 6.74125 9.8151L3.81053 6.88846L12.3332 6.88846C12.8249 6.88846 13.2222 6.49139 13.2222 5.99992C13.2222 5.50844 12.8249 5.11138 12.3332 5.11138L3.81331 5.11138L6.73847 2.18474C7.08571 1.83766 7.08571 1.27399 6.73847 0.926901C6.39123 0.579815 5.82731 0.579815 5.48007 0.926902L1.03538 5.36961L1.03815 5.37239Z\" fill=\"#007B88\"\/><\/svg>Voltar \u00e1 Biblioteca Digital<\/button>\n\n<script>\nfunction goBack2() {\n  window.location.href=\"https:\/\/www.ccdrc.pt\/pt\/servicos\/bibliotecadigital\/?wpf_filter_cat_1=505&wpf_fbv=1&all_products_filtering=1&product_cat=em-destaque\";\n}\n<\/script><div class=\"fusion-text fusion-text-2 fusion-text-no-margin\" style=\"--awb-font-size:44px;--awb-margin-top:0px;--awb-margin-bottom:88px;--awb-text-font-family:&quot;Noto Sans&quot;;--awb-text-font-style:normal;--awb-text-font-weight:700;\"><p>Obrigado, a sua encomenda foi recebida<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start\" style=\"max-width:1288px;margin-left: calc(-0% \/ 2 );margin-right: calc(-0% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-2 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:0%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:0%;--awb-width-medium:100%;--awb-spacing-right-medium:0%;--awb-spacing-left-medium:0%;--awb-width-small:100%;--awb-spacing-right-small:0%;--awb-spacing-left-small:0%;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-3\"><div class=\"woocommerce\"><\/div>\n<p>&nbsp;<\/p>\n<\/div><script type=\"text\/javascript\">\n    window.onload = function() {\n        \/\/ Get the container element that holds the form fields\n        const fieldContainer = document.querySelector('.woocommerce-billing-fields__field-wrapper');\n\n        \/\/ Check if the fieldContainer element exists\n        if (fieldContainer !== null) {\n            \/\/ Define the desired order of field IDs\n            const desiredOrder = ['billing_first_name_field', 'billing_email_field', 'billing_address_1_field', 'billing_postcode_field', 'billing_city_field', 'billing_phone_field', 'billing_vat_field', 'billing_last_name', 'billing_country'];\n\n            \/\/ Create a map to store the fields based on their IDs\n            const fieldsMap = new Map();\n\n            \/\/ Extract and store the fields in the map\n            desiredOrder.forEach(fieldId => {\n                const field = fieldContainer.querySelector(`#${fieldId}`);\n                if (field) {\n                    fieldsMap.set(fieldId, field);\n                }\n            });\n\n            \/\/ Clear the field container\n            fieldContainer.innerHTML = '';\n\n            \/\/ Append the fields to the container in the desired order\n            desiredOrder.forEach(fieldId => {\n                const field = fieldsMap.get(fieldId);\n                if (field) {\n                    fieldContainer.appendChild(field);\n                }\n            });\n        }\n    };\n<\/script><script type=\"text\/javascript\">\n\/\/ Wait for the DOM to be fully loaded\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n    \/\/ Delay the execution by one second\n    setTimeout(function () {\n        \/\/ Get references to the form and the NIF field\n        var form = document.querySelector('form[name=\"checkout\"]');\n        var nifField = document.querySelector('#billing_tax_number_field');\n\n        \/\/ Get the target element after which you want to insert the NIF field\n        var targetElement = document.querySelector('#billing_phone_field');\n\n        \/\/ Check if both the form and NIF field exist\n        if (form && nifField && targetElement) {\n            \/\/ Remove the NIF field from its current position\n            nifField.remove();\n\n            \/\/ Insert the NIF field immediately after the target element\n            targetElement.parentNode.insertBefore(nifField, targetElement.nextSibling);\n        }\n    }, 500); \/\/ Delay for one second (1000 milliseconds)\n  \n  \n      \/\/ Get a reference to the anchor element with the class \"fusion-button\"\n    var button = document.querySelector('.continue-checkout');\n\n    \/\/ Check if the anchor element exists\n    if (button) {\n        \/\/ Change the text of the anchor element to 'Avan\u00e7ar'\n        button.textContent = 'Avan\u00e7ar';\n    }\n  \n  \n  \n});\n<\/script><script type=\"text\/javascript\">\n    \/\/ Remove the \"validate-required\" class from the specified <p> element on page load\n    document.addEventListener('DOMContentLoaded', function() {\n        const billing_last_name_field = document.getElementById('billing_last_name_field');\n         \n        \/\/ Check if the element exists before removing the class\n        if (billing_last_name_field !== null) {\n            billing_last_name_field.classList.remove('validate-required');\n            \n        }\n      \n      const billing_last_name = document.getElementById('billing_last_name');\n       if (billing_last_name !== null) {\n           billing_last_name.value = '\u00a0';\n        }\n    });\n<\/script><script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Get all form elements on the page\n    const forms = document.querySelectorAll('form');\n\n    \/\/ Check if there are fewer than two forms\n    if (forms.length < 2) {\n        \/\/ Hide the first div\n        const firstDiv = document.getElementById('duringCheckoutBackLink');\n        if (firstDiv) {\n            firstDiv.style.display = 'none';\n        }\n\n        \/\/ Show the second div\n        const secondDiv = document.getElementById('finishedCheckoutBackLink');\n        if (secondDiv) {\n            secondDiv.style.display = 'block';\n        }\n    }\n  \n\n  \n  \n});\n<\/script><script type=\"text\/javascript\">\n        \/\/ Function to update the text of the button by data-name\n        function updateButtonText() {\n            const buttons = document.querySelectorAll('a[data-name=\"order_review\"]');\n            buttons.forEach(button => {\n                button.textContent = 'Avan\u00e7ar';\n            });\n        }\n\n        \/\/ Call the function on page load\n        window.addEventListener('DOMContentLoaded', updateButtonText);\n<\/script><script type=\"text\/javascript\">\n        function updateNotesPlaceholder() {\n    \t\tvar textarea = document.getElementById(\"order_comments\");\n    \t\ttextarea.removeAttribute(\"placeholder\");\n          \n              setTimeout(function () {\n                var link = document.querySelector(\".woocommerce-terms-and-conditions-link\");\n                    if (link) {\n                        \/\/ Replace the href attribute with the new URL\n                        link.href = \"https:\/\/www.ccdrc.pt\/pt\/termos-e-condicoes\/\";\n                      }\n                }, 1000); \n          \n        }\n\n        \/\/ Call the function on page load\n        window.addEventListener('DOMContentLoaded', updateNotesPlaceholder);\n<\/script><script type=\"text\/javascript\">\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n    var label = document.querySelector('label[for=\"billing_email\"]');\n    if (label) {\n        label.textContent = \"Mail\";\n    }\n});\n<\/script><script type=\"text\/javascript\">\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n  \n                setTimeout(function () {\n                      var textarea = document.getElementById(\"billing_address_1\");\n                      if (textarea) {\n                          textarea.removeAttribute(\"placeholder\");\n                      }\n                }, 1000); \n  \n  \n\n});\n<\/script><script type=\"text\/javascript\">\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n    \/\/ Function to check if the error message element is present\n    function checkErrorMessageElement() {\n        var errorMessageElement = document.querySelector('.avada-checkout-error');\n\n        if (errorMessageElement) {\n            \/\/ Change the error message text to your custom message\n            errorMessageElement.textContent = 'Valide os campos assinalados.'; \/\/ Replace with your custom message\n\n            \/\/ Stop checking once the element is found\n            \/\/ clearInterval(checkInterval);\n        }\n    }\n\n    \/\/ Interval to check for the element every 100ms\n    var checkInterval = setInterval(checkErrorMessageElement, 100);\n});\n<\/script>  <script>\n    \/\/ Add an event listener to run the script when the DOM is loaded\n    document.addEventListener('DOMContentLoaded', function() {\n      \/\/ Get the button and checkbox elements\n\n\n      \/\/ Set the initial 'disabled' state based on checkbox state\n      updateButtonState();\n\n\n\n      \/\/ Check the checkbox status periodically (every 0.2 seconds)\n      setInterval(function() {\n        \/\/ Update the 'disabled' attribute and 'opacity' property of the button based on checkbox state\n        updateButtonState();\n      }, 200);\n\n      function updateButtonState() {\n        var button = document.getElementById('place_order');\n      \tvar checkbox = document.getElementById('terms');\n        \/\/ Update the 'disabled' attribute of the button based on checkbox state\n        button.disabled = !checkbox.checked;\n\n        \/\/ Update the 'opacity' property of the button\n        button.style.opacity = button.disabled ? '0.38' : '1.0';\n      }\n    });\n  <\/script><\/div><\/div><\/div><\/div><\/p>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_eb_attr":"","inline_featured_image":false,"iawp_total_views":4,"footnotes":""},"class_list":["post-36197","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ccdrc.pt\/en\/wp-json\/wp\/v2\/pages\/36197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ccdrc.pt\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ccdrc.pt\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ccdrc.pt\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ccdrc.pt\/en\/wp-json\/wp\/v2\/comments?post=36197"}],"version-history":[{"count":83,"href":"https:\/\/www.ccdrc.pt\/en\/wp-json\/wp\/v2\/pages\/36197\/revisions"}],"predecessor-version":[{"id":80540,"href":"https:\/\/www.ccdrc.pt\/en\/wp-json\/wp\/v2\/pages\/36197\/revisions\/80540"}],"wp:attachment":[{"href":"https:\/\/www.ccdrc.pt\/en\/wp-json\/wp\/v2\/media?parent=36197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}