nagasurendra commited on
Commit
b8875d8
·
verified ·
1 Parent(s): 702f63f

Update templates/cart.html

Browse files
Files changed (1) hide show
  1. 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
- /* Ensure the dropdown expands to the full width of the container */
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; /* Ensure the background is white */
58
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add shadow for dropdown */
59
  z-index: 10; /* Ensure it stays above other content */
 
60
  }
61
 
62
- /* Ensure when it's visible, it aligns correctly */
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; /* Ensures the label text is bold */
78
- color: black; /* Ensures the label text is black */
79
  }
80
 
 
81
  .coupon-selection a {
82
- color: #007bff; /* Make the '+ Apply Coupon' link blue */
83
- font-size: 1rem; /* Adjust the size of the link */
84
  text-decoration: none;
85
  }
86
 
87
- /* When the dropdown is visible, ensure it matches the width of the parent container */
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
- <!-- Coupon Section -->
331
- {% if coupons %}
332
- <div class="coupon-selection d-flex justify-content-between align-items-center">
333
- <label class="text-dark font-weight-bold mb-0">Apply Coupon</label>
334
- <a href="javascript:void(0);" id="applyCouponLink" onclick="toggleCouponDropdown()" class="text-primary">+ Apply Coupon</a>
335
- </div>
336
- <select id="couponDropdown" class="form-select mt-2" style="display:none;" onchange="calculateDiscount()">
337
- <option value="">Select a coupon</option>
338
- {% for coupon in coupons %}
339
- <option value="{{ coupon }}">{{ coupon }}</option>
340
- {% endfor %}
341
- </select>
342
- {% endif %}
 
 
 
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">