Spaces:
Runtime error
Runtime error
Update templates/cart.html
Browse files- templates/cart.html +20 -11
templates/cart.html
CHANGED
|
@@ -30,23 +30,30 @@
|
|
| 30 |
|
| 31 |
|
| 32 |
.cart-item {
|
| 33 |
-
display: flex;
|
| 34 |
-
align-items: flex-start;
|
| 35 |
-
justify-content: space-between;
|
| 36 |
border-bottom: 1px solid #e0e0e0;
|
| 37 |
padding: 15px 0;
|
| 38 |
-
height: auto; /* Ensure the container height adjusts to its content */
|
| 39 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
.cart-item img {
|
| 41 |
-
width:
|
| 42 |
-
height:
|
| 43 |
-
object-fit: contain;
|
| 44 |
-
border-radius: 8px;
|
| 45 |
transition: transform 0.3s;
|
| 46 |
-
margin-bottom: 10px;
|
| 47 |
-
align-self: flex-start; /* Ensure the image aligns to the top */
|
| 48 |
}
|
| 49 |
|
|
|
|
| 50 |
.cart-item img:hover {
|
| 51 |
transform: scale(1.05);
|
| 52 |
}
|
|
@@ -179,7 +186,9 @@
|
|
| 179 |
<!-- Cart Items -->
|
| 180 |
{% for item in cart_items %}
|
| 181 |
<div class="cart-item">
|
| 182 |
-
<
|
|
|
|
|
|
|
| 183 |
<div class="cart-item-details">
|
| 184 |
<div class="cart-item-title">
|
| 185 |
{{ item.Name }}
|
|
|
|
| 30 |
|
| 31 |
|
| 32 |
.cart-item {
|
| 33 |
+
display: flex; /* Flexbox layout for the cart item */
|
| 34 |
+
align-items: flex-start; /* Ensure the image and content align at the top */
|
| 35 |
+
justify-content: space-between; /* Spread image and content across the container */
|
| 36 |
border-bottom: 1px solid #e0e0e0;
|
| 37 |
padding: 15px 0;
|
|
|
|
| 38 |
}
|
| 39 |
+
|
| 40 |
+
.image-wrapper {
|
| 41 |
+
width: 80px; /* Width of the image container */
|
| 42 |
+
height: 80px; /* Height of the image container */
|
| 43 |
+
display: flex; /* Flex container for image */
|
| 44 |
+
align-items: flex-start; /* Align the image at the top */
|
| 45 |
+
justify-content: center; /* Center image horizontally if it has space */
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
.cart-item img {
|
| 49 |
+
width: 100%; /* Fill the image container */
|
| 50 |
+
height: auto; /* Maintain aspect ratio */
|
| 51 |
+
object-fit: contain; /* Ensure the full image is visible */
|
| 52 |
+
border-radius: 8px; /* Optional: rounded corners */
|
| 53 |
transition: transform 0.3s;
|
|
|
|
|
|
|
| 54 |
}
|
| 55 |
|
| 56 |
+
|
| 57 |
.cart-item img:hover {
|
| 58 |
transform: scale(1.05);
|
| 59 |
}
|
|
|
|
| 186 |
<!-- Cart Items -->
|
| 187 |
{% for item in cart_items %}
|
| 188 |
<div class="cart-item">
|
| 189 |
+
<div class="image-wrapper">
|
| 190 |
+
<img src="{{ item.Image1__c }}" alt="{{ item.Name }}" onerror="this.src='/static/placeholder.jpg';">
|
| 191 |
+
</div>
|
| 192 |
<div class="cart-item-details">
|
| 193 |
<div class="cart-item-title">
|
| 194 |
{{ item.Name }}
|