

{"id":29670,"date":"2024-07-12T15:02:49","date_gmt":"2024-07-12T13:02:49","guid":{"rendered":"https:\/\/druckereisaas.ch\/?page_id=29670"},"modified":"2025-04-26T14:21:06","modified_gmt":"2025-04-26T12:21:06","slug":"blockout-blache","status":"publish","type":"page","link":"https:\/\/druckereisaas.ch\/fr\/blockout-blache\/","title":{"rendered":"Blockout Blache"},"content":{"rendered":"\n<!-- Here we create variables where we store data about a chosen product, sizes, quantities, ID of mask, and chosen material. -->\n<input class=\"view\" style=\"display: none;\" value='notefield'>\n<input class=\"id_mask\" style=\"display: none;\" value='29628'>\n<input class=\"id_product\" style=\"display: none;\" value='29766'>\n\n\n\n<input class=\"product_material_name\" style=\"display: none;\" value='Blockout Blache'>\n\n<input class=\"product_material_name_start\" style=\"display: none;\" value=''>\n<input class=\"product_material_name_end\" style=\"display: none;\" value=''>\n\n<input class=\"product_cutting\" style=\"display: none;\" value=''>\n\n<span class=\"service_data\" product_max_custom_quantity=''\n    product_min_custom_quantity='1'\n    product_steps_custom_quantity='1'\n    product_min_custom_size_width='3'\n    product_max_custom_size_width='10000'\n    product_steps_custom_size_width='1'\n    product_min_custom_size_height='3'\n    product_max_custom_size_height='155'\n    product_steps_custom_size_height='1'\n    style=\"display:none\"><\/span>\n\n\n<div class=\"mask-container\">\n    <div class=\"mask-row\">\n\n        <div class=\"mask-box\">\n            <div class=\"items-container-top one\">\n\n                <div class=\"mask-title\">\n                    <h2>W\u00e4hle die Form:<\/h2>\n                <\/div>\n                <div class=\"listing-items products\">\n\n                                                <div value=\"Rectangle\"\n                                class=\"item selected\"\n                                id_product=\"29766\" id=\"29766\">Blockout-Blachen Rechteckig<\/div>\n                                                        <div value=\"Rectangle\"\n                                class=\"item \"\n                                id_product=\"29764\" id=\"29764\">Blockout-Blachen Quadrat<\/div>\n                            \n                <\/div>\n                <div class=\"loading_inner\">\n                    <div class=\"loading\"><\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <div class=\"mask-box\">\n            <div class=\"items-container-top two\">\n                <div class=\"mask-title\">\n                    <h2>Gr\u00f6sse: <\/h2>\n                <\/div>\n                <div class=\"listing-items sizes\" id_product=\"29766\">\n                    \n                        <div class=\"item selected\"\n                            width=\"100\"\n                            height=\"55\">100 x 55 cm <\/div>\n\n                        \n                        <div class=\"item \"\n                            width=\"150\"\n                            height=\"55\">150 x 55 cm <\/div>\n\n                        \n                        <div class=\"item \"\n                            width=\"200\"\n                            height=\"55\">200 x 55 cm <\/div>\n\n                        \n                        <div class=\"item \"\n                            width=\"100\"\n                            height=\"85\">100 x 85 cm <\/div>\n\n                        \n                        <div class=\"item \"\n                            width=\"150\"\n                            height=\"85\">150 x 85 cm <\/div>\n\n                        \n                        <div class=\"item \"\n                            width=\"200\"\n                            height=\"85\">200 x 85 cm <\/div>\n\n                        \n                        <div class=\"item \"\n                            width=\"200\"\n                            height=\"100\">200 x 100 cm <\/div>\n\n                        \n                    <div class=\"item custom \" data-total=\"0\">\n                        Klicke f\u00fcr Dein eigenes Mass:\n                        <div class=\"customInputUnit\">\n                            <hr style=\"margin: 10px 0;\" \/>\n                            <div class=\"customsize\">\n                                <input type=\"number\" class=\"product_width\"\n                                    value='100'\n                                    min=\"3\"\n                                    max=\"10000\"\n                                    step=\"1\"> x <input type=\"number\"\n                                    class=\"product_height\" value='55'\n                                    min=\"3\"\n                                    max=\"155\"\n                                    step=\"1\"> cm\n                            <\/div>\n                        <\/div>\n                    <\/div>\n\n\n                <\/div>\n                <div class=\"loading_inner\">\n                    <div class=\"loading\"><\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <div class=\"mask-box\">\n            <div class=\"items-container-top three\">\n                <div class=\"mask-title\">\n                    <h2>Menge:<\/h2>\n                <\/div>\n                <div class=\"listing-items quantity\">\n                                                <div class=\"item selected\"\n                                product_quantity=\"1\">\n                                <div class=\"item_quantity\"> 1 Stk.<\/div>\n                                <div class=\"item_price\"> CHF 50.50<\/div>\n                            <\/div>\n                                                        <div class=\"item \"\n                                product_quantity=\"2\">\n                                <div class=\"item_quantity\"> 2 Stk.<\/div>\n                                <div class=\"item_price\"> CHF 71.05<\/div>\n                            <\/div>\n                                                        <div class=\"item \"\n                                product_quantity=\"3\">\n                                <div class=\"item_quantity\"> 3 Stk.<\/div>\n                                <div class=\"item_price\"> CHF 91.55<\/div>\n                            <\/div>\n                                                        <div class=\"item \"\n                                product_quantity=\"4\">\n                                <div class=\"item_quantity\"> 4 Stk.<\/div>\n                                <div class=\"item_price\"> CHF 112.10<\/div>\n                            <\/div>\n                                                        <div class=\"item \"\n                                product_quantity=\"5\">\n                                <div class=\"item_quantity\"> 5 Stk.<\/div>\n                                <div class=\"item_price\"> CHF 132.60<\/div>\n                            <\/div>\n                                                        <div class=\"item \"\n                                product_quantity=\"6\">\n                                <div class=\"item_quantity\"> 6 Stk.<\/div>\n                                <div class=\"item_price\"> CHF 153.10<\/div>\n                            <\/div>\n                                                        <div class=\"item \"\n                                product_quantity=\"8\">\n                                <div class=\"item_quantity\"> 8 Stk.<\/div>\n                                <div class=\"item_price\"> CHF 194.15<\/div>\n                            <\/div>\n                                                        <div class=\"item \"\n                                product_quantity=\"10\">\n                                <div class=\"item_quantity\"> 10 Stk.<\/div>\n                                <div class=\"item_price\"> CHF 235.20<\/div>\n                            <\/div>\n                                                <div class=\"item custom\">\n                        <div class=\"item_quantity\">\n                            <input type=\"number\" class=\"product_quantity\"\n                                max=\"\"\n                                min=\"1\"\n                                step=\"1\"\n                                value='1'>\n                        <\/div>\n                        <div class=\"item_price\"> CHF 50.50<\/div>\n                    <\/div>\n                <\/div>\n                <div class=\"loading_inner\">\n                    <div class=\"loading\"><\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <div class=\"mask-box\">\n            <div class=\"items-container-top four\">\n                <div class=\"mask-title\">\n                    <h2>Let's go !? <\/h2>\n                <\/div>\n                <div class=\"listing-items\">\n                    <div class=\"note-text\">Standard-\u00d6sung alle 50cm. Hast Du einen anderen Wunsch?<\/div><textarea class=\"customText\" name=\"customText\"><\/textarea>                <\/div>\n                <div class=\"button-wrap\">\n                    <a class=\"gotoProduct_a\"><button class=\"mask-forward gotoProduct\">Jetzt designen<\/button><\/a>\n                    <span class=\"or-upload-text\">oder Druck-Datei hochladen: PDF, AI oder PSD - max. 30Mb.<\/span>\n                    \n    <button class=\"mask-forward uploadFile\" id=\"open-vp-file-modal\">Datei hochladen\n        <svg version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\" x=\"0px\" y=\"0px\"\n            viewBox=\"0 0 1000 1000\" enable-background=\"new 0 0 1000 1000\" xml:space=\"preserve\">\n            <g>\n                <path\n                    d=\"M850,974.5H150c-77.3,0-140-65.3-140-145.9V646.3c0-20.1,15.7-36.5,35-36.5h70c19.3,0,35,16.3,35,36.5v109.4c0,40.3,31.3,72.9,70,72.9h560c38.7,0,70-32.7,70-72.9V646.3c0-20.1,15.7-36.5,35-36.5h70c19.3,0,35,16.3,35,36.5v182.3C990,909.2,927.3,974.5,850,974.5L850,974.5z M784.5,449.2c-14.2,14.8-37.1,14.8-51.3,0L570,279.1v367.2c0,20.1-15.7,36.5-35,36.5h-70c-19.3,0-35-16.3-35-36.5V279.1L266.8,449.2c-14.2,14.8-37.1,14.8-51.3,0l-51.3-53.4c-14.2-14.8-14.2-38.7,0-53.4L453.2,41.1c1.2-1.3,23.7-15.6,46.4-15.6c22.9,0,45.9,14.3,47.2,15.6l289.1,301.2c14.2,14.8,14.2,38.7,0,53.4L784.5,449.2L784.5,449.2z\">\n                <\/path>\n            <\/g>\n        <\/svg>\n    <\/button>\n\n    <div class=\"file_uploaded-control\">\n        <p class=\"text\">Datei <span>dummy.pdf<\/span> wurde hochgeladen.<\/p>\n        <span class=\"file_uploaded-control-close\">x<\/span>\n    <\/div>\n\n    <button class=\"file_create_product\" data-file-id=\"\"> zum Warenkorb hinzuf\u00fcgen<\/button>\n\n\n\n\n    <div id=\"vp-file-modal\" class=\"vp-file-modal\">\n        <div class=\"vp-file-modal-content\">\n            <!-- <span class=\"close\">&times;<\/span> -->\n            <div class=\"vp-file-modal-body\">\n                <div class=\"input-inner\">\n                    <input class=\"file-upload\" type=\"file\" accept=\".ai,.pdf,.psd\">\n                    <div class=\"description\">\n                        <svg version=\"1.1\" id=\"uploadIcon\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n                            xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 512.056 512.056\"\n                            style=\"enable-background:new 0 0 512.056 512.056;\" xml:space=\"preserve\" fill=\"#777\">\n                            <g>\n                                <g>\n                                    <g>\n                                        <path d=\"M426.635,188.224C402.969,93.946,307.358,36.704,213.08,60.37C139.404,78.865,85.907,142.542,80.395,218.303\n                                        C28.082,226.93-7.333,276.331,1.294,328.644c7.669,46.507,47.967,80.566,95.101,80.379h80v-32h-80c-35.346,0-64-28.654-64-64\n                                        c0-35.346,28.654-64,64-64c8.837,0,16-7.163,16-16c-0.08-79.529,64.327-144.065,143.856-144.144\n                                        c68.844-0.069,128.107,48.601,141.424,116.144c1.315,6.744,6.788,11.896,13.6,12.8c43.742,6.229,74.151,46.738,67.923,90.479\n                                        c-5.593,39.278-39.129,68.523-78.803,68.721h-64v32h64c61.856-0.187,111.848-50.483,111.66-112.339\n                                        C511.899,245.194,476.655,200.443,426.635,188.224z\"><\/path>\n                                        <path d=\"M245.035,253.664l-64,64l22.56,22.56l36.8-36.64v153.44h32v-153.44l36.64,36.64l22.56-22.56l-64-64\n                                        C261.354,247.46,251.276,247.46,245.035,253.664z\"><\/path>\n                                    <\/g>\n                                <\/g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                            <g>\n                            <\/g>\n                        <\/svg>\n                        <p>\n                            Hier klicken oder Datei ins Feld ziehen (Drag & Drop)\n                        <\/p>\n                    <\/div>\n                <\/div>\n                <div class=\"input-description\">\n                    <p class=\"title\">Bitte beachte:<\/p>\n                    <p class=\"text\">Beim Upload wird keine Produktvorschau generiert. Solltest Du trotzdem eine Vorschau\n                        w\u00fcnschen, kannst Du im Warenkorb ein Gut zum Druck bestellen.<\/p>\n                <\/div>\n                <div class=\"modal-loading\">\n                    <div class=\"lds-ring\">\n                        <div><\/div>\n                        <div><\/div>\n                        <div><\/div>\n                        <div><\/div>\n                    <\/div>\n                <\/div>\n\n            <\/div>\n\n        <\/div>\n    <\/div>\n\n    <style>\n        \/* Modal container *\/\n        .vp-file-modal {\n            display: none;\n            \/* Hidden by default *\/\n            position: fixed;\n            z-index: 1000;\n            left: 0;\n            top: 0;\n            width: 100%;\n            height: 100%;\n            overflow: auto;\n            background-color: rgba(0, 0, 0, 0.5);\n            \/* Black with transparency *\/\n        }\n\n        \/* Modal content *\/\n        .vp-file-modal-content {\n            background-color: #fff;\n            margin: 15% auto;\n            \/* Centered vertically and horizontally *\/\n            padding: 20px;\n            \/* border-radius: 8px; *\/\n            width: 80%;\n            max-width: 500px;\n            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n            position: relative;\n        }\n\n        .vp-file-modal-content:before {\n            content: \"\";\n            position: absolute;\n            top: 0;\n            left: 0;\n            width: 100%;\n            height: 100%;\n            background-color: rgba(0, 0, 0, 0.6);\n            z-index: -1;\n\n        }\n\n        .vp-file-modal-content.vp-loading:before {\n            z-index: 1;\n        }\n\n        .vp-file-modal-body {\n            position: relative;\n        }\n\n        .input-inner {\n            height: 25vh;\n            overflow: hidden !important;\n        }\n\n        .input-inner svg {\n            width: 80px;\n            max-width: 100%;\n            height: auto;\n            color: #777;\n        }\n\n        .input-inner input {\n            opacity: 0;\n            position: absolute;\n            z-index: 2;\n            width: 100%;\n            height: inherit;\n            cursor: pointer;\n        }\n\n        .input-inner input[type=file]::file-selector-button {\n            visibility: hidden;\n        }\n\n        .input-inner input[type=file]::-webkit-file-upload-button {\n            visibility: hidden;\n        }\n\n\n        .input-inner .description {\n            height: inherit;\n            width: 100%;\n            position: absolute;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            flex-direction: column;\n            border: 2px dashed #eee;\n        }\n\n        .input-inner:hover .description {\n            border-color: #1a84d2;\n        }\n\n        .input-description .title {\n            font-weight: 700;\n            color: #777;\n            margin-bottom: 0px;\n        }\n\n        .input-description .text {\n            font-weight: 400;\n            color: #777;\n            margin-top: 0px;\n            line-height: 1.23;\n            margin-bottom: 0px;\n        }\n\n        .input-inner .description p {\n            color: #777;\n        }\n\n        \/* Close button *\/\n        .vp-close {\n            position: absolute;\n            top: 10px;\n            right: 20px;\n            font-size: 24px;\n            font-weight: bold;\n            color: #aaa;\n            cursor: pointer;\n        }\n\n        .vp-close:hover {\n            color: #000;\n        }\n\n        .file_create_product {\n            width: 100%;\n            background: #d00937;\n            padding: 15px;\n            border: none;\n            color: #fff;\n            font-size: 16px;\n            -webkit-transition: all 0.3s;\n            -moz-transition: all 0.3s;\n            -ms-transition: all 0.3s;\n            -o-transition: all 0.3s;\n            transition: all 0.3s;\n            display: none;\n            cursor: pointer;\n        }\n\n        .file_uploaded-control {\n            display: none;\n            position: relative;\n            padding: 20px;\n            border: 1px solid #ddd;\n            position: relative;\n        }\n\n        .file_uploaded-control .file_uploaded-control-close {\n            position: absolute;\n            right: 12px;\n            top: 6px;\n            color: #777;\n            cursor: pointer;\n        }\n\n        .file_uploaded-control .file_uploaded-control-close:hover {\n            color: #776;\n        }\n\n        .file_uploaded-control .text {\n            margin: 0px;\n            line-height: 1.23;\n            color: #777;\n        }\n\n        .file_uploaded-control .text span {\n            font-weight: 700;\n        }\n\n        .modal-loading {\n            position: absolute;\n            top: 0;\n            left: 0;\n            width: 100%;\n            height: 100%;\n            \/* background-color: rgba(0, 0, 0, 0.5); *\/\n            \/* Semi-transparent black *\/\n            z-index: 999;\n            \/* Make sure it's above other modal content *\/\n            display: none;\n        }\n\n        .lds-ring {\n            \/* change color here *\/\n            color: #08c\n        }\n\n        .lds-ring,\n        .lds-ring div {\n            box-sizing: border-box;\n        }\n\n        .lds-ring {\n            display: inline-block;\n            position: relative;\n            width: 80px;\n            height: 80px;\n            position: absolute;\n            position: absolute;\n            top: 50%;\n            left: 50%;\n            transform: translate(-50%, -50%);\n        }\n\n        .lds-ring div {\n            box-sizing: border-box;\n            display: block;\n            position: absolute;\n            width: 64px;\n            height: 64px;\n            margin: 8px;\n            border: 8px solid currentColor;\n            border-radius: 50%;\n            animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n            border-color: currentColor transparent transparent transparent;\n        }\n\n        .lds-ring div:nth-child(1) {\n            animation-delay: -0.45s;\n        }\n\n        .lds-ring div:nth-child(2) {\n            animation-delay: -0.3s;\n        }\n\n        .lds-ring div:nth-child(3) {\n            animation-delay: -0.15s;\n        }\n\n        @keyframes lds-ring {\n            0% {\n                transform: rotate(0deg);\n            }\n\n            100% {\n                transform: rotate(360deg);\n            }\n        }\n    <\/style>\n\n    <script>\n        document.addEventListener('DOMContentLoaded', function () {\n            \/\/ Get elements\n            const modal = document.getElementById('vp-file-modal');\n            const openModalBtn = document.getElementById('open-vp-file-modal');\n            \/\/ const closeModalBtn = document.querySelector('.vp-close');\n\n            \/\/ Open modal\n            openModalBtn.addEventListener('click', () => {\n                modal.style.display = 'block';\n            });\n\n            \/\/ Close modal when the \"x\" is clicked\n            \/\/ closeModalBtn.addEventListener('click', () => {\n            \/\/     modal.style.display = 'none';\n            \/\/ });\n\n            \/\/ Close modal when clicking outside the modal content\n            window.addEventListener('click', (event) => {\n                if (event.target === modal) {\n                    modal.style.display = 'none';\n                }\n            });\n            jQuery(\"#vp-file-modal .file-upload\").on(\"change\", function () {\n                const file = this.files[0];\n                if (!file) return;\n\n                \/\/ Validate file type\n                const allowedFormats = ['ai', 'pdf', 'psd'];\n                const fileExtension = file.name.split('.').pop().toLowerCase();\n                if (!allowedFormats.includes(fileExtension)) {\n                    alert(\"PDF, AI und PSD Dateien sind erlaubt. JPG, PNG, etc. bitte \u00fcber den Designer hochladen.\");\n                    jQuery(this).val(\"\");\n                    return;\n                }\n\n                jQuery(\".modal-loading\").show();\n                jQuery(\".vp-file-modal-content\").addClass(\"vp-loading\");\n\n                const formData = new FormData();\n                formData.append(\"action\", \"modal_media_upload\");\n                formData.append(\"media_file\", file);\n\n                jQuery.ajax({\n                    url: \"https:\/\/druckereisaas.ch\/wp-admin\/admin-ajax.php\",\n                    type: \"POST\",\n                    data: formData,\n                    processData: false,\n                    contentType: false,\n                    success: function (response) {\n                        \/\/ jQuery(\".loading-spinner\").hide();\n                        jQuery(\".modal-loading\").hide();\n                        jQuery(\".vp-file-modal-content\").removeClass(\"vp-loading\");\n                        if (response.success) {\n                            \/\/ alert(\"Media uploaded successfully!\");\n                            const fileUrl = response.data.url;\n                            const fileId = response.data.id;\n                            const fileName = response.data.name;\n                            console.log(\"Media URL:\", fileUrl);\n                            console.log(\"File ID:\", fileId);\n                            console.log(\"File fileName:\", fileName);\n\n                            \/\/ close upload modal\n                            let uploadModal = jQuery(\"#vp-file-modal\")\n                            uploadModal.hide();\n\n                            jQuery(\".file_create_product\").attr(\"data-file-id\", fileId);\n                            jQuery(\".mask-container .button-wrap .gotoProduct_a\").hide()\n                            jQuery(\".mask-container .button-wrap .or-upload-text\").hide()\n                            jQuery(\".mask-container .button-wrap .uploadFile\").hide()\n                            jQuery(\".file_create_product\").show()\n                            jQuery(\".file_uploaded-control\").show()\n                            jQuery(\".file_uploaded-control .text span\").html(fileName)\n\n                            \/\/ Attach the image ID to the Create Product button\n                            \/\/ $(\"#create-product-button\").attr(\"data-image-id\", imageId);\n                            \/\/ $(\"#create-product-button\").removeAttr(\"disabled\"); \/\/ Enable the button\n                        } else {\n                            alert(\"Upload fehlgeschlagen: \" + response.data);\n                        }\n                    },\n                    error: function (xhr, status, error) {\n                        alert(\"Upload fehlgeschlagen: \" + error);\n                        console.error(xhr.responseText);\n                    },\n                });\n            });\n            jQuery(\".file_uploaded-control-close\").click(function () {\n                jQuery(\".mask-container .button-wrap .gotoProduct_a\").show()\n                jQuery(\".mask-container .button-wrap .or-upload-text\").show()\n                jQuery(\".mask-container .button-wrap .uploadFile\").show()\n                jQuery(\".file_create_product\").hide()\n                jQuery(\".file_uploaded-control\").hide()\n                jQuery(\"#vp-file-modal .file-upload\").val('')\n            });\n            \/\/ Handle Create Product button click\n            jQuery(\".file_create_product\").click(function () {\n                const fileId = jQuery(this).data(\"file-id\"); \/\/ Get attached image ID\n                const productId = jQuery('.listing-items.products .item.selected').attr(\"id\"); \/\/ Hardcoded product ID\n\n                if (!fileId) {\n                    alert(\"No file uploaded. Please upload (.ai, .pdf, .psd, .png) first.\");\n                    return;\n                }\n\n                const data = {\n                    action: \"create_product_in_cart\",\n                    product_id: productId,\n                    file_id: fileId,\n                };\n\n                console.log('create-product-button data:', data)\n\n                jQuery.ajax({\n                    url: \"https:\/\/druckereisaas.ch\/wp-admin\/admin-ajax.php\",\n                    type: \"POST\",\n                    data: data,\n                    success: function (response) {\n                        if (response.success) {\n                            \/\/ alert(response.data.message);\n                            window.location.href = response.data.cart_url; \/\/ Redirect to the cart page\n                        } else {\n                            alert(\"Error: \" + response.data);\n                        }\n                    },\n                    error: function (xhr, status, error) {\n                        alert(\"Failed to add product: \" + error);\n                        console.error(xhr.responseText);\n                    },\n                });\n            });\n        });\n    <\/script>\n                    <\/div>\n\n                <div class=\"loading_inner\">\n                    <div class=\"loading\"><\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n    <\/div>\n<\/div>\n<script>\n    jQuery(document).ready(function ($) {\n        \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 .item.product \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b\n        urlGenerate()\n        console.log('tyt');\n\n        function urlGenerate() {\n\n            setTimeout(function () {\n                var id = $(\".products .item.selected\").attr(\"id\");\n\n                var value = $(\".products .item.selected\").attr(\"value\");\n                const inputCustom = (value === 'Rectangle') ? 1 : 0;\n\n                document.cookie = `inputCustomCurrent=${inputCustom}; path=\/`;\n\n\n                var selectedItem = $('.sizes .selected');\n                var unit = [];\n                unit[0] = selectedItem.attr('width');\n                unit[1] = selectedItem.attr('height');\n\n                document.cookie = `width_custom=${unit[0]}; path=\/`;\n                document.cookie = `height_custom=${unit[1]}; path=\/`;\n                document.cookie = `id_product=${id}; path=\/`;\n\n                let klebstoff = $('input[name=\"klebstoff\"]:checked').val();\n                let material = $('input[name=\"material\"]:checked').val();\n                let zuschnitt = $('input[name=\"zuschnitt\"]:checked').val();\n                let note = jQuery('textarea[name=\"customText\"]').val();\n                let mask = jQuery('.id_mask').val();\n\n                if (mask === undefined) {\n                    document.cookie = `mask=; path=\/`;\n                } else {\n                    document.cookie = `mask=${mask}; path=\/`;\n                }\n\n                if (klebstoff === undefined) {\n                    document.cookie = `klebstoff=; path=\/`;\n                } else {\n                    document.cookie = `klebstoff=${klebstoff}; path=\/`;\n                }\n\n                if (material === undefined) {\n                    document.cookie = `material=; path=\/`;\n                } else {\n                    document.cookie = `material=${material}; path=\/`;\n                }\n\n                if (zuschnitt === undefined) {\n                    document.cookie = `zuschnitt=; path=\/`;\n                } else {\n                    document.cookie = `zuschnitt=${zuschnitt}; path=\/`;\n                }\n\n                if (note === undefined) {\n                    document.cookie = `note=; path=\/`;\n                } else {\n                    document.cookie = `note=${note}; path=\/`;\n                }\n\n\n                var inputCustomQuantity = $('.quantity .custom .product_quantity').val();\n                var inputCustomCost = $('.quantity .selected .item_price').text();\n                let numericText = inputCustomCost.replace(\/[^\\d.]\/g, '');\n\n\n                document.cookie = `inputCustomQuantity=${inputCustomQuantity}; path=\/`;\n                document.cookie = `inputCustomCost=${numericText}; path=\/`;\n\n\n                function getRandomCik(length) {\n                    const characters = '0123456789';\n                    let result = '';\n                    for (let i = 0; i < length; i++) {\n                        result += characters.charAt(Math.floor(Math.random() * characters.length));\n                    }\n                    return result;\n                }\n\n                \/\/ \u041e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438\n                let params = {\n                    'product_id': id,\n                    'cik': getRandomCik(13),\n                };\n\n                \/\/ \u0411\u0430\u0437\u043e\u0432\u044b\u0439 URL\n                let mainUrlValue = \"\/create-your-own\/\";\n\n                \/\/ \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432\n                let queryString = new URLSearchParams(params).toString();\n\n                \/\/ \u041f\u043e\u043b\u043d\u044b\u0439 URL \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438\n                mainUrlValue += '?' + queryString;\n                function updateProductPrice() {\n                    $.ajax({\n                        url: '\/wp-admin\/admin-ajax.php', \/\/ The WordPress AJAX URL\n                        type: 'POST',\n                        data: {\n                            action: 'test_update_product_price',\n                        },\n                        success: function (response) {\n                            console.log('AJAX success:');\n\n                        },\n                        error: function (xhr, status, error) {\n                            console.error('AJAX error:', status, error);\n                        }\n                    });\n                }\n                updateProductPrice();\n\n                \/\/ \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f href\n                $('.gotoProduct_a').attr('href', mainUrlValue);\n\n            }, 1000)\n        }\n    })\n\n<\/script>\n<script>\n    jQuery(document).ready(function ($) {\n        \/\/ urlGenerateFile();\n        \/\/ \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c urlGenerate \u043f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043d\u0430 .mask-forward.uploadFile\n        $('.mask-forward.uploadFile').on('click', function () {\n            \/\/ urlGenerateFile();\n            console.log('\u0433\u043e \u043a\u043b\u0438\u043a');\n\n        });\n\n        function urlGenerateFile() {\n            console.log('\u0433\u043e 2');\n\n            setTimeout(function () {\n                var id = $(\".products .item.selected\").attr(\"id\");\n                var valueFile = $(\".products .item.selected\").attr(\"value\");\n                var selectedItem = $('.sizes .selected');\n                var unit = [];\n                unit[0] = selectedItem.attr('width');\n                unit[1] = selectedItem.attr('height');\n                var inputCustomQuantityFile = $('.quantity .custom .product_quantity').val();\n                var inputCustomCostFile = $('.quantity .selected .item_price').text();\n                let numericTextFile = inputCustomCostFile.replace(\/[^\\d.]\/g, '');\n                let sizeFile = unit[0] + ' x ' + unit[1];\n                let inputFile = $('input[name=\"klebstoff\"]:checked').val();\n                let inputFile2 = $('input[name=\"material\"]:checked').val();\n                let inputFile3 = $('input[name=\"zuschnitt\"]:checked').val();\n\n                $.ajax({\n                    url: '\/wp-admin\/admin-ajax.php', \/\/ The WordPress AJAX URL\n                    type: 'POST',\n                    data: {\n                        action: 'test_update_product_price_file',\n                        klebstoff: inputFile,\n                        material: inputFile2,\n                        zuschnitt: inputFile3,\n                        valueFile: valueFile,\n                        inputCustomQuantityFile: inputCustomQuantityFile,\n                        numericTextFile: numericTextFile,\n                        sizeFile: sizeFile,\n                    },\n                    success: function (response) {\n                        console.log('AJAX success:');\n\n                    },\n                    error: function (xhr, status, error) {\n                        console.error('AJAX error:', status, error);\n                    }\n                });\n\n\n            }, 1000)\n        }\n    })\n\n<\/script>\n<script src=\"\/wp-content\/themes\/MySticker-Design\/mask\/script.js\"><\/script>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":8,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"mask-template.php","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","footnotes":""},"class_list":["post-29670","page","type-page","status-publish"],"acf":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false},"uagb_author_info":{"display_name":"ad-min-mys","author_link":"https:\/\/druckereisaas.ch\/fr\/author\/ad-min-mys\/"},"uagb_comment_info":0,"uagb_excerpt":null,"_links":{"self":[{"href":"https:\/\/druckereisaas.ch\/fr\/wp-json\/wp\/v2\/pages\/29670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/druckereisaas.ch\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/druckereisaas.ch\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/druckereisaas.ch\/fr\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/druckereisaas.ch\/fr\/wp-json\/wp\/v2\/comments?post=29670"}],"version-history":[{"count":5,"href":"https:\/\/druckereisaas.ch\/fr\/wp-json\/wp\/v2\/pages\/29670\/revisions"}],"predecessor-version":[{"id":31064,"href":"https:\/\/druckereisaas.ch\/fr\/wp-json\/wp\/v2\/pages\/29670\/revisions\/31064"}],"wp:attachment":[{"href":"https:\/\/druckereisaas.ch\/fr\/wp-json\/wp\/v2\/media?parent=29670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}