|
|
@ -30,9 +30,9 @@ function cartCheckout(formElement) { |
|
|
|
const formData = new FormData(formElement); |
|
|
|
const formData = new FormData(formElement); |
|
|
|
const submitButton = formElement.querySelector('button[type=submit]'); |
|
|
|
const submitButton = formElement.querySelector('button[type=submit]'); |
|
|
|
|
|
|
|
|
|
|
|
formData.forEach((value, key) => { |
|
|
|
// formData.forEach((value, key) => {
|
|
|
|
console.log(`${key}: ${value}`); |
|
|
|
// console.log(`${key}: ${value}`);
|
|
|
|
}); |
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -131,15 +131,7 @@ function handleConsultationForm(formElement) { |
|
|
|
.then(response => response.json()) |
|
|
|
.then(response => response.json()) |
|
|
|
.then(data => { |
|
|
|
.then(data => { |
|
|
|
if (data.success) { |
|
|
|
if (data.success) { |
|
|
|
const isFooterPopup = formElement.querySelector('[name="footer_popup_form"]'); |
|
|
|
window.location.href = '/spasibo-blue/'; |
|
|
|
const isConsultation = formElement.querySelector('[name="consultation_form"]'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isFooterPopup) { |
|
|
|
|
|
|
|
window.location.href = '/spasibo_blue/'; |
|
|
|
|
|
|
|
} else if (isConsultation) { |
|
|
|
|
|
|
|
window.location.href = '/spasibo-footer/'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
formElement.reset(); |
|
|
|
formElement.reset(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
showCartToast("Ошибка при отправке заявки", 3000, 'error'); |
|
|
|
showCartToast("Ошибка при отправке заявки", 3000, 'error'); |
|
|
|