Spaces:
Sleeping
Sleeping
Update templates/cart.html
Browse files- templates/cart.html +4 -1
templates/cart.html
CHANGED
@@ -160,7 +160,7 @@
|
|
160 |
<div class="reward-points-checkbox">
|
161 |
<label>
|
162 |
<input type="checkbox" id="rewardCheckbox" value="500">
|
163 |
-
|
164 |
</label>
|
165 |
</div>
|
166 |
{% endif %}
|
@@ -258,8 +258,11 @@
|
|
258 |
|
259 |
|
260 |
function proceedToOrder() {
|
|
|
261 |
fetch('/checkout', {
|
262 |
method: 'POST',
|
|
|
|
|
263 |
})
|
264 |
.then(response => response.json())
|
265 |
.then(data => {
|
|
|
160 |
<div class="reward-points-checkbox">
|
161 |
<label>
|
162 |
<input type="checkbox" id="rewardCheckbox" value="500">
|
163 |
+
Apply Reward Points ({{ reward_points }} points available)
|
164 |
</label>
|
165 |
</div>
|
166 |
{% endif %}
|
|
|
258 |
|
259 |
|
260 |
function proceedToOrder() {
|
261 |
+
const useRewardPoints = document.getElementById('rewardCheckbox').checked;
|
262 |
fetch('/checkout', {
|
263 |
method: 'POST',
|
264 |
+
headers: { 'Content-Type': 'application/json' },
|
265 |
+
body: JSON.stringify({ useRewardPoints: useRewardPoints })
|
266 |
})
|
267 |
.then(response => response.json())
|
268 |
.then(data => {
|