Spaces:
Sleeping
Sleeping
Update templates/cart.html
Browse files- templates/cart.html +29 -32
templates/cart.html
CHANGED
|
@@ -46,26 +46,17 @@
|
|
| 46 |
border-radius: 8px; /* Optional: rounded corners */
|
| 47 |
transition: transform 0.3s;
|
| 48 |
}
|
| 49 |
-
|
| 50 |
-
/* Ensure the dropdown expands to 30% width of the parent container */
|
| 51 |
#couponDropdown {
|
| 52 |
width: 30%; /* Set the dropdown width to 30% */
|
| 53 |
-
position: absolute; /* Position it absolutely */
|
| 54 |
-
top: 0; /* Align it to the top of the parent container */
|
| 55 |
-
right: 0; /* Align it to the right of the parent container */
|
| 56 |
display: none; /* Hidden by default */
|
| 57 |
-
background-color: #fff; /*
|
| 58 |
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add shadow
|
| 59 |
z-index: 10; /* Ensure it stays above other content */
|
|
|
|
| 60 |
}
|
| 61 |
|
| 62 |
-
/*
|
| 63 |
-
#couponDropdown.show {
|
| 64 |
-
display: block; /* Show the dropdown when active */
|
| 65 |
-
}
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
/* Make the Apply Coupon link and label aligned properly */
|
| 69 |
.coupon-selection {
|
| 70 |
display: flex;
|
| 71 |
justify-content: space-between;
|
|
@@ -73,22 +64,25 @@
|
|
| 73 |
font-size: 1rem;
|
| 74 |
}
|
| 75 |
|
|
|
|
| 76 |
.coupon-selection label {
|
| 77 |
-
font-weight: bold;
|
| 78 |
-
color: black;
|
| 79 |
}
|
| 80 |
|
|
|
|
| 81 |
.coupon-selection a {
|
| 82 |
-
color: #007bff;
|
| 83 |
-
font-size: 1rem;
|
| 84 |
text-decoration: none;
|
| 85 |
}
|
| 86 |
|
| 87 |
-
/*
|
| 88 |
#couponDropdown.show {
|
| 89 |
display: block;
|
| 90 |
}
|
| 91 |
|
|
|
|
| 92 |
.cart-item img:hover {
|
| 93 |
transform: scale(1.05);
|
| 94 |
}
|
|
@@ -327,19 +321,22 @@
|
|
| 327 |
|
| 328 |
<!-- Subtotal -->
|
| 329 |
<div class="cart-summary">
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
|
|
|
|
|
|
|
|
|
| 343 |
|
| 344 |
|
| 345 |
<div class="bill-details">
|
|
|
|
| 46 |
border-radius: 8px; /* Optional: rounded corners */
|
| 47 |
transition: transform 0.3s;
|
| 48 |
}
|
| 49 |
+
/* Ensure the dropdown only takes 30% of the width */
|
|
|
|
| 50 |
#couponDropdown {
|
| 51 |
width: 30%; /* Set the dropdown width to 30% */
|
|
|
|
|
|
|
|
|
|
| 52 |
display: none; /* Hidden by default */
|
| 53 |
+
background-color: #fff; /* White background for the dropdown */
|
| 54 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add shadow to dropdown */
|
| 55 |
z-index: 10; /* Ensure it stays above other content */
|
| 56 |
+
margin-top: 10px; /* Space between the link and the dropdown */
|
| 57 |
}
|
| 58 |
|
| 59 |
+
/* Positioning the Apply Coupon link and dropdown */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
.coupon-selection {
|
| 61 |
display: flex;
|
| 62 |
justify-content: space-between;
|
|
|
|
| 64 |
font-size: 1rem;
|
| 65 |
}
|
| 66 |
|
| 67 |
+
/* Make the Apply Coupon text bold and black */
|
| 68 |
.coupon-selection label {
|
| 69 |
+
font-weight: bold;
|
| 70 |
+
color: black;
|
| 71 |
}
|
| 72 |
|
| 73 |
+
/* Apply Coupon link styles */
|
| 74 |
.coupon-selection a {
|
| 75 |
+
color: #007bff; /* Blue color for the + Apply Coupon link */
|
| 76 |
+
font-size: 1rem;
|
| 77 |
text-decoration: none;
|
| 78 |
}
|
| 79 |
|
| 80 |
+
/* Show the dropdown when active */
|
| 81 |
#couponDropdown.show {
|
| 82 |
display: block;
|
| 83 |
}
|
| 84 |
|
| 85 |
+
|
| 86 |
.cart-item img:hover {
|
| 87 |
transform: scale(1.05);
|
| 88 |
}
|
|
|
|
| 321 |
|
| 322 |
<!-- Subtotal -->
|
| 323 |
<div class="cart-summary">
|
| 324 |
+
<!-- Coupon Section -->
|
| 325 |
+
{% if coupons %}
|
| 326 |
+
<div class="coupon-selection d-flex justify-content-between align-items-center">
|
| 327 |
+
<label class="text-dark font-weight-bold mb-0">Apply Coupon</label>
|
| 328 |
+
<a href="javascript:void(0);" id="applyCouponLink" onclick="toggleCouponDropdown()" class="text-primary">+ Apply Coupon</a>
|
| 329 |
+
</div>
|
| 330 |
+
|
| 331 |
+
<!-- Coupon Dropdown, positioned below Apply Coupon -->
|
| 332 |
+
<select id="couponDropdown" class="form-select mt-2" style="display:none;" onchange="calculateDiscount()">
|
| 333 |
+
<option value="">Select a coupon</option>
|
| 334 |
+
{% for coupon in coupons %}
|
| 335 |
+
<option value="{{ coupon }}">{{ coupon }}</option>
|
| 336 |
+
{% endfor %}
|
| 337 |
+
</select>
|
| 338 |
+
{% endif %}
|
| 339 |
+
|
| 340 |
|
| 341 |
|
| 342 |
<div class="bill-details">
|