{"id":3049,"date":"2022-04-05T09:13:09","date_gmt":"2022-04-05T09:13:09","guid":{"rendered":"https:\/\/34.241.33.110\/cart\/"},"modified":"2024-10-28T11:50:45","modified_gmt":"2024-10-28T11:50:45","slug":"cart-2","status":"publish","type":"page","link":"https:\/\/filotrack.com\/it\/cart-2\/","title":{"rendered":"Cart"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"3049\" class=\"elementor elementor-3049 elementor-1764\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-d4d88bb default-cart elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d4d88bb\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3aed1fb7\" data-id=\"3aed1fb7\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-21c686ac elementor-widget elementor-widget-heading\" data-id=\"21c686ac\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Il tuo carrello<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-35d08d47 elementor-widget elementor-widget-html\" data-id=\"35d08d47\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.6.0\/jquery.min.js\"><\/script><script>\/*\n    \/*if(document.referrer.includes('getmytata.com')){\n        $.get('\/wp\/?post_type=product&add-to-cart=4128', function(){\n            console.log('added')\n        })\n       \n\t}\n\t \/\/CART EMPTY\n        const cartEmpty = () => {\n            const cart_empty = document.querySelector('p.cart-empty')\n            let result = 'empty'\n            if (cart_empty) {\n                const return_msg = document.createElement('a')\n                const link = document.documentElement.lang.substring(0, 2) === 'en' ? '\/product\/filo-tag' : '\/' + document.documentElement.lang.substring(0, 2) + '\/product\/filo-tag'\n                return_msg.href = link\n                const return_msg_txt = {\n                    'it-IT': ' Continua lo shopping',\n                    'es-ES': ' Seguir comprando',\n                    'de-DE': ' Weiter einkaufen'\n                }\n\t\t\t\tconst lang_availables = ['it-IT', 'es-ES', 'de-DE']\n\t\t\t\t\n                if(lang_availables.includes(document.documentElement.lang)){\n                    return_msg.innerText = return_msg_txt[document.documentElement.lang]\n                } else {\n                    return_msg.innerText = ' Return to shopping'\n                }\n                const cart_item_number = document.querySelector('#cart-item-number')\n                cart_item_number.style.display = 'none'\n                cart_empty.appendChild(return_msg)\n                localStorage.removeItem('cartFill')\n            } else {\n                const items = document.querySelectorAll('.woocommerce-cart-form__cart-item.cart_item')\n                const cart_item_number = document.querySelector('#cart-item-number')\n                let quantity = 0\n                items.forEach(item => {\n                    const quantity_html = item.querySelector('td.product-quantity .quantity input')\n                    \n                    quantity = quantity + parseInt(quantity_html.value) \n                })\n                if(quantity !== 0){\n                    localStorage.setItem('cartFill', quantity)\n                    cart_item_number.innerText = quantity\n                } else{\n                    localStorage.removeItem('cartFill')\n                    cart_item_number.style.display = 'none'\n                }\n                \n                result = 'filled'\n            }\n            return result\n        }\n\n        \/\/ CART TABLE HEAD\n        const tableHeadRewrite = () => {\n\n            const table_head = document.querySelector('form.woocommerce-cart-form table thead tr')\n\n            const head_remove = table_head.querySelector('.product-remove')\n            const head_thumbnail = table_head.querySelector('.product-thumbnail')\n            const head_name = table_head.querySelector('.product-name')\n            const head_price = table_head.querySelector('.product-price')\n            const head_quantity = table_head.querySelector('.product-quantity')\n            const head_subtotal = table_head.querySelector('.product-subtotal')\n\n            head_thumbnail.innerText = 'Product'\n            head_name.innerText = ''\n\n            table_head.innerHTML = \"\"\n            table_head.appendChild(head_thumbnail)\n            table_head.appendChild(head_name)\n            table_head.appendChild(head_price)\n            table_head.appendChild(head_quantity)\n            table_head.appendChild(head_subtotal)\n            table_head.appendChild(head_remove)\n        }\n\n        \/\/BODY\n        const tableBodyRewrite = () => {\n\n            const table_body = document.querySelectorAll(\n                'form.woocommerce-cart-form table tbody tr.woocommerce-cart-form__cart-item.cart_item')\n\n            table_body.forEach(tr => {\n                const body_remove = tr.querySelector('.product-remove')\n                const body_thumbnail = tr.querySelector('.product-thumbnail')\n                const body_name = tr.querySelector('.product-name')\n                const title_product = body_name.querySelector('a')\n                const body_price = tr.querySelector('.product-price')\n                const body_quantity = tr.querySelector('.product-quantity')\n                const body_subtotal = tr.querySelector('.product-subtotal')\n\n                if (title_product.href.includes('\/product\/filo-tag')) {\n                    const title = document.createElement('p')\n                    title.innerText = 'Filo Tag - Bluetooth Tracker'\n                    title.classList.add('title-product-cart')\n                    title_product.prepend(title)\n                }\n\n                tr.innerHTML = \"\"\n                tr.appendChild(body_thumbnail)\n                tr.appendChild(body_name)\n                tr.appendChild(body_price)\n                tr.appendChild(body_quantity)\n                tr.appendChild(body_subtotal)\n                tr.appendChild(body_remove)\n\n            })\n        }\n\n        \/\/ACTIONS\n        const tableActionsRewrite = () => {\n            const action_row = document.querySelector(\n                'form.woocommerce-cart-form table tbody tr:nth-last-of-type(1) td')\n            const checkout_container = document.querySelector('.wc-proceed-to-checkout')\n            const checkout_btn = checkout_container.querySelector('a.checkout-button')\n            const coupon = action_row.querySelector('.coupon')\n            const shop_total = document.querySelector('table.shop_table tbody tr.cart-subtotal td span')\n            const update_btn = action_row.querySelector('button[value=\"Update cart\"]')\n            const total_price = document.createElement('div')\n            total_price.classList.add('total-price-container')\n            const action_btns = document.createElement('div')\n            action_btns.classList.add('action-btns')\n            const container = document.createElement('div')\n            container.classList.add('total-row')\n            const total_text = document.createElement('p')\n            total_text.classList.add('total-text')\n\n\n            total_text.innerText = 'Total'\n            checkout_btn.innerText = \"Checkout\"\n            total_price.appendChild(total_text)\n            total_price.appendChild(shop_total)\n\n            action_btns.appendChild(checkout_container)\n            action_btns.appendChild(update_btn)\n\n            container.appendChild(action_btns)\n            container.appendChild(total_price)\n\n            action_row.removeChild(coupon)\n            action_row.prepend(container)\n        }\n        const form = document.querySelector('form.woocommerce-cart-form')\n        $(document).ajaxStart(function () {\n            if (form) {\n                form.style.opacity = '0.1'\n            }\n        })\n        $(document).ajaxStop(function () {\n            \n\n            let result_cart = cartEmpty()\n            if (form) {\n                form.style.opacity = '0.1'\n                tableHeadRewrite()\n                tableBodyRewrite()\n                tableActionsRewrite()\n                setTimeout(() => form.style.opacity = '1', 1000)\n            }\n\n        })\n        $(window).load(function () {\n            let result_cart = cartEmpty()\n            if (form) {\n                form.style.opacity = '0.1'\n                tableHeadRewrite()\n                tableBodyRewrite()\n                tableActionsRewrite()\n                setTimeout(() => form.style.opacity = '1', 1000)\n            }\n\n        })\n\t\t*\/\n    <\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-55137a7 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"55137a7\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-no\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-dbbcfce\" data-id=\"dbbcfce\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-01cbb48 elementor-widget elementor-widget-html\" data-id=\"01cbb48\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h1 class=\"cart-page-title\"><\/h1>\r\n<div class=\"loader\" style=\"width: 100%; position: absolute; top: 0; left: 0; display: none; justify-content: center; align-items: center; height: 100%; background-color: rgba(255, 255, 255, 0.1); backdrop-filter: blur(20px); z-index: 10;\">\r\n    <div class=\"icon-container\" style=\"width: 40px\">\r\n        <img decoding=\"async\" src=\"https:\/\/filotrack.com\/wp-content\/uploads\/spinner.gif\"\/>\r\n    <\/div> \r\n<\/div>\r\n    <div class=\"no-product\">\r\n      <p class=\"no-product-label\"><\/p>\r\n      <a class=\"back-to-shopping-label\"><\/a>\r\n    <\/div>\r\n\r\n    <div class=\"cart-container\">\r\n      <div class=\"cart-table\">\r\n        <div class=\"cart-row cart-row-headers\">\r\n          <div class=\"row-cell header-cell header-img\"><\/div>\r\n          <div class=\"row-cell header-cell header-product\"><\/div>\r\n          <div class=\"row-cell header-cell header-price\"><\/div>\r\n          <div class=\"row-cell header-cell header-quantity\"><\/div>\r\n          <div class=\"row-cell header-cell header-subtotal\"><\/div>\r\n          <div class=\"row-cell header-cell header-remove\"><\/div>\r\n        <\/div>\r\n        <div class=\"list-product\"><\/div>\r\n      <\/div>\r\n      <div class=\"cart-actions\">\r\n        <div class=\"actions\">\r\n          <button class=\"cart-btn checkout-btn\"><\/button>\r\n          <button class=\"cart-btn update-btn\"><\/button>\r\n        <\/div>\r\n        <div class=\"total-container\">\r\n          <p class=\"total-label\"><\/p>\r\n          <p class=\"total-value\"><\/p>\r\n        <\/div>\r\n      <\/div>\r\n    <\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Il tuo carrello<\/p>\n","protected":false},"author":10,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"inline_featured_image":false,"footnotes":""},"class_list":["post-3049","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/filotrack.com\/it\/wp-json\/wp\/v2\/pages\/3049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/filotrack.com\/it\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/filotrack.com\/it\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/filotrack.com\/it\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/filotrack.com\/it\/wp-json\/wp\/v2\/comments?post=3049"}],"version-history":[{"count":59,"href":"https:\/\/filotrack.com\/it\/wp-json\/wp\/v2\/pages\/3049\/revisions"}],"predecessor-version":[{"id":11964,"href":"https:\/\/filotrack.com\/it\/wp-json\/wp\/v2\/pages\/3049\/revisions\/11964"}],"wp:attachment":[{"href":"https:\/\/filotrack.com\/it\/wp-json\/wp\/v2\/media?parent=3049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}