feat: rename Rates & SUITES to Order & Pricing, add Custom Quote modal

- Change section header to 'Order & Pricing'
- Add 'Get Custom Quote' button that opens modal with name, email, requirements fields
- Requirements field has placeholder: 'Describe your requirements (how many users? onsite, cloud? how many workers?)'
- Submit to https://n8n.odoo4projects.com/webhook/ODOO4projects/crm with UTM tracking
- Empire 'Get Custom Quote' button now opens modal instead of Order Widget
- Add CSS for modal overlay, form styling, and mobile responsiveness
This commit is contained in:
ODOO4projects Web Developer committed 2026-10-08 17:39:08 +00:00
1 parent 729289ef71
commit 79f2a71d49
2 files changed
+111 -7

No files matched your search

+68 -4
View File
@@ -796,10 +796,74 @@ var si = 0,
document.querySelectorAll('.btn-empire').forEach(function(btn) {
btn.addEventListener('click', function() {
var plan = this.getAttribute('data-plan');
var price = parseFloat(this.getAttribute('data-price'));
var isEmpire = this.getAttribute('data-is-empire') === 'true';
if (plan) openOrderWidget(plan, price, isEmpire);
openCustomQuoteModal();
});
});
/* ---- Custom Quote Modal ---- */
function openCustomQuoteModal() {
document.getElementById('customQuotePanel').style.display = 'block';
document.getElementById('customQuoteModal').style.display = 'flex';
}
function closeCustomQuoteModal() {
document.getElementById('customQuoteModal').style.display = 'none';
document.getElementById('customQuoteForm').reset();
document.getElementById('customQuoteSuccess').style.display = 'none';
}
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
var modal = document.getElementById('customQuoteModal');
if (modal && modal.style.display === 'flex') {
closeCustomQuoteModal();
}
}
});
/* Submit custom quote form */
var customQuoteForm = document.getElementById('customQuoteForm');
if (customQuoteForm) {
customQuoteForm.addEventListener('submit', function(e) {
e.preventDefault();
var name = document.getElementById('cqName').value.trim();
var email = document.getElementById('cqEmail').value.trim();
var requirements = document.getElementById('cqRequirements').value.trim();
if (!name || !email || !requirements) return;
var submitBtn = customQuoteForm.querySelector('.btn-lg');
submitBtn.textContent = 'Sending...';
submitBtn.disabled = true;
fetch('https://n8n.odoo4projects.com/webhook/ODOO4projects/crm', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(UTM.inject({
name: name,
email: email,
requirements: requirements
}))
}).then(function() {
customQuoteForm.style.display = 'none';
document.getElementById('customQuoteSuccess').style.display = 'block';
submitBtn.textContent = 'Submit Request';
submitBtn.disabled = false;
}).catch(function() {
submitBtn.textContent = 'Submit Request';
submitBtn.disabled = false;
var errorMsg = document.createElement('div');
errorMsg.style.marginTop = '1rem';
errorMsg.style.color = '#dc3545';
errorMsg.textContent = 'Something went wrong. Please try again.';
customQuoteForm.appendChild(errorMsg);
setTimeout(function() { if(errorMsg.parentNode) errorMsg.parentNode.removeChild(errorMsg); }, 3000);
});
});
}
/* Attach "Get Custom Quote" click handlers to Empire buttons */
document.querySelectorAll('.btn-empire').forEach(function(btn) {
btn.addEventListener('click', function() {
openCustomQuoteModal();
});
});
})();