fix: repair contact flow and buy flow targets

- Buy Now product IDs aligned to the Odoo shop (54/55/56), matching odoo/upsell.html
- support.html contact form: rewire from dead ODOO4projects.com/website/form endpoint to n8n CRM webhook; remove /web/csrf_token prefetch; show success only on res.ok (previously always showed 'submitted' even when nothing was delivered)
- /contactus links (footer nav, Schema contactPoint, order widget fallback, trial email) retargeted to support.html#contact; canonical/og:url corrected to /support.html
- Custom Quote and footer contact handlers hardened with res.ok checks
- buyNow basket target verified: 20.odoo4projects.com/shop/post_basket (200)
This commit is contained in:
Reef committed 2026-10-12 15:41:11 +00:00
1 parent 04d39157b8
commit 354799b9ca
5 files changed
+31 -22

No files matched your search

+19 -12
View File
@@ -8,11 +8,11 @@
content="Support and FAQ for ODOO4projects hosting. Get help with your Odoo instance, modules, backups, domains, and more."
/>
<title>Support | ODOO4projects</title>
<link rel="canonical" href="https://ODOO4projects.com/support" />
<link rel="canonical" href="https://ODOO4projects.com/support.html" />
<meta property="og:title" content="Support | ODOO4projects" />
<meta property="og:description" content="Support and FAQ for ODOO4projects hosting." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://ODOO4projects.com/support" />
<meta property="og:url" content="https://ODOO4projects.com/support.html" />
<meta name="twitter:card" content="summary_large_image" />
<link rel="icon" href="images/favicon.ico" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
@@ -474,8 +474,7 @@
<section class="contact-section" id="contact">
<div class="container">
<h2>Still questions? Contact our support.</h2>
<form class="contact-form" id="supportForm" action="https://ODOO4projects.com/website/form/" method="POST" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" id="csrfToken" value="" />
<form class="contact-form" id="supportForm">
<div class="form-group">
<label>Your Name <span class="required">*</span></label>
<input type="text" id="contactName" name="contact_name" required placeholder="Your Name" />
@@ -528,23 +527,31 @@
var form = document.getElementById("supportForm");
var submitBtn = form.querySelector(".btn");
var successDiv = document.getElementById("formSuccess");
fetch("https://ODOO4projects.com/web/csrf_token")
.then(function (r) { return r.json(); })
.then(function (data) {
document.getElementById("csrfToken").value = data.result || data.csrf_token || "";
}).catch(function () {});
form.addEventListener("submit", function (e) {
e.preventDefault();
var name = document.getElementById("contactName").value.trim();
var email = document.getElementById("contactEmail").value.trim();
var uuid = document.getElementById("contactUuid").value.trim();
var subject = document.getElementById("contactSubject").value.trim();
var question = document.getElementById("contactQuestion").value.trim();
if (!name || !email || !subject || !question) { alert("Please fill in all required fields."); return; }
submitBtn.disabled = true;
submitBtn.textContent = "Submitting...";
fetch(form.action, { method: "POST", body: new FormData(form) })
.then(function () { submitBtn.style.display = "none"; successDiv.classList.add("visible"); })
.catch(function () { submitBtn.disabled = false; submitBtn.textContent = "Submit"; alert("Could not submit. Please try again."); });
var payload = { name: name, email: email, subject: subject, requirements: question, area: "support" };
if (uuid) payload.uuid = uuid;
fetch("https://n8n.odoo4projects.com/webhook/ODOO4projects/crm", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
}).then(function (r) {
if (!r.ok) throw new Error("bad status " + r.status);
submitBtn.style.display = "none";
successDiv.classList.add("visible");
}).catch(function () {
submitBtn.disabled = false;
submitBtn.textContent = "Submit";
alert("Could not submit. Please try again.");
});
});
</script>