{"id":57506,"date":"2026-03-30T14:53:00","date_gmt":"2026-03-30T18:53:00","guid":{"rendered":"https:\/\/allparts.expert\/?page_id=57506"},"modified":"2026-03-31T12:54:09","modified_gmt":"2026-03-31T16:54:09","slug":"request-quote","status":"publish","type":"page","link":"https:\/\/allparts.expert\/es\/request-quote\/","title":{"rendered":"Request a Quote"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"57506\" class=\"elementor elementor-57506\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e47c110 e-flex e-con-boxed e-con e-parent\" data-id=\"e47c110\" data-element_type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-c3e74d9 elementor-widget elementor-widget-html\" data-id=\"c3e74d9\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<div class=\"custom-quote-wrapper\" id=\"quote-page\">\r\n    <div class=\"quote-header\">\r\n        <h1>Request a Quote<\/h1>\r\n        <p>Fill out the form below and our parts specialists will get back to you within 24 hours with pricing and availability.<\/p>\r\n    <\/div>\r\n\r\n    <div class=\"quote-list-container\">\r\n        <div class=\"quote-list-header\">\r\n            <h3>Quote List (<span class=\"quote-count-display\">0<\/span> items)<\/h3>\r\n            <button class=\"btn-clear-all\" id=\"btn-clear-quote\" style=\"display:none;\">Clear all<\/button>\r\n        <\/div>\r\n        \r\n        <div id=\"quote-items-wrapper\">\r\n            <p style=\"padding: 20px; text-align: center; color: #666;\">Loading your items...<\/p>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <div id=\"quote-form-container\" style=\"display:none\">\r\n        <form id=\"quote-request-form\" class=\"quote-form\">\r\n            <div class=\"form-grid\">\r\n                <div class=\"form-group\">\r\n                    <label>Name *<\/label>\r\n                    <input type=\"text\" id=\"quote-name\" required>\r\n                <\/div>\r\n                <div class=\"form-group\">\r\n                    <label>Email *<\/label>\r\n                    <input type=\"email\" id=\"quote-email\" required>\r\n                <\/div>\r\n                <div class=\"form-group\">\r\n                    <label>Phone \/ WhatsApp *<\/label>\r\n                    <input type=\"tel\" id=\"quote-phone\" required>\r\n                <\/div>\r\n                <div class=\"form-group\">\r\n                    <label>Country<\/label>\r\n                    <select id=\"quote-country\">\r\n                        <option value=\"United States\">United States<\/option>\r\n                        <option value=\"Colombia\">Colombia<\/option>\r\n                        <option value=\"Mexico\">Mexico<\/option>\r\n                        <option value=\"Other\">Other<\/option>\r\n                    <\/select>\r\n                <\/div>\r\n            <\/div>\r\n\r\n            <div class=\"form-group full-width\">\r\n                <label>Company (optional)<\/label>\r\n                <input type=\"text\" id=\"quote-company\">\r\n            <\/div>\r\n\r\n            <p class=\"form-note\">Your quote list above contains <span class=\"quote-count-display\">0<\/span> parts. You can also add notes or a file below.<\/p>\r\n\r\n            <div class=\"form-group full-width\">\r\n                <label>Notes \/ Urgency<\/label>\r\n                <textarea id=\"quote-message\" rows=\"4\" placeholder=\"Any special requirements, urgency, or additional parts needed...\"><\/textarea>\r\n            <\/div>\r\n\r\n            <div class=\"form-group full-width\" style=\"display:none;\">\r\n                <label>Upload File (optional)<\/label>\r\n                <div class=\"file-upload-area\">\r\n                    <span class=\"upload-icon\">\u2191<\/span>\r\n                    <p>Drop a photo or parts list here, or click to browse<\/p>\r\n                    <input type=\"file\" id=\"quote-file\" style=\"display: none;\">\r\n                <\/div>\r\n            <\/div>\r\n\r\n            <button type=\"submit\" id=\"send-quote-btn\" class=\"btn-submit-quote\">Submit Quote Request (<span class=\"quote-count-display\">0<\/span> parts)<\/button>\r\n            <div id=\"quote-response\" style=\"text-align: center; margin-top: 10px; font-weight: bold;\"><\/div>\r\n        <input type=\"hidden\" name=\"trp-form-language\" value=\"es\"\/><\/form>\r\n    <\/div>\r\n<\/div>\r\n\r\n<script>\r\nconst ajaxUrl = '\/wp-admin\/admin-ajax.php';\r\n\r\n\/\/ Cargar lista de productos con el nuevo dise\u00f1o\r\nfunction loadQuoteList() {\r\n    fetch(ajaxUrl + '?action=get_quote_list')\r\n    .then(r => r.json())\r\n    .then(data => {\r\n        const items = data.data.items;\r\n        const wrapper = document.getElementById('quote-items-wrapper');\r\n        const formContainer = document.getElementById('quote-form-container');\r\n        \r\n        \/\/ Actualizar todos los contadores en la vista\r\n        document.querySelectorAll('.quote-count-display').forEach(el => el.innerText = items.length);\r\n\r\n        if (items.length === 0) {\r\n            wrapper.innerHTML = '<p style=\"padding: 20px; text-align: center; color: #666;\">You have no items in your quote list.<\/p>';\r\n            formContainer.style.display = 'none';\r\n            return;\r\n        }\r\n\r\n        let html = '';\r\n        items.forEach(item => {\r\n            \/\/ Reemplazamos la tabla vieja por los divs del nuevo dise\u00f1o\r\n            html += `\r\n            <div class=\"quote-item\">\r\n                <div class=\"item-details\">\r\n                    <span class=\"item-sku\">${item.sku ? item.sku : 'N\/A'}<\/span>\r\n                    <span class=\"item-name\">${item.name}<\/span>\r\n                <\/div>\r\n                <div class=\"item-actions\">\r\n                    <div class=\"qty-selector\">\r\n                        <button type=\"button\" class=\"qty-btn minus\">-<\/button>\r\n                        <input type=\"number\" value=\"1\" min=\"1\" class=\"qty-input\">\r\n                        <button type=\"button\" class=\"qty-btn plus\">+<\/button>\r\n                    <\/div>\r\n                    <select class=\"condition-select\">\r\n                        <option>Any<\/option>\r\n                        <option>New<\/option>\r\n                        <option>Used<\/option>\r\n                    <\/select>\r\n                    <button type=\"button\" class=\"btn-remove-item\" onclick=\"removeItem(${item.id})\" title=\"Remove\">\u00d7<\/button>\r\n                <\/div>\r\n            <\/div>`;\r\n        });\r\n        \r\n        wrapper.innerHTML = html;\r\n        formContainer.style.display = 'block';\r\n    });\r\n}\r\n\r\n\/\/ Eliminar producto\r\nfunction removeItem(id) {\r\n    fetch(ajaxUrl, {\r\n        method: 'POST',\r\n        headers: {'Content-Type': 'application\/x-www-form-urlencoded'},\r\n        body: 'action=remove_from_quote&product_id=' + id\r\n    })\r\n    .then(r => r.json())\r\n    .then(() => {\r\n        loadQuoteList();\r\n        \/\/ Actualizar el contador global del header de la web si existe\r\n        const headerCounter = document.getElementById('quote-count');\r\n        if(headerCounter) {\r\n            let currentCount = parseInt(headerCounter.innerText);\r\n            headerCounter.innerText = Math.max(0, currentCount - 1);\r\n        }\r\n    });\r\n}\r\n\r\n\/\/ Enviar solicitud (Cambiado de 'click' a 'submit' para aprovechar validaci\u00f3n de HTML5)\r\ndocument.getElementById('quote-request-form').addEventListener('submit', function(e) {\r\n    e.preventDefault(); \/\/ Evita que la p\u00e1gina recargue\r\n\r\n    const name    = document.getElementById('quote-name').value;\r\n    const email   = document.getElementById('quote-email').value;\r\n    const phone   = document.getElementById('quote-phone').value;\r\n    const country = document.getElementById('quote-country').value;\r\n    const company = document.getElementById('quote-company').value;\r\n    const notes   = document.getElementById('quote-message').value;\r\n    \r\n    const submitBtn = document.getElementById('send-quote-btn');\r\n    submitBtn.innerText = 'Sending...';\r\n    submitBtn.disabled = true;\r\n\r\n    \/\/ Agrupamos Empresa y Pa\u00eds dentro del mensaje para que le llegue a tu PHP actual sin tener que modificarlo\r\n    const fullMessage = `Company: ${company}\\nCountry: ${country}\\n\\nNotes:\\n${notes}`;\r\n\r\n    fetch(ajaxUrl, {\r\n        method: 'POST',\r\n        headers: {'Content-Type': 'application\/x-www-form-urlencoded'},\r\n        body: `action=send_quote_email&name=${encodeURIComponent(name)}&email=${encodeURIComponent(email)}&phone=${encodeURIComponent(phone)}&message=${encodeURIComponent(fullMessage)}`\r\n    })\r\n    .then(r => r.json())\r\n    .then(data => {\r\n        if (data.success) {\r\n            document.getElementById('quote-page').innerHTML = `\r\n                <div style=\"text-align:center; padding: 50px 20px;\">\r\n                    <h2 style=\"color: #28a745;\">\u2705 Request sent successfully!<\/h2>\r\n                    <p>Our parts specialists will get back to you within 24 hours.<\/p>\r\n                <\/div>`;\r\n            \/\/ Vaciar el contador del header de la web si existe\r\n            const headerCounter = document.getElementById('quote-count');\r\n            if(headerCounter) headerCounter.innerText = '0';\r\n        } else {\r\n            document.getElementById('quote-response').innerHTML = '\u274c Error sending request. Please try again.';\r\n            document.getElementById('quote-response').style.color = 'red';\r\n            submitBtn.innerText = 'Submit Quote Request';\r\n            submitBtn.disabled = false;\r\n        }\r\n    })\r\n    .catch(() => {\r\n        document.getElementById('quote-response').innerHTML = '\u274c Connection error.';\r\n        submitBtn.innerText = 'Submit Quote Request';\r\n        submitBtn.disabled = false;\r\n    });\r\n});\r\n\r\n\/\/ Inicializar la carga al abrir la p\u00e1gina\r\ndocument.addEventListener(\"DOMContentLoaded\", loadQuoteList);\r\n<\/script>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Request a Quote Fill out the form below and our parts specialists will get back to you within 24 hours with pricing and availability. Quote List (0 items) Clear all Loading your items&#8230; Name * Email * Phone \/ WhatsApp * Country United StatesColombiaMexicoOther Company (optional) Your quote list above contains 0 parts. You can [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_joinchat":[],"footnotes":""},"class_list":["post-57506","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/allparts.expert\/es\/wp-json\/wp\/v2\/pages\/57506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/allparts.expert\/es\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/allparts.expert\/es\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/allparts.expert\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/allparts.expert\/es\/wp-json\/wp\/v2\/comments?post=57506"}],"version-history":[{"count":13,"href":"https:\/\/allparts.expert\/es\/wp-json\/wp\/v2\/pages\/57506\/revisions"}],"predecessor-version":[{"id":57585,"href":"https:\/\/allparts.expert\/es\/wp-json\/wp\/v2\/pages\/57506\/revisions\/57585"}],"wp:attachment":[{"href":"https:\/\/allparts.expert\/es\/wp-json\/wp\/v2\/media?parent=57506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}