diff options
Diffstat (limited to 'alphabetlearning/templates')
4 files changed, 13 insertions, 5 deletions
diff --git a/alphabetlearning/templates/payments/cart_detail.html b/alphabetlearning/templates/payments/cart_detail.html index 8c6c01b..46117d1 100644 --- a/alphabetlearning/templates/payments/cart_detail.html +++ b/alphabetlearning/templates/payments/cart_detail.html @@ -21,9 +21,8 @@ </div> <div class="col-4 my-5"> - {% include "payments/cart_sidepanel.html" with cart=cart %} + {% include "payments/cart_sidepanel.html" with cart=cart total=total %} </div> - </div> {% else %} <p>Your cart is empty.</p> diff --git a/alphabetlearning/templates/payments/cart_sidepanel.html b/alphabetlearning/templates/payments/cart_sidepanel.html index 7742c9a..b788d24 100644 --- a/alphabetlearning/templates/payments/cart_sidepanel.html +++ b/alphabetlearning/templates/payments/cart_sidepanel.html @@ -23,6 +23,9 @@ </div> <div class="d-grid gap-2 mx-auto col-11"> - <button class="btn btn-primary btn-lg">Checkout now</button> + <form action="{% url 'payments:create-checkout-session' cart.id %}" method="POST"> + {% csrf_token %} + <button class="btn btn-primary btn-lg">Checkout now</button> + </form> </div> </div> diff --git a/alphabetlearning/templates/resources/resource_card_featured.html b/alphabetlearning/templates/resources/resource_card_featured.html index 8a92729..c83ac0f 100644 --- a/alphabetlearning/templates/resources/resource_card_featured.html +++ b/alphabetlearning/templates/resources/resource_card_featured.html @@ -32,7 +32,10 @@ {% endif %} <div class="d-flex flex-row justify-content-between align-items-end mt-2"> <p class="card-text m-1"><small class="text-muted">1 credit</small></p> - <button type="button" class="btn btn-success fs-6 px-2 py-0">Add to basket</button> + <form action="{% url 'payments:add_to_basket' resource.id %}" method="POST"> + {% csrf_token %} + <button type="submit" class="btn btn-success fs-6 px-2 py-0">Add to basket</button> + </form> </div> </div> diff --git a/alphabetlearning/templates/resources/resource_card_standard.html b/alphabetlearning/templates/resources/resource_card_standard.html index f8a557b..9850117 100644 --- a/alphabetlearning/templates/resources/resource_card_standard.html +++ b/alphabetlearning/templates/resources/resource_card_standard.html @@ -37,7 +37,10 @@ </div> <div class="d-flex flex-row justify-content-between align-items-end mt-2"> <p class="card-text m-1"><small class="text-muted">1 credit</small></p> - <button type="button" class="btn btn-success fs-6 px-2 py-0">Add to basket</button> + <form action="{% url 'payments:add_to_basket' resource.id %}" method="POST"> + {% csrf_token %} + <button type="submit" class="btn btn-success fs-6 px-2 py-0">Add to basket</button> + </form> </div> </div> </div> |