
ORYGINALNA KOSZULKA
Minimalistyczny design. Wysoka jakość.
Zamów swoją koszulkę online.
Dane do zamówienia
Paczkomat / punkt odbioru
— bezpłatnie
Dostawa kurierem
— 14,99 zł
99,99 zł
—
0,00 zł
99,99 zł
let selectedSize = null;
const PRODUCT_PRICE = 99.99;
/* WYBÓR ROZMIARU */
function selectSize(button) {
document
.querySelectorAll(".size")
.forEach(function(btn) {
btn.classList.remove("active");
});
button.classList.add("active");
selectedSize = button.textContent.trim();
document.getElementById("summarySize").textContent =
selectedSize;
}
/* OTWARCIE FORMULARZA */
function openCheckout() {
if (!selectedSize) {
alert("Najpierw wybierz rozmiar koszulki.");
return;
}
const checkout =
document.getElementById("checkout");
checkout.classList.add("show");
checkout.scrollIntoView({
behavior: "smooth"
});
}
/* AKTUALIZACJA CENY */
function updateTotal() {
const delivery =
parseFloat(
document.querySelector(
'input[name="delivery"]:checked'
).value
);
document.getElementById("deliveryPrice")
.textContent =
delivery.toFixed(2).replace(".", ",")
+ " zł";
const total =
PRODUCT_PRICE + delivery;
document.getElementById("total")
.textContent =
total.toFixed(2).replace(".", ",")
+ " zł";
}
/* ZŁOŻENIE ZAMÓWIENIA */
function submitOrder() {
const name =
document.getElementById("name").value.trim();
const email =
document.getElementById("email").value.trim();
const phone =
document.getElementById("phone").value.trim();
const street =
document.getElementById("street").value.trim();
const postcode =
document.getElementById("postcode").value.trim();
const city =
document.getElementById("city").value.trim();
if (!selectedSize) {
alert("Wybierz rozmiar.");
return;
}
if (
!name ||
!email ||
!phone ||
!street ||
!postcode ||
!city
) {
alert(
"Uzupełnij wszystkie wymagane dane."
);
return;
}
/*
TUTAJ BĘDZIE PODŁĄCZONA
PRAWDZIWA PŁATNOŚĆ ONLINE.
Nie wpisujemy tutaj fikcyjnego
linku do BLIK.
*/
alert(
"Formularz jest poprawny.\n\n" +
"Rozmiar: " + selectedSize +
"\nKlient: " + name +
"\n\nNastępny krok: podłączenie płatności."
);
}