The parking purchase form is a unique form setup that isn’t captured by default and has sensitive data.
Created custom code that will both capture the form, exclude sensitive data, and capture the total purchase.
(function() {
var fieldMap = {
‘aceparking-review-email’: ’email’,
‘aceparking-review-first-name’: ‘first_name’,
‘aceparking-review-last-name’: ‘last_name’,
‘aceparking-review-phone’: ‘phone’,
‘aceparking-review-plate’: ‘license_plate’,
‘aceparking-review-plate-state’: ‘plate_state’,
‘aceparking-review-card-name’: ‘card_name’,
‘aceparking-review-billing-street’: ‘billing_street’,
‘aceparking-review-billing-city’: ‘billing_city’,
‘aceparking-review-billing-state’: ‘billing_state’,
‘aceparking-review-zip’: ‘billing_zip’
};
function addNames() {
var form = document.querySelector(‘form.aceparking_review’);
if (!form) return;
for (var id in fieldMap) {
if (fieldMap.hasOwnProperty(id)) {
var el = document.getElementById(id);
if (el && !el.getAttribute(‘name’)) {
el.setAttribute(‘name’, fieldMap[id]);
}
}
}
var totalEl = document.querySelector(‘.aceparking_totalBar.aceparking_pricingTotalBar strong’);
if (totalEl && !document.getElementById(‘mcfx-purchase-total’)) {
var totalInput = document.createElement(‘input’);
totalInput.type = ‘hidden’;
totalInput.id = ‘mcfx-purchase-total’;
totalInput.name = ‘purchase_total’;
totalInput.value = totalEl.textContent.trim();
form.appendChild(totalInput);
}
clearInterval(intervalId);
console.log(‘[MCFX] Field names added’);
console.log(‘[MCFX] Purchase total:’, totalEl ? totalEl.textContent.trim() : ‘not found’);
}
var intervalId = setInterval(addNames, 500);
})();
Able to create a custom code that will capture the unique parking purchase form setup and keep the total purchase excluding sensitive/confidential data.
Ticket: https://app.webfx.com/todos/269662646