Public Access
Buy Area
This commit is contained in:
1 parent
5cc0c06a11
commit
04d39157b8
3 files changed
+127
-23
No files matched your search
@@ -701,7 +701,7 @@ var si = 0,
|
||||
var version = verSelect ? verSelect.value : '';
|
||||
var form = document.createElement('form');
|
||||
form.method = 'POST';
|
||||
form.action = 'https://odoo.odoo4projects.com/shop/post_basket';
|
||||
form.action = 'https://20.odoo4projects.com/shop/post_basket';
|
||||
form.target = '_blank';
|
||||
form.style.display = 'none';
|
||||
var basket = document.createElement('input');
|
||||
@@ -843,7 +843,8 @@ var si = 0,
|
||||
body: JSON.stringify(UTM.inject({
|
||||
name: name,
|
||||
email: email,
|
||||
requirements: requirements
|
||||
requirements: requirements,
|
||||
area: 'quote'
|
||||
}))
|
||||
}).then(function() {
|
||||
customQuoteForm.style.display = 'none';
|
||||
@@ -870,3 +871,46 @@ var si = 0,
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
/* ---- Footer contact form ---- */
|
||||
(function () {
|
||||
var form = document.getElementById('footerContactForm');
|
||||
if (!form) return;
|
||||
var emailInput = document.getElementById('footerContactEmail');
|
||||
var textInput = document.getElementById('footerContactText');
|
||||
var submitBtn = form.querySelector('.footer-send-btn');
|
||||
var status = document.getElementById('footerFormStatus');
|
||||
|
||||
function showStatus(message, isError) {
|
||||
status.textContent = message;
|
||||
status.classList.toggle('error', !!isError);
|
||||
status.classList.add('visible');
|
||||
}
|
||||
|
||||
form.addEventListener('submit', function (e) {
|
||||
e.preventDefault();
|
||||
var email = emailInput.value.trim();
|
||||
var text = textInput.value.trim();
|
||||
if (!email || !text) return;
|
||||
|
||||
submitBtn.disabled = true;
|
||||
status.classList.remove('visible');
|
||||
|
||||
fetch('https://n8n.odoo4projects.com/webhook/ODOO4projects/crm', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(UTM.inject({
|
||||
email: email,
|
||||
requirements: text,
|
||||
area: 'message'
|
||||
}))
|
||||
}).then(function () {
|
||||
form.reset();
|
||||
submitBtn.disabled = false;
|
||||
showStatus("Thanks! We'll get back to you shortly.", false);
|
||||
}).catch(function () {
|
||||
submitBtn.disabled = false;
|
||||
showStatus('Something went wrong. Please try again.', true);
|
||||
});
|
||||
});
|
||||
})();
|
||||
Reference in new issue
Block a user