feat(course_page.html): use form for buy course button as checkout now individually-managed

This commit is contained in:
2026-05-20 19:13:59 +02:00
parent 41af6dcb7c
commit 365b28a165

View File

@@ -55,8 +55,12 @@
<h2 class="not-prose text-2xl mt-4 text-gray-700 font-semibold"> <h2 class="not-prose text-2xl mt-4 text-gray-700 font-semibold">
{{ page.purchasable_products.first.price | floatformat:2 }} {{ page.purchasable_products.first.currency | upper }} {{ page.purchasable_products.first.price | floatformat:2 }} {{ page.purchasable_products.first.currency | upper }}
</h2> </h2>
<a href="{{ page.purchasable_products.first.stripe_payment_url }}?prefilled_email={{ user.email }}" <form method="post" action="{% url 'create_checkout_session' purchasable_id=page.purchasable_products.first.id %}">
class="mt-2 inline-block bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700 transition">{% trans "Purchase Course" %}</a> {% csrf_token %}
<button type="submit" class="mt-2 inline-block bg-green-600 text-white px-4 py-2 rounded cursor-pointer hover:bg-green-700 transition">
{% trans "Purchase Course" %}
</button>
</form>
</div> </div>
{% endif %} {% endif %}
{% endblock content %} {% endblock content %}