This commit is contained in:
Oliver
2025-10-04 06:54:04 -03:00
parent e8fa02b6b6
commit baad50071d

View File

@@ -131,13 +131,6 @@ function openModal(productHref) {
product = parts[parts.length - 2] || "Product";
price = parts[parts.length - 1] || "0";
}
product = product.replace(/_/g, "");
modal.querySelector('input[name="product"]').value = product;
modal.querySelector('input[name="price"]').value = price;
modal.querySelector("#productText").textContent = `You will buy ${product} for $${price}.`;
// Show/hide location select
const locationSelect = document.getElementById("locationSelect");
if (product.startsWith("_")) {
@@ -148,8 +141,14 @@ function openModal(productHref) {
locationSelect.removeAttribute("required");
locationSelect.value = ""; // reset
}
product = product.replace(/_/g, ""); // This needs to be after the locationSelect show ;)
modal.querySelector('input[name="product"]').value = product;
modal.querySelector('input[name="price"]').value = price;
modal.querySelector("#productText").textContent = `You will buy ${product} for $${price}.`;
}
function handleFormSubmit() {
const form = document.getElementById("buyForm");
const confirmation = document.getElementById("confirmation");