Spaces:
Sleeping
Sleeping
Update templates/cart.html
Browse files- templates/cart.html +38 -1
templates/cart.html
CHANGED
|
@@ -46,6 +46,37 @@
|
|
| 46 |
border-radius: 8px; /* Optional: rounded corners */
|
| 47 |
transition: transform 0.3s;
|
| 48 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
.cart-item img:hover {
|
| 50 |
transform: scale(1.05);
|
| 51 |
}
|
|
@@ -381,10 +412,16 @@
|
|
| 381 |
}
|
| 382 |
function toggleCouponDropdown() {
|
| 383 |
let couponDropdown = document.getElementById('couponDropdown');
|
|
|
|
| 384 |
// Toggle the visibility of the coupon dropdown
|
| 385 |
-
couponDropdown.style.display
|
|
|
|
|
|
|
|
|
|
|
|
|
| 386 |
}
|
| 387 |
|
|
|
|
| 388 |
function calculateDiscount() {
|
| 389 |
let couponDropdown = document.getElementById('couponDropdown'); // Get coupon dropdown
|
| 390 |
let selectedCoupon = couponDropdown.value.trim(); // Get the selected coupon value
|
|
|
|
| 46 |
border-radius: 8px; /* Optional: rounded corners */
|
| 47 |
transition: transform 0.3s;
|
| 48 |
}
|
| 49 |
+
/* Ensure the dropdown expands to the full width of the container */
|
| 50 |
+
#couponDropdown {
|
| 51 |
+
width: 100%; /* Make the dropdown fill the parent container */
|
| 52 |
+
display: none; /* Hidden by default */
|
| 53 |
+
margin-top: 10px;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
/* Make the Apply Coupon link and label aligned properly */
|
| 57 |
+
.coupon-selection {
|
| 58 |
+
display: flex;
|
| 59 |
+
justify-content: space-between;
|
| 60 |
+
align-items: center;
|
| 61 |
+
font-size: 1rem;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.coupon-selection label {
|
| 65 |
+
font-weight: bold; /* Ensures the label text is bold */
|
| 66 |
+
color: black; /* Ensures the label text is black */
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
.coupon-selection a {
|
| 70 |
+
color: #007bff; /* Make the '+ Apply Coupon' link blue */
|
| 71 |
+
font-size: 1rem; /* Adjust the size of the link */
|
| 72 |
+
text-decoration: none;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
/* When the dropdown is visible, ensure it matches the width of the parent container */
|
| 76 |
+
#couponDropdown.show {
|
| 77 |
+
display: block;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
.cart-item img:hover {
|
| 81 |
transform: scale(1.05);
|
| 82 |
}
|
|
|
|
| 412 |
}
|
| 413 |
function toggleCouponDropdown() {
|
| 414 |
let couponDropdown = document.getElementById('couponDropdown');
|
| 415 |
+
|
| 416 |
// Toggle the visibility of the coupon dropdown
|
| 417 |
+
if (couponDropdown.style.display === "none" || couponDropdown.style.display === "") {
|
| 418 |
+
couponDropdown.style.display = "block";
|
| 419 |
+
} else {
|
| 420 |
+
couponDropdown.style.display = "none";
|
| 421 |
+
}
|
| 422 |
}
|
| 423 |
|
| 424 |
+
|
| 425 |
function calculateDiscount() {
|
| 426 |
let couponDropdown = document.getElementById('couponDropdown'); // Get coupon dropdown
|
| 427 |
let selectedCoupon = couponDropdown.value.trim(); // Get the selected coupon value
|